wt.util.xml.xslt
Class XMLSourceFactory

java.lang.Object
  extended bywt.util.xml.xslt.XMLSourceFactory
Direct Known Subclasses:
JAXPXMLSourceFactory

public abstract class XMLSourceFactory
extends Object

This factory class produces implementation instances of the interfaces in this package. Instances of this class should not be assumed to be thread-safe.

Supported API: true

Extendable: false


Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
 
Constructor Summary
XMLSourceFactory()
           
 
Method Summary
(package private) static XMLSource convertSAXtoSAX2(XMLSource xmlSource)
           
static XMLSourceFactory getFactory()
          Create an instance of the defauly implementation provided with Windchill.
static XMLSourceFactory getFactory(SAXParserFactory saxParserFactory, DocumentBuilderFactory documentBuilderFactory, TransformerFactory transformerFactory)
          Create an instance specifying factory instances explicitly.
static Parser getParserForSAXSource(SAXXMLSource source)
           
static XMLReader getXMLReaderForSAX2Source(SAX2XMLSource source)
           
 DOMXMLSource newDOMSource(Node node)
          Create a new DOMXMLSource for the provided DOM Node.
 DOMXMLSource newDOMSource(Node node, String baseURI)
          Create a new DOMXMLSource for the provided DOM Node and base URI.
 ReaderXMLSource newReaderSource(Reader reader)
          Create a new ReaderXMLSource for the provided Reader.
 ReaderXMLSource newReaderSource(Reader reader, String baseURI)
          Create a new ReaderXMLSource for the provided Reader and base URI.
 StreamXMLSource newStreamSource(InputStream inputStream)
          Create a new StreamXMLSource for the provided InputStream.
 StreamXMLSource newStreamSource(InputStream inputStream, String baseURI)
          Create a new StreamXMLSource for the provided InputStream and base URI.
abstract  Stylesheet newStylesheet(XMLSource xslSource)
          Create a new Stylesheet instance for the XSL document identified by the XMLSource.
 URLXMLSource newURLSource(File file)
          Create a new URLXMLSource for the provided File.
 URLXMLSource newURLSource(URL url)
          Create a new URLXMLSource for the provided URL.
 URLXMLSource newURLSource(URL url, String baseURI)
          Create a new URLXMLSource for the provided URL and base URI.
abstract  XSLTransform newXSLTransform(XMLSource xmlSource, Stylesheet stylesheet, Hashtable inputParameters)
          Create an XSLTransform instance to apply the stylesheet to the XML document identified by xmlSource.
abstract  XSLTransform newXSLTransform(XMLSource xmlSource, Stylesheet stylesheet, Hashtable inputParameters, String baseURI)
          Create an XSLTransform instance to apply the stylesheet to the XML document identified by xmlSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

XMLSourceFactory

public XMLSourceFactory()
Method Detail

getFactory

public static XMLSourceFactory getFactory()
Create an instance of the defauly implementation provided with Windchill.

Supported API: true

Returns:
XMLSourceFactory

newURLSource

public URLXMLSource newURLSource(URL url)
Create a new URLXMLSource for the provided URL. The base URI will be derived from the URI.

Supported API: true

Parameters:
url -
Returns:
URLXMLSource

newURLSource

public URLXMLSource newURLSource(URL url,
                                 String baseURI)
Create a new URLXMLSource for the provided URL and base URI. This method should be used instead of newURLSource(URL) when you want to either:

Supported API: true

Parameters:
url -
baseURI -
Returns:
URLXMLSource

newURLSource

public URLXMLSource newURLSource(File file)
                          throws MalformedURLException
Create a new URLXMLSource for the provided File. The base URI will be derived from the URI.

Supported API: true

Parameters:
file -
Returns:
URLXMLSource
Throws:
MalformedURLException

newDOMSource

public DOMXMLSource newDOMSource(Node node)
Create a new DOMXMLSource for the provided DOM Node. The base URI will be undefined. This may cause the XSLT function document() to fail when URLs passed to it are not fully qualified. Similarly, DTDs referenced from DOCTYPE tags within the XML document without fully qualified URLs will not be found.

Supported API: true

Parameters:
node -
Returns:
DOMXMLSource

newDOMSource

public DOMXMLSource newDOMSource(Node node,
                                 String baseURI)
Create a new DOMXMLSource for the provided DOM Node and base URI. Use of the XSLT function document() with URLs that are relative, will be relative to the base URI. Similarly, DTD's that are referenced from DOCTYPE tags in the XML data via relative URLs will be loaded from the base URI.

Supported API: true

Parameters:
node -
baseURI -
Returns:
DOMXMLSource

