Dear Don,
That did it!
Mental note: Must follow instructions to the point!
Thanks!
:) Ulf Ullby,
The Royal Library,
Denmark
| "Don Stewart"
<[EMAIL PROTECTED]>
07-07-2005 14:20
|
|
You must use Saxon 8.1.1 not 8.4 is the first point of call.
Don
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 07 July 2005 11:42
To: [email protected]
Subject: Problem with XPath for attribute in XMLBeans 2.0
Hi Everyone!
Happy to upgrade my XMLBeans to v. 2.0, and since I really missed advanced XPath in version 1.03, this is the first thing i look into, but can't figure out how to make it work. With:
...
String myXmlPath = "$this//TextLine";
System.out.println(myAltoDoc.selectPath(myXmlPath)[0].xmlText());
...
I get what I expect (the first "TextLine" in my doc):
<xml-fragment ID="P1_TL00001" HPOS="348" VPOS="417" WIDTH="1250" HEIGHT="86" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/TR/xlink">
<String ID="P1_ST00001" HPOS="348" VPOS="417" WIDTH="630" HEIGHT="78" CONTENT="GEOGRAFISK" WC="4" CC="4444444444"/>
<SP ID="P1_SP00001" HPOS="978" VPOS="495" WIDTH="57"/>
<String ID="P1_ST00002" HPOS="1035" VPOS="417" WIDTH="563" HEIGHT="86" CONTENT="TIDSSKRIFT" WC="2" CC="2222222222"/>
</xml-fragment>
But, if I try to use search for the attribute, like:
...
String myXmlPath = "$this//[EMAIL PROTECTED]";
System.out.println(myAltoDoc.selectPath(myXmlPath)[0].xmlText());
...
I get nothing.... And I know all elements have an ID attribute.
I know that 1.03 had this limitation, but as far as I can see, the 2.0 have full XPath support, or am I mistaken?
I've added Saxon 8.4 (all of it) to my classpath, i tried removing the xmlbean_xpath.jar from classpath, and messed around with the namespaces, but can't seem to get any reaction from my XPath selection.
Hope it's not too obvious what I'm doing wrong?
Best regards,
:) Ulf Ullby,
The Royal Library,
Denmark

