|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Raw inline data in leaf content.
Currently, this interface returns the raw inline data as a DOM node list. That will be awkward for some implementations, especially for any future implementations not based on a DOM tree. Possible future alternatives include returning all of the inline data as a string, and providing mechanisms for decoding encoded inline data (i.e. base64 and similar) to produce binary objects.
Method Summary | |
org.w3c.dom.NodeList |
getDOMNodes()
Get the inline data as a list of DOM nodes. |
String |
getText()
Get the inline data as plain text, ignoring any XML markup. |
String |
getXMLString()
Get the inline data as a fragment of XML markup. |
void |
setDOMNodes(org.w3c.dom.NodeList nodes)
Set the inline data as a list of DOM nodes. |
void |
setText(String text)
Set the inline data as plain text, escaping special characters. |
void |
setXMLString(String xml)
Parse the supplied string as XML and use it as the inline data. |
Methods inherited from interface org.newsml.toolkit.BaseNode |
getAttr, getChild, getChild, getChild, getChild, getChildCount, getChildCount, getParent, getPath, getSession, getXMLName, getXPath, insertAfter, insertAfter, insertAfter, insertAfter, insertAfterDuid, insertAfterDuid, insertBefore, insertBefore, insertBefore, insertBefore, insertBeforeDuid, insertBeforeDuid, insertChild, insertChild, insertFirst, insertFirst, insertLast, insertLast, removeChild, removeChild, removeSelf, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, setAttr, setAttr, toXML, toXML, unsetAttr, unsetAttr, writeXML, writeXML |
Methods inherited from interface org.newsml.toolkit.IdNode |
getDuid, getEuid |
Method Detail |
public org.w3c.dom.NodeList getDOMNodes()
This method may return more than one top-level node, possibly accompanied by text and whitespace.
public void setDOMNodes(org.w3c.dom.NodeList nodes)
This method allows the application to copy a set of already-existing DOM nodes as inline content. The NewsML document will always contain a copy of the nodes supplied, not the originals.
nodes
- The nodes to copy into the DataContent.public String getText()
This method is most useful when the inline content is base64-encoded binary data or something similar, where XML markup is not relevant and XML character escaping is undesirable.
public void setText(String text)
This method is useful for setting inline text without worrying about escaping special XML characters. An application would use this for embedded base64-encoded files, for example.
public String getXMLString()
This method is most useful when the inline content is NITF or XHTML XML markup or something similar, where the markup needs to be preserved for parsing by another software component. Note that the string is *not* guaranteed to be a well-formed XML document, since it may contain more than one top-level element.
BaseNode.toXML(boolean)
,
BaseNode.writeXML(java.io.Writer, boolean)
public void setXMLString(String xml) throws NewsMLException
This method is useful when a user wants to construct a string including XML markup and not have the markup escaped in the document. The string must contain a well-formed XML document with a single root element.
xml
- The XML string to parse: it must be a well-formed
XML document. That means that the return value of #getXMLString
is not always acceptable.NewsMLException
- If there is an error parsing the
XML string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |