You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Cezar Andrei (JIRA)" <xm...@xml.apache.org> on 2009/10/15 23:51:31 UTC
[jira] Assigned: (XMLBEANS-409) XPath on a copy() of an XMLBeans
comp derived class fails
[ https://issues.apache.org/jira/browse/XMLBEANS-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cezar Andrei reassigned XMLBEANS-409:
-------------------------------------
Assignee: Wing Yew Poon
> XPath on a copy() of an XMLBeans comp derived class fails
> ----------------------------------------------------------
>
> Key: XMLBEANS-409
> URL: https://issues.apache.org/jira/browse/XMLBEANS-409
> Project: XMLBeans
> Issue Type: Bug
> Components: Cursor, DOM, XmlObject, XPath
> Affects Versions: Version 2.4
> Environment: Windows XP Professional
> JDK 1.6.0_07
> Saxon 9.0.0.4
> XMLBeans 2.4.0
> Reporter: Bryan Worrell
> Assignee: Wing Yew Poon
>
> I can execute an XPath on an XMLBeans derived class using selectPath(...) and it will behave as expected; returning 0-n results in an XmlObject[] array. However, if I create a copy of the object and execute an XPath on it, every XPath will return a zero-length array.
> The examples behave properly with XMLBeans 2.3.0 with Saxon 8.8. I noticed this issue when I switched to XMLBeans 2.4.0 and Saxon 9.0.0.4. The issue remains if I use XMLBeans 2.4.0 and Saxon 9.1.0.6 (the current release at the time of this posting).
> So, given this example:
> <AppDoc>
> <Applications>
> <ApplicationType>
> <Name>foobar</Name>
> </ApplicationType>
> <Applications>
> </AppDoc>
> /**
> Say we pass in the ApplicationType object with the Name of "foobar"
> **/
> public void confuseTheDeveloper( ApplicationType app ){
> String xPath = "$this/*:Name";
> ApplicationType appCopy = (ApplicationType)app.copy();
> XmlObject[] objs = app.selectPath( xPath );
> XmlObject[] otherObjs = appCopy.selectPath( xPath );
> System.out.prinln( objs.length > 0 ); // prints 'true' ... like it should
> System.out.println( otherObjs.length > 0 ); // prints 'false' ...even though it should print 'true'
> }
> /**
> Another example
> **/
> public void moreConfusion(){
> ApplicationType app = ApplicationType.Factory.newInstance();
> app.setName( "foobar" );
>
> XmlObject[] objs = app.selectPath( "$this/*:Name" );
> System.out.println( objs.length > 0 ); // prints false
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org