SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: XPath

  1. #1
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)

    XPath

    So I have the following XML structure.

    Code:
     <xrs:Package>
        <xrs:Item>
            <xrs:Fields>
                <xrs:CustomFields>
                    <xrs:CustomField name="SPV" value="asdkjadiao"/>
                    <xrs:CustomField name="SPR" value="mooseral"/>
    (With appropriate closing tags)
    I'm supposed to be using an XPath to reach the value of SPV.

    I've got the following:
    /xrs:Item/xrs:Fields/xrs:CustomFields/xrs:CustomField@value[@name="SPV"]

    but it's not finding the value.
    Any ideas where i've gone wrong?

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2005
    Location
    London
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi Starlion,

    try this expression:

    //xrs:Item/xrs:Fields/xrs:CustomFields/xrs:CustomField[@name="SPV"]/@value
    Jurn


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •