If you are referring to the Name as a childnode of item, then that is the
easiest way to do it. I assume that the second @id mentioned, refers to the
actual name of the ChildNode.

Roopesh !!

-----Original Message-----
From: Paul J. Caritj [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 12, 2002 3:28 PM
To: [email protected]
Subject: RE: Retrieving Attribute Values


Makes sense. Thanks.

Now, moving on, does that fact bear upon the functioning of XUpdate?

Continuing our example, lets say that I want to change the name of the
item with @id=1 to "Cinder Block," I would think the following would do
the job (through Xindice's java API):

<xupdate:update select="/itemgroup/[EMAIL PROTECTED]"1\"]/@id">
        Cinder Block
</xupdate:update>

Any problem here, or is there a better way to update attribute values?

-Paul

On Wed, 2002-12-11 at 19:20, Lixin Meng wrote:
> See attached reply from Matthew.
> 
> -----Original Message-----
> From: Matthew Van Horn [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 05, 2002 7:00 PM
> To: [email protected]
> Subject: Re: XPath problem
> ...
> 
> 1. Xindice will NOT return attributes, only elements.
> xindice xpath_query -c /db/testing -q /data/test2/@forTest2 **will not 
> work
> 
> -----Original Message-----
> From: Paul J. Caritj [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 11, 2002 10:37 AM
> To: [email protected]
> Subject: Retrieving Attribute Values
> 
> 
> Greetings,
> I have what I hope is a rather simple question, but I have been unable
> to find specific examples of how to do this in the documentation
> (perhaps it should be added).
> 
> How does one select the value of an attribute node?
> 
> What would probably be the most helpful, would be if someone could look
> at the following example and tell me where I have strayed:
> 
> given the document:
> 
> <itemgroup>
>         <item id="1" name="brick">
>                 .....
>         <item id="2" name="cat">
>                 ....
> </itemgroup>
> 
> in collection: /db/testing
> 
> how would I select the ID of a "brick" ?
> 
> My inclination would be the following (from the command line):
> xindice xpath -c /db/testing -q /itemgroup/[EMAIL PROTECTED]"brick"]/@id
> 
> but this doesn't work (or, at least not on my otherwise functional
> instance of xindice; it works fine if I stick to elements
> in this query)
> 
> How should this be revised?
> 
> Many thanks,
> Paul Caritj
> 
> 

Reply via email to