Class XMLUtils
java.lang.Object
es.uji.crypto.xades.jxades.util.XMLUtils
Common XML Tasks
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementcreateLastPathComponent(Document doc, String[] path) Creates (only if necessary) and returns the element which is at the end of the specified path.static StringgetAttributeByName(Node node, String name) Get the attribute with given name's valuestatic ElementgetChildElementByChain(Element element, String[] chain, boolean create) Returns the element which is at the end of the specified chain... static ElementgetChildElementByTagName(Element parent, String tagName) Returns the child element with the specified tagName for the specified parent elementstatic ElementgetChildElementByTagNameNS(Element parent, String tagName, String nsName) getChildElementsByTagName(Element parent, String tagName) getChildElementsByTagNameNS(Element parent, String tagName, String nsName) private static NodegetChildNodeByType(Element element, short nodeType) static CDATASectiongetElementCDataNode(Element element) Returns element's CDATA Nodestatic StringGets CDATA value of an elementstatic TextgetElementTextNode(Element element) Returns element's TEXT Nodestatic StringgetElementTextValueDeprecated(Element parentNode) Get the data of the element , no matter whether it is TXT ot CDATAstatic voidprintChildElements(Element parent, PrintStream out, boolean deep, String prefix) Used for debugingstatic voidsetElementCDataValue(Element e, String data) Sets element CDATA datastatic voidsetElementTextValue(Element e, String data) Sets element TEXT datastatic voidstatic voidwriteXML(OutputStream outStream, Node node) static voidwriteXML(OutputStream outStream, Node node, boolean indent) static voidstatic voidWrites the specified document to the given file.
-
Field Details
-
charset
-
-
Constructor Details
-
XMLUtils
public XMLUtils()
-
-
Method Details
-
getAttributeByName
-
getElementTextValueDeprecated
-
setElementTextValue
-
setElementCDataValue
-
getElementCDataValue
-
getElementCDataNode
Returns element's CDATA Node- Parameters:
element- the element which CDATA node is returned- Returns:
- CDATA node
-
getElementTextNode
-
getChildNodeByType
-
writeXML
- Throws:
FileNotFoundException
-
writeXML
-
writeXML
-
writeXML
-
writeXML
-
getChildElementByChain
-
createLastPathComponent
Creates (only if necessary) and returns the element which is at the end of the specified path.- Parameters:
doc- the target document where the specified path should be createdpath- a dot separated string indicating the path to be created- Returns:
- the component at the end of the newly created path.
-
getChildElementByTagNameNS
-
getChildElementByTagName
-
getChildElementsByTagNameNS
-
getChildElementsByTagName
-
printChildElements
Used for debuging- Parameters:
parent- Elementout- PrintStreamdeep- booleanprefix- String
-