You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Baker, Jon" <ba...@mitre.org> on 2006/07/03 18:44:02 UTC

XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working?

I just upgraded to XmlBeans 2.2.0 from XmlBeans 2.1.0. My code that
used the XmlObject.selectPath(String path) method no longer works. Is
there an additional step I need to take to use selectPath in XmeBeans
2.2.0 with saxonb8.6.1?

In the past I have simply built a jar of XmlBeans classes for our
schema using the scomp utility and then included this in my projects. 

Our schema is quite large so I have not attached it. I will gladly do
so if you are interested.


here is the bit of code that is causing the trouble:
-------------begin code--------------------
String xpath = "./*[@id=\'" + id + "\']";
XmlObject[] objs =
doc.getOvalDefinitions().getDefinitions().selectPath(xpath);

-------------end code--------------------

Here is error I get:
 

java.lang.RuntimeException: net.sf.saxon.trans.DynamicError: The
context item for axis step descendant::element() is undefined
at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPat
h.java:102)

at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPath
.java:108)

at
org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next(
Path.java:496)

at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)

at
org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920)

at
org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:912
)

at
org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:2652
)

at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.
java:433)

at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.
java:415)

at
org.mitre.oval.xmlapi.DefinitionApi.updateXml(DefinitionApi.java:565)


Thanks for any help,

Jon

============================================
Jon Baker
INFOSEC Eng/Scientist, Sr.
The MITRE Corporation
bakerj@mitre.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working?

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
The documentation lags behind. I'll make sure it gets fixed.

Radu 

-----Original Message-----
From: Baker, Jon [mailto:bakerj@mitre.org] 
Sent: Monday, July 03, 2006 5:40 PM
To: user@xmlbeans.apache.org
Subject: RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer
working?

Wing Yew,

Thanks for our help. Adding the saxon8-dom.jar to my classpath fixed it.
Is this documented somewhere? Or is the documentation just a bit behind
version 2.2.0 of XmlBeans?

Thanks,

Jon

============================================
Jon Baker
INFOSEC Eng/Scientist, Sr.
The MITRE Corporation
bakerj@mitre.org


>-----Original Message-----
>From: Wing Yew Poon [mailto:wpoon@bea.com]
>Sent: Monday, July 03, 2006 8:15 PM
>To: user@xmlbeans.apache.org
>Subject: RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer 
>working?
>
>Jon,
>since you were using xmlbeans 2.1 before, presumably you have xbean.jar

>and jsr173_1.0_api.jar in your classpath, together with xbean_xpath.jar

>and saxon8.jar; now you need saxon8-dom.jar as well.
>If you have all the jars in your classpath and are experiencing your 
>problem, then I don't know what else to tell you.
>It may be a problem with saxon rather than xmlbeans, but I know rather 
>little about xpath and saxon and I can't say.
>- Wing Yew
>
>-----Original Message-----
>From: Baker, Jon [mailto:bakerj@mitre.org]
>Sent: Monday, July 03, 2006 9:44 AM
>To: user@xmlbeans.apache.org
>Subject: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer 
>working?
>
>I just upgraded to XmlBeans 2.2.0 from XmlBeans 2.1.0. My code that 
>used the XmlObject.selectPath(String path) method no longer works. Is 
>there an additional step I need to take to use selectPath in XmeBeans 
>2.2.0 with saxonb8.6.1?
>
>In the past I have simply built a jar of XmlBeans classes for our 
>schema using the scomp utility and then included this in my projects.
>
>Our schema is quite large so I have not attached it. I will gladly do 
>so if you are interested.
>
>
>here is the bit of code that is causing the trouble:
>-------------begin code-------------------- String xpath = "./*[@id=\'"

>+ id + "\']"; XmlObject[] objs = 
>doc.getOvalDefinitions().getDefinitions().selectPath(xpath);
>
>-------------end code--------------------
>
>Here is error I get:
>
>
>java.lang.RuntimeException: net.sf.saxon.trans.DynamicError: The 
>context item for axis step descendant::element() is undefined at 
>org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPa
t
>h.java:102)
>
>at
>org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPat
h
>.java:108)
>
>at
>org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next
(
>Path.java:496)
>
>at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)
>
>at
>org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920
)
>
>at
>org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:91
2
>)
>
>at
>org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:265
2
>)
>
>at
>org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase
.
>java:433)
>
>at
>org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase
.
>java:415)
>
>at
>org.mitre.oval.xmlapi.DefinitionApi.updateXml(DefinitionApi.java:565)
>
>
>Thanks for any help,
>
>Jon
>
>============================================
>Jon Baker
>INFOSEC Eng/Scientist, Sr.
>The MITRE Corporation
>bakerj@mitre.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>______________________________________________________________________
_
>Notice:  This email message, together with any attachments, may
contain
>information  of  BEA Systems,  Inc.,  its subsidiaries  and
affiliated
>entities,  that may be confidential,  proprietary,  copyrighted
and/or
>legally privileged, and is intended solely for the use of the
individual
>or entity named in this message. If you are not the intended
recipient,
>and have received this message in error, please immediately return
this
>by email and then delete it.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working?

Posted by "Baker, Jon" <ba...@mitre.org>.
Wing Yew,

Thanks for our help. Adding the saxon8-dom.jar to my classpath fixed
it. Is this documented somewhere? Or is the documentation just a bit
behind version 2.2.0 of XmlBeans?

