Hi,
I am using XMLBeans 2.4.0 with Saxon 8 for this example: I am having a problem
when it comes to doing a selectPath(...) on a copy() of an object and can't
figure out why this is happening. ApplicationType is an XMLBeans scomp derived
class. The ApplicationType object being passed in has a Name child element.
<ApplicationType id="1">
<Name>foobar</Name>
<!-- More Elements -->
</ApplicationType>
public void confuseDeveloper ( ApplicationType app ) {
String xPath = "$this/*:Name";
XmlObject[] xmlobjs = app.selectPath( xPath );
System.out.println( xmlobjs.length > 0 ); // prints "true" like it should
ApplicationType tmpApp = (ApplicationType)app.copy(); // make a deep copy
xmlobjs = tmpApp.selectPath( xPath );
System.out.println( xmlobjs.length > 0 ); // prints "false" ...this is wrong
logger.debug( tmpApp.getName() ); // prints out "foobar"
}
I have tried different ways of making a copy of the ApplicationType object but
always have the same results... Any ideas as to why the second xPath is
failing?
Thanks,
Bryan Worrell
__
Bryan Worrell
The MITRE Corporation
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]