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@xxxxxxxxxxxxx]
Sent: Friday, November 24, 2006
6:31 AM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: Find object by attribute
value
Hi there,
is there an easy way to find an object by it's attribute value?
DocDocument.Factory.parse...
getDoc().getObj( where "name" == "test1" )
_______________________________________________________________________
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.
|