|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
de.opsdesign.yax.helpers.SAXDocumentWriter
public class SAXDocumentWriter
XIncludeResolver based on
SAXXIncluder (see description below)
with following modifications:
- output to a StringWriter
- comments treated without using XIncludeFilter
Joerg Moebius, January 8, 2007
SAXXIncluder is a simple ContentHandler
that writes its XML document onto an output stream after resolving
all xinclude:include elements.
The only current known bug is that the notation and unparsed entity information items are not included in the result infoset. Furthermore, processing instructions in the DTD are not included. Note that this is only relevant to the source infoset. The DOCTYPE declaration is specifically excluded from included infosets.
I also need to check how section 4.4.3.1 applies for inscope namespaces in included documents. Currently this is not an issue because I only include full documents, but it may become an an issue when XPointer support is added.
There's no XPointer support yet. Only full documents are included.
The xinclude:fallback element is not yet supported.
The parser used to drive this must support the LexicalHandler
interface. It must also provide a Locator object.
These are optional in SAX, but Xerces-J does support these features.
| Field Summary | |
|---|---|
protected org.xml.sax.InputSource |
inputSource
|
| Constructor Summary | |
|---|---|
SAXDocumentWriter(org.xml.sax.InputSource inputSource)
|
|
SAXDocumentWriter(org.xml.sax.InputSource inputSource,
java.lang.String encoding)
|
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName)
|
void |
endEntity(java.lang.String name)
|
void |
endPrefixMapping(java.lang.String prefix)
|
java.lang.String |
getResult()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
log(java.lang.String msg)
|
void |
log(java.lang.String msg,
int msgSeverity)
|
void |
log(YaxEvent yaxEvent)
|
void |
log(YaxException yaxException)
resolves a passed through YaxException |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
void |
run()
|
void |
skippedEntity(java.lang.String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(java.lang.String name,
java.lang.String publicID,
java.lang.String systemID)
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName,
org.xml.sax.Attributes atts)
|
void |
startEntity(java.lang.String name)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
error, fatalError, notationDecl, resolveEntity, setDocumentLocator, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.xml.sax.InputSource inputSource
| Constructor Detail |
|---|
public SAXDocumentWriter(org.xml.sax.InputSource inputSource)
public SAXDocumentWriter(org.xml.sax.InputSource inputSource,
java.lang.String encoding)
| Method Detail |
|---|
public void run()
throws RunException
RunExceptionpublic java.lang.String getResult()
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException
endPrefixMapping in interface org.xml.sax.ContentHandlerendPrefixMapping in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
ignorableWhitespace in interface org.xml.sax.ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException
skippedEntity in interface org.xml.sax.ContentHandlerskippedEntity in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startDTD(java.lang.String name,
java.lang.String publicID,
java.lang.String systemID)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endDTD()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startEntity(java.lang.String name)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endEntity(java.lang.String name)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startCDATA()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endCDATA()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void comment(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void log(java.lang.String msg)
log in interface Loggable
public void log(java.lang.String msg,
int msgSeverity)
log in interface Loggablepublic void log(YaxEvent yaxEvent)
log in interface Loggablepublic void log(YaxException yaxException)
log in interface Loggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||