org.apache.archiva.xml
Class XMLReader
java.lang.Object
org.apache.archiva.xml.XMLReader
public class XMLReader
- extends Object
XMLReader - a set of common xml utility methods for reading content out of an xml file.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
xmlUrl
private URL xmlUrl
documentType
private String documentType
document
private org.dom4j.Document document
namespaceMap
private Map<String,String> namespaceMap
XMLReader
public XMLReader(String type,
File file)
throws XMLException
- Throws:
XMLException
XMLReader
public XMLReader(String type,
URL url)
throws XMLException
- Throws:
XMLException
init
private void init(String type,
URL url)
throws XMLException
- Throws:
XMLException
getDefaultNamespaceURI
public String getDefaultNamespaceURI()
addNamespaceMapping
public void addNamespaceMapping(String elementName,
String uri)
getElement
public org.dom4j.Element getElement(String xpathExpr)
throws XMLException
- Throws:
XMLException
createXPath
private org.dom4j.XPath createXPath(String xpathExpr)
hasElement
public boolean hasElement(String xpathExpr)
throws XMLException
- Throws:
XMLException
removeNamespaces
public void removeNamespaces()
- Remove namespaces from entire document.
removeNamespaces
public void removeNamespaces(org.dom4j.Element elem)
- Remove namespaces from element recursively.
getElementText
public String getElementText(org.dom4j.Node context,
String xpathExpr)
throws XMLException
- Throws:
XMLException
getElementText
public String getElementText(String xpathExpr)
throws XMLException
- Throws:
XMLException
getElementList
public List<org.dom4j.Element> getElementList(String xpathExpr)
throws XMLException
- Throws:
XMLException
getElementListText
public List<String> getElementListText(String xpathExpr)
throws XMLException
- Throws:
XMLException
Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.