Get all attributes that match a given name - InfoPath Dev
in

InfoPath Dev

Get all attributes that match a given name

Last post 04-24-2006 12:34 AM by AndersR. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-23-2006 07:54 PM

    • hollis
    • Not Ranked
    • Joined on 01-29-2006
    • Australia
    • Posts 10

    Get all attributes that match a given name

    Is there is a way to get all attributes for a given name in an XML document?

    i.e.

    <details isExpanded='false'>
    <name isExpanded='false'>
    <firstname>
    <lastname>
    </name>
    <phonenos isExpanded='false'>
    <home>
    <work>
    <fax>
    <mob>
    </phonenos>
    </details>
    <stuff isExpanded='false'>
    …
    …
    …
    </stuff>

    I want to get all 'isExpanded' attributes so I can change their values.

    There is a method to get all elements: getElementsByTag("details") would return the details node… surely theres one for all attributes???

    The only other way i see is to iterate through all elements and see if they have that attribute, then modify it. Don't particularly want to go down this path as i MANY elements in the form.
  • 04-24-2006 12:34 AM In reply to

    Re: Get all attributes that match a given name

    the XPath expression "//@isExpanded" should return a NodeList with the attribute values.

    hth
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.