|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.n3.nanoxml.StdXMLBuilder
net.n3.nanoxml.XIncludeXMLBuilder
public class XIncludeXMLBuilder
Extend the XMLBuilder to add XInclude functionality
Field Summary | |
---|---|
static java.lang.String |
ACCEPT_ENCODING
The attribute describing the accept header that will be used with http based includes. |
static java.lang.String |
ENCODING_ATTRIB
The attribute to decribe the encoding of the text include (no effect when parse='xml') |
static java.lang.String |
FALLBACK_ELEMENT
The element for handling fallbacks. |
static java.lang.String |
FRAGMENT
The fragment element is a root node element that can be used to wrap xml fragments for inclusion. |
static java.lang.String |
FRAGMENT_NS
Namespace for the "fragment" element used to include xml documents with no explicit root node. |
static java.lang.String |
HREF_ATTRIB
The location of the included data |
static java.lang.String |
INCLUDE_ELEMENT
The name of the include element (this should be "include" using the INCLUDE_NS but namespaces are not supported |
static java.lang.String |
INCLUDE_NS
Namespace for XInclude (NOTE that this is not used at the moment). |
static java.lang.String |
PARSE_ATTRIB
Parse attribute. |
static java.lang.String |
XPOINTER_ATTRIB
The xpointer attribute. |
Constructor Summary | |
---|---|
XIncludeXMLBuilder()
|
Method Summary | |
---|---|
void |
endElement(java.lang.String name,
java.lang.String nsPrefix,
java.lang.String nsSystemID)
This method is called when the end of an XML elemnt is encountered. |
private IXMLReader |
getReader(XMLElement element)
Return a reader for the specified INCLUDE_ELEMENT . |
private IXMLReader |
handleFallback(XMLElement include)
Handle the fallback if one exists. |
private void |
includeText(XMLElement element,
IXMLReader reader)
Include plain text. |
private void |
includeXML(XMLElement element,
IXMLReader reader)
Include the xml contained in the specified reader. |
private void |
processXInclude(XMLElement element)
This method handles XInclude elements in the code |
void |
startBuilding(java.lang.String systemID,
int lineNr)
used to record the system id for this document. |
Methods inherited from class net.n3.nanoxml.StdXMLBuilder |
---|
addAttribute, addPCData, elementAttributesProcessed, finalize, getCurrentElement, getResult, getStack, newProcessingInstruction, setRootElement, startElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INCLUDE_NS
public static final java.lang.String INCLUDE_ELEMENT
INCLUDE_NS
but namespaces are not supported
public static final java.lang.String HREF_ATTRIB
public static final java.lang.String XPOINTER_ATTRIB
public static final java.lang.String ENCODING_ATTRIB
public static final java.lang.String ACCEPT_ENCODING
public static final java.lang.String FALLBACK_ELEMENT
INCLUDE_NS
but namespaces are not supported
public static final java.lang.String PARSE_ATTRIB
public static final java.lang.String FRAGMENT_NS
public static final java.lang.String FRAGMENT
FRAGMENT_NS
but namespaces are not supported.
Constructor Detail |
---|
public XIncludeXMLBuilder()
Method Detail |
---|
public void endElement(java.lang.String name, java.lang.String nsPrefix, java.lang.String nsSystemID)
StdXMLBuilder
endElement
in interface IXMLBuilder
endElement
in class StdXMLBuilder
name
- the name of the elementnsPrefix
- the prefix used to identify the namespacensSystemID
- the system ID associated with the namespaceStdXMLBuilder.startElement(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
private void processXInclude(XMLElement element)
element
- the node currently being procesed. In this case it should
be the INCLUDE_ELEMENT
private IXMLReader handleFallback(XMLElement include)
include
- the include element
private void includeXML(XMLElement element, IXMLReader reader)
element
- the include elementreader
- the reader containing the xml to parse and include.private void includeText(XMLElement element, IXMLReader reader)
ENCODING_ATTRIB
if one was
present.
element
- the include elementreader
- the reader containing the include textprivate IXMLReader getReader(XMLElement element) throws XMLParseException, java.io.IOException
INCLUDE_ELEMENT
. The caller
is responsible for closing the reader produced.
element
- the include element to obtain a reader for
XMLParseException
- if a problem occurs parsing the
INCLUDE_ELEMENT
java.io.IOException
- if the href cannot be readpublic void startBuilding(java.lang.String systemID, int lineNr)
startBuilding
in interface IXMLBuilder
startBuilding
in class StdXMLBuilder
systemID
- the system id of the document being builtlineNr
- the line number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |