|
Java example source code file (SAXSource.java)
The SAXSource.java Java example source code/* * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.xml.transform.sax; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; /** * <p>Acts as an holder for SAX-style Source. * * <p>Note that XSLT requires namespace support. Attempting to transform an * input source that is not * generated with a namespace-aware parser may result in errors. * Parsers can be made namespace aware by calling the * {@link javax.xml.parsers.SAXParserFactory#setNamespaceAware(boolean awareness)} method.</p> * * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor */ public class SAXSource implements Source { /** * If {@link javax.xml.transform.TransformerFactory#getFeature} * returns true when passed this value as an argument, * the Transformer supports Source input of this type. */ public static final String FEATURE = "http://javax.xml.transform.sax.SAXSource/feature"; /** * <p>Zero-argument default constructor. If this constructor is used, and * no SAX source is set using * {@link #setInputSource(InputSource inputSource)} , then the * <code>Transformer will * create an empty source {@link org.xml.sax.InputSource} using * {@link org.xml.sax.InputSource#InputSource() new InputSource()}.</p> * * @see javax.xml.transform.Transformer#transform(Source xmlSource, Result outputTarget) */ public SAXSource() { } /** * Create a <code>SAXSource, using an {@link org.xml.sax.XMLReader} * and a SAX InputSource. The {@link javax.xml.transform.Transformer} * or {@link javax.xml.transform.sax.SAXTransformerFactory} will set itself * to be the reader's {@link org.xml.sax.ContentHandler}, and then will call * reader.parse(inputSource). * * @param reader An XMLReader to be used for the parse. * @param inputSource A SAX input source reference that must be non-null * and that will be passed to the reader parse method. */ public SAXSource(XMLReader reader, InputSource inputSource) { this.reader = reader; this.inputSource = inputSource; } /** * Create a <code>SAXSource, using a SAX Other Java examples (source code examples)Here is a short list of links related to this Java SAXSource.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.