Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.1: XPath

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: Elliotte Harold <elharo AT metalab.unc.edu>, xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Thu, 6 Jan 2005 16:48:43 -0800

Forgot to mention that if the query is "text {.}" the result sequence contains a single coalesced text node with a value of "helloworldnux".

Wolfgang.

On Jan 6, 2005, at 4:36 PM, Wolfgang Hoschek wrote:

Quoting the saxon documentation

http://www.saxonica.com/documentation/documentation.html
then click on Standards Conformance/Conformance with other specifications:

When a DOM, JDOM, or XOM tree is supplied as the transformation input, Saxon does not combine adjacent text nodes into a single node. Adjacent text nodes can occur as the result of user modifications to the tree, or as a result of the presence of CDATA sections or entity references, depending on the options in force when the tree was constructed.

When a DOM, JDOM, or XOM tree is supplied as the transformation input, Saxon does not take the xml:space attribute into consideration when deciding whether or not to strip whitespace text nodes.

Hence, the following Nux example:

Element elem = new Element("elem");
elem.appendChild("hello");
elem.appendChild("world");
elem.appendChild("nux");

Nodes results = new XQuery(".", null).execute(elem).toNodes();
for (int i=0; i < results.size(); i++) {
System.out.println("i="+i+":" + results.get(i).toXML());
}

returns:

i=0:<elem>helloworldnux</elem>

with the returned element having 3 Text nodes.

Wolfgang.

On Jan 6, 2005, at 3:27 PM, Elliotte Harold wrote:

I forgot the nastiest problem:

How do I handle non-coalesced, adjacent text nodes? XPath doesn't allow them and XOM does. This could royally muck up predicates based on position. And what if someone selects one. What do I return? How do NUX and Saxon and Jaxen handle this?

-- Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ ref=nosim
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest

_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest





Archive powered by MHonArc 2.6.24.

Top of Page