Thanks,

Jon

============================================
Jon Baker
INFOSEC Eng/Scientist, Sr.
The MITRE Corporation
bakerj@mitre.org


>-----Original Message-----
>From: Wing Yew Poon [mailto:wpoon@bea.com]
>Sent: Monday, July 03, 2006 8:15 PM
>To: user@xmlbeans.apache.org
>Subject: RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer
>working?
>
>Jon,
>since you were using xmlbeans 2.1 before, presumably you have
>xbean.jar and jsr173_1.0_api.jar in your classpath, together with
>xbean_xpath.jar and saxon8.jar; now you need saxon8-dom.jar as well.
>If you have all the jars in your classpath and are experiencing
>your problem, then I don't know what else to tell you.
>It may be a problem with saxon rather than xmlbeans, but I know
>rather little about xpath and saxon and I can't say.
>- Wing Yew
>
>-----Original Message-----
>From: Baker, Jon [mailto:bakerj@mitre.org]
>Sent: Monday, July 03, 2006 9:44 AM
>To: user@xmlbeans.apache.org
>Subject: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer
>working?
>
>I just upgraded to XmlBeans 2.2.0 from XmlBeans 2.1.0. My code that
>used the XmlObject.selectPath(String path) method no longer works. Is
>there an additional step I need to take to use selectPath in XmeBeans
>2.2.0 with saxonb8.6.1?
>
>In the past I have simply built a jar of XmlBeans classes for our
>schema using the scomp utility and then included this in my projects.
>
>Our schema is quite large so I have not attached it. I will gladly do
>so if you are interested.
>
>
>here is the bit of code that is causing the trouble:
>-------------begin code--------------------
>String xpath = "./*[@id=\'" + id + "\']";
>XmlObject[] objs =
>doc.getOvalDefinitions().getDefinitions().selectPath(xpath);
>
>-------------end code--------------------
>
>Here is error I get:
>
>
>java.lang.RuntimeException: net.sf.saxon.trans.DynamicError: The
>context item for axis step descendant::element() is undefined
>at
>org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPa
t
>h.java:102)
>
>at
>org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPat
h
>.java:108)
>
>at
>org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next
(
>Path.java:496)
>
>at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)
>
>at
>org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920
)
>
>at
>org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:91
2
>)
>
>at
>org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:265
2
>)
>
>at
>org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase
.
>java:433)
>
>at
>org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase
.
>java:415)
>
>at
>org.mitre.oval.xmlapi.DefinitionApi.updateXml(DefinitionApi.java:565)
>
>
>Thanks for any help,
>
>Jon
>
>============================================
>Jon Baker
>INFOSEC Eng/Scientist, Sr.
>The MITRE Corporation
>bakerj@mitre.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>______________________________________________________________________
_
>Notice:  This email message, together with any attachments, may
contain
>information  of  BEA Systems,  Inc.,  its subsidiaries  and
affiliated
>entities,  that may be confidential,  proprietary,  copyrighted
and/or
>legally privileged, and is intended solely for the use of the
individual
>or entity named in this message. If you are not the intended
recipient,
>and have received this message in error, please immediately return
this
>by email and then delete it.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working?

Posted by Wing Yew Poon <wp...@bea.com>.
Jon,
since you were using xmlbeans 2.1 before, presumably you have
xbean.jar and jsr173_1.0_api.jar in your classpath, together with
xbean_xpath.jar and saxon8.jar; now you need saxon8-dom.jar as well.
If you have all the jars in your classpath and are experiencing 
your problem, then I don't know what else to tell you.
It may be a problem with saxon rather than xmlbeans, but I know
rather little about xpath and saxon and I can't say.
- Wing Yew 

-----Original Message-----
From: Baker, Jon [mailto:bakerj@mitre.org] 
Sent: Monday, July 03, 2006 9:44 AM
To: user@xmlbeans.apache.org
Subject: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer
working?

I just upgraded to XmlBeans 2.2.0 from XmlBeans 2.1.0. My code that
used the XmlObject.selectPath(String path) method no longer works. Is
there an additional step I need to take to use selectPath in XmeBeans
2.2.0 with saxonb8.6.1?

In the past I have simply built a jar of XmlBeans classes for our
schema using the scomp utility and then included this in my projects. 

Our schema is quite large so I have not attached it. I will gladly do
so if you are interested.


here is the bit of code that is causing the trouble:
-------------begin code--------------------
String xpath = "./*[@id=\'" + id + "\']";
XmlObject[] objs =
doc.getOvalDefinitions().getDefinitions().selectPath(xpath);

-------------end code--------------------

Here is error I get:
 

java.lang.RuntimeException: net.sf.saxon.trans.DynamicError: The
context item for axis step descendant::element() is undefined
at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPat
h.java:102)

at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPath
.java:108)

at
org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next(
Path.java:496)

at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)

at
org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920)

at
org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:912
)

at
org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:2652
)

at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.
java:433)

at
org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.
java:415)

at
org.mitre.oval.xmlapi.DefinitionApi.updateXml(DefinitionApi.java:565)


Thanks for any help,

Jon

============================================
Jon Baker
INFOSEC Eng/Scientist, Sr.
The MITRE Corporation
bakerj@mitre.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org