You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Alistair Young <al...@smo.uhi.ac.uk> on 2006/11/24 15:31:13 UTC
Find object by attribute value
Hi there,
is there an easy way to find an object by it's attribute value?
<doc>
<obj name="test1"></obj>
<obj name="test2"></obj>
</doc>
DocDocument.Factory.parse...
getDoc().getObj( where "name" == "test1" )
thanks,
Alistair
--------------
mov eax,1
mov ebx,0
int 80h
RE: Find object by attribute value
Posted by Jacob Danner <ja...@bea.com>.
I think the easiest thing would be to using xpath.
I learned the basics of it from a zvon tutorial. Try a search for xpath
tutorial.
There is also a sample using xmlbeans
http://xmlbeans.apache.org/samples/XQueryXPath.html
I think your xpath would be something like:
//obj[@name="test1"]
Best of luck.
-Jacobd
________________________________
From: Alistair Young [mailto:alistair@smo.uhi.ac.uk]
Sent: Friday, November 24, 2006 6:31 AM
To: user@xmlbeans.apache.org
Subject: Find object by attribute value
Hi there,
is there an easy way to find an object by it's attribute value?
<doc>
<obj name="test1"></obj>
<obj name="test2"></obj>
</doc>
DocDocument.Factory.parse...
getDoc().getObj( where "name" == "test1" )
thanks,
Alistair
--------------
mov eax,1
mov ebx,0
int 80h
_______________________________________________________________________
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.