|
SAP NetWeaver 7.30 SP01 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sapportals.wcm.protocol.ice.protocol.PreparsedXML
public class PreparsedXML
A very simple XML preparser that extracts the content information from an XML stream. This preparsing is necessary since:
InputStream to create or modify a resource, but
the SAX parser only invokes the method characters of the registered content
handler.BufferedStream for the content.
E.g. the input
<doc-element>
<element1>Some content for element1</element1>
<element2></element2>
<element3>Some content for element3</element3>
<element4/>
</doc-element>
will be converted by the preparser to
<doc-element>
<element1><?preparsed-xml-content?></element1>
<element2><?preparsed-xml-content?></element2>
<element3><?preparsed-xml-content?></element3>
<element4/><?preparsed-xml-content?>
</doc-element>
for the SAX parser. The method processingInstruction of the SAX content handler
has to invoke the method removeContentStream of the preparser once it encounters a
<?preparsed-xml-content?> processing instruction.
Note that the content of the items is forwarded to the SAX parser in any case except if the
method nextContentStream is invoked from within the method
startElement of the SAX content handler to get an InputStream on
the content element1 resp. element3 (the input streams of element2
and element4 are empty). Therefore, if the method nextContentStream is
not invoked the SAX parser behaves as usual.
Copyright 2004 SAP AG
| Constructor Summary | |
|---|---|
PreparsedXML(InputStream inputStream)
Create a new XML preparser. |
|
| Method Summary | |
|---|---|
InputStream |
getProcessorStream()
Gets the InputStream that should be used by the SAX parser. |
InputStream |
nextContentStream()
Gets the next element content stream from the stack. |
void |
removeContentStream()
Removes the current content stream from the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PreparsedXML(InputStream inputStream)
inputStream - The incomming XML stream| Method Detail |
|---|
public InputStream getProcessorStream()
InputStream that should be used by the SAX parser.
In this stream the element content is replaced by a <?preparsed-xml-content?> processing instruction.
InputStream for the SAX parser
public InputStream nextContentStream()
throws IOException
InputStream of the content of an element
IOException - on errorpublic void removeContentStream()
This method has to be invoked by the SAX content handler once it encounters a <?preparsed-xml-content?> processing instruction.
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
|
SAP NetWeaver 7.30 SP01 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||