xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgagnon <Joseph.Gag...@ll.mit.edu>
Subject Difficulties with using XPath to find an element
Date Thu, 08 May 2014 19:46:35 GMT
I am programmatically generating an XML object hierarchy and then using what
I produced as a template for other work.  I make a copy of the template
structure (using XmlObject.copy() at the root node) and then attempt to
locate a specific node within the structure so that I can then edit the
structure (change element content, or add/remove elements).  I'm having a
problem getting the search to work.  I'm pretty sure I have all the
necessary jar files in the build path (probably more than I need).

When I inspect the XML of the object tree, it appears to have set the
default namespace (i.e. the root node contains: "xmlns:www.xyz.org" - no
prefix).  The elements are rendered with no namespace prefix as well.

When I was doing some earlier experimenting, I was parsing an existing XML
file and in this case, there was a namespace prefix in use, and I was able
to successfully "locate" elements.  Now I cannot, and I don't know why. 
Should I "turn on" a namespace prefix?  Is there some special XmlOption that
I should set?  Any ideas?



--
View this message in context: http://xmlbeans.996285.n3.nabble.com/Difficulties-with-using-XPath-to-find-an-element-tp7505.html
Sent from the XMLBeans User mailing list archive at Nabble.com.

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


Mime
View raw message