Click to See Complete Forum and Search --> : Question for XPath gurus


Wolvorine
July 21st, 2005, 02:55 AM
How can i extract an attribute which has information like
'%USERPROFILE%\Local Settings\Temp' or
if value inside an attribute like '{C26FF866-8583-42A9-BA2E-5D6F6FC20DF9}'
I wana extract it by simple XML without usig XSL ...
thanks in advance
regards

khp
July 21st, 2005, 09:07 AM
How can i extract an attribute which has information like


Well how do you want to extract it ?
What do you mean Simple XML ? the SimpleXML PHP module ?

In XPath attributes are selected using '@attributename', assuming of course that the attribute belongs to the current context node.

Wolvorine
July 21st, 2005, 10:50 AM
here is the XML file

<registry>
<value name="blahblah" type="REG_SZ" value="%USERPROFILE%\Local Settings\Temp" />
..............
.................
...........other keys

</registry>


Now i need to use XPath query to get this node ..when i perform this below query

//registry/value[@name='TEMP'and @value='%USERPROFILE%\Local Settings\Temp' and @type='REG_EXPAND_SZ']"

it gives me errors and no node it selects.

how can i select this node ???

khp
July 21st, 2005, 05:56 PM
Well the values for @name and @type doesn't match, which would explain why you are not getting any nodes, what error are you getting ?

Wolvorine
July 22nd, 2005, 12:51 AM
:S i didnt showed u my full XML file but i did showed u the row that i WANA extract. Its not the issue of wrong values or typemistake. It was an example row that i wana extract it. error comes only when I use XPATH Query above that i gave in my post.
Thanks in advance

khp
July 22nd, 2005, 04:12 PM
:S i didnt showed u my full XML file but i did showed u the row that i WANA extract. Its not the issue of wrong values or typemistake. It was an example row that i wana extract it. error comes only when I use XPATH Query above that i gave in my post.
Thanks in advance

Sigh, there is no way I can possibly help you when you only give me the slightest bit of information, and then go on to mess up the information that you do give me.

Please post an example that accurately reflect the problem, and once again please tell me what error you are getting.