Package com.independentsoft.office
Class RawXmlElement
java.lang.Object
com.independentsoft.office.RawXmlElement
Captures the complete outer XML of an element subtree from a streaming
reader and re-emits it verbatim.
This is used to preserve, during a load/save round trip, elements whose
inner structure is not (yet) modelled as dedicated classes but whose content
must not be lost (for example VML drawing defaults such as
o:shapedefaults / o:shapelayout in settings.xml).
The captured string is produced by read(javax.xml.stream.XMLStreamReader) positioned on the element's
START_ELEMENT and stops once the matching END_ELEMENT has
been consumed.
-
Method Summary
Modifier and TypeMethodDescriptionclone()Gets the local name of the captured element.Gets the namespace URI of the captured element.Gets the captured outer XML.static RawXmlElementread(XMLStreamReader reader)Reads the current element subtree (the reader must be positioned on itsSTART_ELEMENT) and returns its captured outer XML.toString()
-
Method Details
-
read
Reads the current element subtree (the reader must be positioned on itsSTART_ELEMENT) and returns its captured outer XML. After this call the reader is positioned on the element'sEND_ELEMENT.- Parameters:
reader- the reader, positioned on the start element to capture- Returns:
- the captured element
- Throws:
XMLStreamException- on a stream error
-
getLocalName
Gets the local name of the captured element.- Returns:
- the local name
-
getNamespaceUri
Gets the namespace URI of the captured element.- Returns:
- the namespace URI
-
getOuterXml
Gets the captured outer XML.- Returns:
- the outer XML
-
toString
-
clone
-