com.xmlmind.xinclude
Class XLoader

java.lang.Object
  extended by com.xmlmind.domutil.LoaderImpl
      extended by com.xmlmind.xinclude.XLoader
All Implemented Interfaces:
Loader

public final class XLoader
extends LoaderImpl

An implementation of Loader which makes use of the XInclude 1.1 processor contained in this package.


Constructor Summary
XLoader()
           
XLoader(Console c)
           
 
Method Summary
 java.lang.String[] getIdAttribute()
          Returns a string pair containing the namespace URI and local name of the ID attribute.
 org.w3c.dom.Document load(java.io.InputStream in, java.net.URL url)
          Load document from specified input stream.
 void setIdAttribute(java.lang.String namespace, java.lang.String localName)
          Specifies the name of the ID attribute.
 void useId()
          Convenience method equivalent to setIdAttribute(null, "id").
 void useXMLId()
          Convenience method equivalent to setIdAttribute(XML_NS_URI, "id").
 
Methods inherited from class com.xmlmind.domutil.LoaderImpl
createXMLReader, format, getConsole, getEntityResolver, isAddingElementPointer, load, load, setAddingElementPointer, setConsole, setEntityResolver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XLoader

public XLoader()

XLoader

public XLoader(Console c)
Method Detail

setIdAttribute

public void setIdAttribute(java.lang.String namespace,
                           java.lang.String localName)
Specifies the name of the ID attribute.

By default, it's "xml:id".

This is needed to process XIncludes possibly found in loaded documents.

See Also:
getIdAttribute()

getIdAttribute

public java.lang.String[] getIdAttribute()
Returns a string pair containing the namespace URI and local name of the ID attribute.

The ID attribute is needed to process XIncludes possibly found in loaded documents.

See Also:
setIdAttribute(java.lang.String, java.lang.String)

useXMLId

public void useXMLId()
Convenience method equivalent to setIdAttribute(XML_NS_URI, "id").


useId

public void useId()
Convenience method equivalent to setIdAttribute(null, "id").


load

public org.w3c.dom.Document load(java.io.InputStream in,
                                 java.net.URL url)
                          throws java.io.IOException
Description copied from interface: Loader
Load document from specified input stream.

Note: xi:include elements (XInclude) are expected to have been processed in the loaded document.

Specified by:
load in interface Loader
Overrides:
load in class LoaderImpl
Parameters:
in - input stream allowing to load the document
url - URL of the document to be loaded if known; null otherwise
Returns:
loaded document
Throws:
java.io.IOException - if, for any reason, an I/O exception is raised during the processing. Note that XML parse exception and XInclude exception are reported as IOExceptions.