CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    Question 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

  2. #2
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Question for XPath gurus

    Quote 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

  3. #3
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    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 ???

  4. #4
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    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

  5. #5
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    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.

  6. #6
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Question for XPath gurus

    Quote 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
  •  





Click Here to Expand Forum to Full Width

Featured