|
-
July 21st, 2005, 02:55 AM
#1
Question for XPath gurus
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
-
July 21st, 2005, 09:07 AM
#2
Re: Question for XPath gurus
 Originally Posted by Wolvorine
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.
Last edited by khp; July 21st, 2005 at 09:39 AM.
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
-
July 21st, 2005, 10:50 AM
#3
Re: Question for XPath gurus
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 ???
-
July 21st, 2005, 05:56 PM
#4
Re: Question for XPath gurus
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 ?
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
-
July 22nd, 2005, 12:51 AM
#5
Re: Question for XPath gurus
: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
Last edited by Wolvorine; July 22nd, 2005 at 12:53 AM.
-
July 22nd, 2005, 04:12 PM
#6
Re: Question for XPath gurus
 Originally Posted by Wolvorine
: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.
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|