xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Jan <janreimone AT gmail.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Empty query result
- Date: Sat, 08 Aug 2009 12:10:07 +0200
I do my first steps with XOM today. I want to do a query (XPath) on a
document which is always an XML schema file. I invoke the query in the
following way:
Document doc = builder.build(new File(fileString));
Element schema = doc.getRootElement();
XPathContext xpathContext = XPathContext.makeNamespaceContext(schema);
queryResult = doc.query(query, xpathContext);
The first query was the following:
//complexType[@name="Address"]
I expected a result containing a node which has the attribute "name" set
to "Address" on all layers. But the result was empty.
The second query was a little bit simplier:
/schema
I thought Ok...think big, start little. So why don't get the root
element. But the result was empty :(
My third query was:
/*
So finally the general query for the root element brought success. The
result was the "schema" node of XML schema files.
But why are the result of the other queries empty? Is it possible to
search in the mailing list archive? I can imagine that this question
wasn't posted the first time.
greetz
Jan
-
[XOM-interest] Empty query result,
Jan, 08/08/2009
-
Re: [XOM-interest] Empty query result,
Michael Kay, 08/08/2009
-
Re: [XOM-interest] Empty query result,
Jan, 08/08/2009
- Re: [XOM-interest] Empty query result, Michael Kay, 08/08/2009
- Re: [XOM-interest] Empty query result, Jan, 08/08/2009
-
Re: [XOM-interest] Empty query result,
Jan, 08/08/2009
-
Re: [XOM-interest] Empty query result,
Michael Kay, 08/08/2009
Archive powered by MHonArc 2.6.24.