Represents a class that has attributes.
Represent a class that allows any type of objects, not just String.
Represents an item might have children.
Represents an item (a.k.a., node) of a iDOM tree.
Represents a class that supports namespace.
Represents an object that is mainly for storing "text".
The iDOM attribute.
The binary item.
The iDOM CDATA.
The iDOM Comment.
The iDOM DocType.
Represents Document which is also W3C/DOM's document, i.e., org.w3c.dom.Document.
The iDOM element.
The iDOM entity reference.
Represents the namespace.
The iDOM processing instruction.
The iDOM Text.
The verifier to verify W3C/DOM related constraints.
Denotes an operation is not supported.
The iDOM representation of XML DOM tree.
It is Potix's DOM representation for XML. The concept is similar to JDOM -- using Java collections and concrete classes. However, we do have many enhancements (many of them are the reasons we don't extend JDOM, but writing a new one).
Although iDOM supports W3C/DOM, W3C/DOM's API is generated deprecated unless using them with third part utilities, like Xalan's XPath. The reason is that W3C/DOM API is another complete set of API that is easily confusing with iDOM API. The iDOM API is designed to avoid making any connection between their names. However, some cases are hardly avoided. For example, org.w3c.dom.Element.getAttribute returns an empty string if the attribute not found, while Element.getAttributeValue returns null if the attribute not found.
import org.zkoss.idom.input.SAXBuilder; import org.zkoss.idom.Document; SAXBuilder builder = new SAXBuilder(true, false, true); Document doc = builder.build("file.xml");
Advantages: simple. Caller needs no anything about a SAX parser.
SAXParserFactory factory = SAXParserFactory.newInstance();
...//configure factory as you want
SAXParser parser = factory.newSAXParser();
SAXBuilder builder = new SAXBuilder(parser);
Document doc = builder.build("file.xml");
Advantages: a SAX parser could be used in different palces.
for (Iterator it = document.getElements("product").iterator();
String name = ((Element)it.next()).getElementValue("name", true);
The getElements and getElement methods of Group are powerful to drill down a iDOM tree sequentially.
To select beyond sequence searching (and regular expression), org.zkoss.xml.XPath could be used.
Returns the text content.
The same as getText, except Element whose getValue returns always null.
|September 27, 2001||Tom M. Yeh||Project created. The original plan is to be an extension of JDOM.|
|October 4, 2001||Tom M. Yeh||Alpha 1 as an extenstion of JDOM. Tested with JDOM beta 7.|
|October 22-26, 2001||Tom M. Yeh||Alpha 1 of the rewritten version. On October 21, decide to rewrite to be independent of JDOM.|
|November 3-4, 2001||Tom M. Yeh||Alpha 2.
|January 7-8, 2002||Tom M. Yeh||Alpha 3.
Copyright © 2005-2022 Potix Corporation. All Rights Reserved.