| java.lang.Object org.apache.lenya.xml.NamespaceHelper
Method Summary | |
public Element | createElement(String localName)
Creates an element within the namespace of this NamespaceHelper object
with a given local name containing a text node.
createElement("text") : <prefix:text/>.
Parameters: localName - The local name of the element. | public Element | createElement(String localName, String text)
Creates an element within the namespace of this NamespaceHelper object
with a given local name containing a text node.
createElement("text", "Hello World!") :
<prefix:text>Hello World!</prefix:text> .
Parameters: localName - The local name of the element. Parameters: text - The text for the text node inside the element. | public Element[] | getChildren(Element element) Returns all children of an element in the namespace of this
NamespaceHelper.
Parameters: element - The parent element. | public Element[] | getChildren(Element element, String localName) Returns all children of an element with a local name in the namespace of
this NamespaceHelper.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. | public Document | getDocument() Returns the document that is used to create elements. | public Element | getFirstChild(Element element, String localName) Returns the first childr of an element with a local name in the namespace
of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. | public String | getNamespaceURI() Returns the namespace URI of this NamespaceHelper. | public Element[] | getNextSiblings(Element element, String localName) Returns the next siblings of an element with a local name in the
namespace of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. | public Element[] | getPrecedingSiblings(Element element, String localName) Returns the preceding siblings of an element with a local name in the
namespace of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. | public String | getPrefix() Returns the namespace prefix that is used to create elements. | public static String | getQualifiedName(String prefix, String localName) Returns the qualified name for a local name using the prefix of this
NamespaceHelper.
Parameters: prefix - The namespace prefix. Parameters: localName - The local name. | public void | save(OutputStream stream) Saves the XML. |
NamespaceHelper | public NamespaceHelper(String _namespaceUri, String _prefix, Document _document)(Code) | | Creates a new instance of NamespaceHelper using an existing document. The
document is not affected. If the prefix is null , the default namespace
is used.
Parameters: _document - The document. Parameters: _namespaceUri - The namespace URI. Parameters: _prefix - The namespace prefix. |
NamespaceHelper | public NamespaceHelper(String _namespaceUri, String _prefix, String localName) throws ParserConfigurationException(Code) | |
Creates a new instance of NamespaceHelper. A new document is created
using a document element in the given namespace with the given prefix. If
the prefix is null, the default namespace is used.
NamespaceHelper("http://www.w3.org/2000/svg", "svg", "svg"):
<?xml version="1.0"> <svg:svg
xmlns:svg="http://www.w3.org/2000/svg"> </svg:svg>
Parameters: localName - The local name of the document element. Parameters: _namespaceUri - The namespace URI. Parameters: _prefix - The namespace prefix. throws: ParserConfigurationException - if an error occured |
createElement | public Element createElement(String localName)(Code) | |
Creates an element within the namespace of this NamespaceHelper object
with a given local name containing a text node.
createElement("text") : <prefix:text/>.
Parameters: localName - The local name of the element. A new element. |
createElement | public Element createElement(String localName, String text)(Code) | |
Creates an element within the namespace of this NamespaceHelper object
with a given local name containing a text node.
createElement("text", "Hello World!") :
<prefix:text>Hello World!</prefix:text> .
Parameters: localName - The local name of the element. Parameters: text - The text for the text node inside the element. A new element containing a text node. |
getChildren | public Element[] getChildren(Element element)(Code) | | Returns all children of an element in the namespace of this
NamespaceHelper.
Parameters: element - The parent element. the children. |
getChildren | public Element[] getChildren(Element element, String localName)(Code) | | Returns all children of an element with a local name in the namespace of
this NamespaceHelper.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. the children. |
getDocument | public Document getDocument()(Code) | | Returns the document that is used to create elements.
A document object. |
getFirstChild | public Element getFirstChild(Element element, String localName)(Code) | | Returns the first childr of an element with a local name in the namespace
of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. the first child. |
getNamespaceURI | public String getNamespaceURI()(Code) | | Returns the namespace URI of this NamespaceHelper.
The namespace URI. |
getNextSiblings | public Element[] getNextSiblings(Element element, String localName)(Code) | | Returns the next siblings of an element with a local name in the
namespace of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. the next siblings. |
getPrecedingSiblings | public Element[] getPrecedingSiblings(Element element, String localName)(Code) | | Returns the preceding siblings of an element with a local name in the
namespace of this NamespaceHelper or null if none exists.
Parameters: element - The parent element. Parameters: localName - The local name of the children to return. the preceding siblings. |
getPrefix | public String getPrefix()(Code) | | Returns the namespace prefix that is used to create elements.
The namespace prefix. |
getQualifiedName | public static String getQualifiedName(String prefix, String localName)(Code) | | Returns the qualified name for a local name using the prefix of this
NamespaceHelper.
Parameters: prefix - The namespace prefix. Parameters: localName - The local name. The qualified name, i.e. prefix:localName. |
save | public void save(OutputStream stream)(Code) | | Saves the XML.
Parameters: stream - The stream to write to. |
|
|