|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object yarfraw.utils.XMLUtils
public class XMLUtils
Method Summary | |
---|---|
static String |
emptyIfNull(String str)
Return empty string if input is null. |
static String |
getAttributeValue(Node element,
QName name)
Get the attribute value of the attribute that matches the specified QName . |
static String |
getAttributeValue(Node element,
String attributeLocalName)
Get the attribute value of the attribute that matches the specified localName. |
static String |
getAttributeValue(Node element,
String attributeLocalName,
String namespaceUri)
Get the attribute value of the attribute that matches the specified localName and NamespaceUri |
static Node |
getChildrenNodeByName(Node parent,
String localName)
Get a single Children node of the input parent using a localName |
static List<Node> |
getChildrenNodesByName(Node parent,
String localName)
Get a list of Children nodes of the input parent using a localName |
static Element |
getElementByLocalName(List<Element> elements,
String localName)
Search through the input element list and return the FIRST element that matches the localName. |
static Element |
getElementByNS(List<Element> elements,
String namespaceURI,
String localName)
Search through the input element list and return the first element that matches both input the namespaceURI and the localName. |
static QName |
getQName(Node n)
Construct a QName object using a node's localName and NamespaceUri |
static Document |
parseXml(InputSource source,
boolean validating,
boolean ignoringComments)
Parses xml to a Document object. |
static Document |
parseXml(InputStream stream,
boolean validating,
boolean ignoringComments)
Parses an xml stream to a Document object. |
static Document |
parseXml(String xml,
boolean validating,
boolean ignoringComments)
Parses an xml string to a Document object. |
static boolean |
same(QName qn1,
QName qn2)
|
static String |
transformWithXsl(String xslt,
String xml)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Document parseXml(String xml, boolean validating, boolean ignoringComments) throws SAXException, IOException, ParserConfigurationException
xml
- - xml to be parsedvalidating
- - see DocumentBuilderFactory
ignoringComments
- - see DocumentBuilderFactory
SAXException
IOException
ParserConfigurationException
public static Document parseXml(InputStream stream, boolean validating, boolean ignoringComments) throws SAXException, IOException, ParserConfigurationException
stream
- - xml to be parsedvalidating
- - see DocumentBuilderFactory
ignoringComments
- - see DocumentBuilderFactory
SAXException
IOException
ParserConfigurationException
public static Document parseXml(InputSource source, boolean validating, boolean ignoringComments) throws SAXException, IOException, ParserConfigurationException
source
- - xml source to be parsedvalidating
- - see DocumentBuilderFactory
ignoringComments
- - see DocumentBuilderFactory
SAXException
IOException
ParserConfigurationException
public static Element getElementByNS(List<Element> elements, String namespaceURI, String localName)
namespaceURI
- - namespaceURI of the element to be search forlocalName
- - localName of the element
public static Element getElementByLocalName(List<Element> elements, String localName)
localName
- - localName of the element
public static boolean same(QName qn1, QName qn2)
public static String emptyIfNull(String str)
str
-
public static String getAttributeValue(Node element, QName name)
QName
.
element
- - the element to be searched on.name
- -
public static String getAttributeValue(Node element, String attributeLocalName)
element
- - the element to be searched on.name
- -
public static String getAttributeValue(Node element, String attributeLocalName, String namespaceUri)
element
- - the element to be searched on.name
- -
public static QName getQName(Node n)
QName
object using a node's localName and NamespaceUri
n
- - a DOM node
QName
object that has input localName as it's localName and
input NamespaceUri as its NamespaceUri.public static List<Node> getChildrenNodesByName(Node parent, String localName)
parent
- - the parent nodelocalName
- - local name of the children to be searched for
public static Node getChildrenNodeByName(Node parent, String localName)
parent
- - the parent nodelocalName
- - local name of the children to be searched for
public static String transformWithXsl(String xslt, String xml) throws YarfrawException
YarfrawException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |