org.mmbase.util
Class XMLBasicReader
java.lang.Object
|
+--org.mmbase.util.XMLBasicReader
- Direct Known Subclasses:
- MagicXMLReader, XMLApplicationReader, XMLBuilderReader, XMLDatabaseReader, XMLMMLanguageReader, XMLModuleReader, XMLScreenWriter
- public class XMLBasicReader
- extends java.lang.Object
XMLBasicReader has two goals.
-
It provides a way for parsing XML
-
It provides a way for searching in this XML, without the need for an XPath implementation, and without the hassle of org.w3c.dom alone.
It uses dots to lay a path in the XML (XPath uses slashes).
- Version:
- $Id: XMLBasicReader.java,v 1.26.2.3 2003/04/11 10:16:53 pierre Exp $
- Author:
- Case Roule, Rico Jansen, Pierre van Rooden, Michiel Meeuwissen
|
Field Summary |
protected org.w3c.dom.Document |
document
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
document
protected org.w3c.dom.Document document
XMLBasicReader
public XMLBasicReader(java.lang.String path)
XMLBasicReader
public XMLBasicReader(org.xml.sax.InputSource source,
java.lang.Class resolveBase)
XMLBasicReader
public XMLBasicReader(java.lang.String path,
java.lang.Class resolveBase)
XMLBasicReader
public XMLBasicReader(org.xml.sax.InputSource source)
XMLBasicReader
public XMLBasicReader(java.lang.String path,
boolean validating)
XMLBasicReader
public XMLBasicReader(org.xml.sax.InputSource source,
boolean validating)
XMLBasicReader
public XMLBasicReader(org.xml.sax.InputSource source,
boolean validating,
java.lang.Class resolveBase)
reinitLogger
public static void reinitLogger()
- This class is used by init of logging system.
After configuration of logging, logging must be reinitialized.
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validating)
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validating,
org.xml.sax.ErrorHandler handler)
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validating,
org.xml.sax.EntityResolver resolver)
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validating,
org.xml.sax.ErrorHandler handler,
org.xml.sax.EntityResolver resolver)
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
getDocumentBuilder
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(java.lang.Class refer)
getElementByPath
public org.w3c.dom.Element getElementByPath(java.lang.String path)
- Parameters:
path - Dot-separated list of tags describing path from root element to requested element.
NB the path starts with the name of the root element.- Returns:
- Leaf element of the path
getElementByPath
public org.w3c.dom.Element getElementByPath(org.w3c.dom.Element e,
java.lang.String path)
- Parameters:
e - Element from which the "relative" path is starting.
NB the path starts with the name of the root element.path - Dot-separated list of tags describing path from root element to requested element- Returns:
- Leaf element of the path
getElementValue
public java.lang.String getElementValue(java.lang.String path)
- Parameters:
path - Path to the element- Returns:
- Text value of element
getElementValue
public java.lang.String getElementValue(org.w3c.dom.Element e)
- Parameters:
e - Element- Returns:
- Text value of element
getElementName
public java.lang.String getElementName(org.w3c.dom.Element e)
- Parameters:
e - Element- Returns:
- Tag name of the element
getElementAttributeValue
public java.lang.String getElementAttributeValue(java.lang.String path,
java.lang.String attr)
- Parameters:
path - Path to the elementattr - Attribute name- Returns:
- Value of attribute
getElementAttributeValue
public java.lang.String getElementAttributeValue(org.w3c.dom.Element e,
java.lang.String attr)
- Parameters:
e - Elementattr - Attribute name- Returns:
- Value of attribute
getChildElements
public java.util.Enumeration getChildElements(java.lang.String path)
- Parameters:
path - Path to the element- Returns:
- Enumeration of child elements
getChildElements
public java.util.Enumeration getChildElements(org.w3c.dom.Element e)
- Parameters:
e - Element- Returns:
- Enumeration of child elements
getChildElements
public java.util.Enumeration getChildElements(java.lang.String path,
java.lang.String tag)
- Parameters:
path - Path to the elementtag - tag to match ("*" means all tags")- Returns:
- Enumeration of child elements with the given tag
getChildElements
public java.util.Enumeration getChildElements(org.w3c.dom.Element e,
java.lang.String tag)
- Parameters:
e - Elementtag - tag to match ("*" means all tags")- Returns:
- Enumeration of child elements with the given tag
getFileName
public java.lang.String getFileName()
MMBase build 1.6.5.20030923