newStreamSource

public StreamXMLSource newStreamSource(InputStream inputStream)
Create a new StreamXMLSource for the provided InputStream. The base URI will be undefined. This may cause the XSLT function document() to fail when URLs passed to it are not fully qualified. Similarly, DTDs referenced from DOCTYPE tags within the XML document without fully qualified URLs will not be found.

Supported API: true

Parameters:
inputStream -
Returns:
StreamXMLSource

newStreamSource

public StreamXMLSource newStreamSource(InputStream inputStream,
                                       String baseURI)
Create a new StreamXMLSource for the provided InputStream and base URI. Use of the XSLT function document() with URLs that are relative, will be relative to the base URI. Similarly, DTD's that are referenced from DOCTYPE tags in the XML data via relative URLs will be loaded from the base URI.

Supported API: true

Parameters:
inputStream -
baseURI -
Returns:
StreamXMLSource

newReaderSource

public ReaderXMLSource newReaderSource(Reader reader)
Create a new ReaderXMLSource for the provided Reader. The base URI will be undefined. This may cause the XSLT function document() to fail when URLs passed to it are not fully qualified. Similarly, DTDs referenced from DOCTYPE tags within the XML document without fully qualified URLs will not be found.

Supported API: true

Parameters:
reader -
Returns:
ReaderXMLSource

newReaderSource

public ReaderXMLSource newReaderSource(Reader reader,
                                       String baseURI)
Create a new ReaderXMLSource for the provided Reader and base URI. Use of the XSLT function document() with URLs that are relative, will be relative to the base URI. Similarly, DTD's that are referenced from DOCTYPE tags in the XML data via relative URLs will be loaded from the base URI.

Supported API: true

Parameters:
reader -
baseURI -
Returns:
ReaderXMLSource

newXSLTransform

public abstract XSLTransform newXSLTransform(XMLSource xmlSource,
                                             Stylesheet stylesheet,
                                             Hashtable inputParameters)
                                      throws SAXException,
                                             IOException
Create an XSLTransform instance to apply the stylesheet to the XML document identified by xmlSource. Parameters may be passed to the XSLT stylesheet in the hashtable (the hashtable may be null if no parameters are being passed). Stylesheets imported or included by the provided Stylesheet are located relative to the base URI of the XMLSource that produced the Stylesheet if they are not fully qualified.

Supported API: true

Parameters:
xmlSource -
stylesheet -
inputParameters -
Returns:
XSLTransform
Throws:
SAXException
IOException
See Also:
Stylesheet, XMLSource

newXSLTransform

public abstract XSLTransform newXSLTransform(XMLSource xmlSource,
                                             Stylesheet stylesheet,
                                             Hashtable inputParameters,
                                             String baseURI)
                                      throws SAXException,
                                             IOException
Create an XSLTransform instance to apply the stylesheet to the XML document identified by xmlSource. Parameters may be passed to the XSLT stylesheet in the hashtable (the hashtable may be null if no parameters are being passed). Stylesheets imported or included by the provided Stylesheet are located relative to the specified base URI if they are not fully qualified.

Supported API: true

Parameters:
xmlSource -
stylesheet -
inputParameters -
baseURI -
Returns:
XSLTransform
Throws:
SAXException
IOException
See Also:
Stylesheet, XMLSource

newStylesheet

public abstract Stylesheet newStylesheet(XMLSource xslSource)
                                  throws SAXException,
                                         IOException
Create a new Stylesheet instance for the XSL document identified by the XMLSource. Once instantiated, this Stylesheet can be repeatedly by XSLTTransforms.

Supported API: true

Parameters:
xslSource -
Returns:
Stylesheet
Throws:
SAXException
IOException
See Also:
XSLTransform, newXSLTransform(wt.util.xml.xslt.XMLSource, wt.util.xml.xslt.Stylesheet, java.util.Hashtable)

getFactory

public static XMLSourceFactory getFactory(SAXParserFactory saxParserFactory,
                                          DocumentBuilderFactory documentBuilderFactory,
                                          TransformerFactory transformerFactory)
Create an instance specifying factory instances explicitly. If any of these are null then the Windchill default will be used instead for that factory (as with getFactory()).

Supported API: false

Parameters:
saxParserFactory -
documentBuilderFactory -
transformerFactory -
Returns:
XMLSourceFactory

getParserForSAXSource

public static Parser getParserForSAXSource(SAXXMLSource source)

getXMLReaderForSAX2Source

public static XMLReader getXMLReaderForSAX2Source(SAX2XMLSource source)

convertSAXtoSAX2

static XMLSource convertSAXtoSAX2(XMLSource xmlSource)