public class XmlHelper extends Object
| Constructor and Description |
|---|
XmlHelper() |
| Modifier and Type | Method and Description |
|---|---|
XmlObject |
addAsFirstChild(XmlObject target,
XmlObject child)
Adds child as the first child element of target.
|
XmlObject |
addAsLastChild(XmlObject target,
XmlObject child)
Adds child as the last child element of target.
|
XmlObject |
addToSaml2Extensions(XmlObject targetDocument,
String xml)
Adds the given xml to the Extensions element (creating the Extensions, if needed) of the SAML 2.0 protocol XML document.
|
List<XmlObject> |
getChildren(XmlObject xmlObject)
Returns all the child elements of the given xml.
|
XmlObject |
getFirstChild(XmlObject xmlObject)
Returns the first child element of the given xml.
|
XmlObject |
parse(String xml)
Parses the xml string into an XmlObject.
|
void |
setAttribute(XmlObject target,
String attributeName,
String attributeValue)
Sets an attribute on the given xml element
|
void |
setAttribute(XmlObject target,
String attributeNamespace,
String attributeName,
String attributeValue)
Sets an attribute on the given xml element
|
public XmlObject addToSaml2Extensions(XmlObject targetDocument, String xml)
targetDocument - a SAML 2.0 protocol XML document (i.e. ResponseDocument or AuthnRequestDocument)xml - the XML to add to the Extensionspublic void setAttribute(XmlObject target, String attributeName, String attributeValue)
target - the xml element on which to set the attributeattributeName - name of the attributeattributeValue - value of the attributepublic void setAttribute(XmlObject target, String attributeNamespace, String attributeName, String attributeValue)
target - the xml element on which to set the attributeattributeNamespace - namespace of the attributeattributeName - name of the attributeattributeValue - value of the attributepublic XmlObject parse(String xml)
xml - the xml stringIllegalArgumentException - if any problems are encountered parsing the stringpublic XmlObject addAsLastChild(XmlObject target, XmlObject child)
target - the xml element to which the child will be addedchild - the xml element that will be addedpublic XmlObject addAsFirstChild(XmlObject target, XmlObject child)
target - the xml element to which the child will be addedchild - the xml element that will be addedpublic XmlObject getFirstChild(XmlObject xmlObject)
xmlObject - the parent xml elementCopyright 2019 Ping Identity Corp. All rights reserved.