Embedded XML data islands -- and referencing specific fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jonnie79
    New Member
    • Dec 2008
    • 1

    Embedded XML data islands -- and referencing specific fields

    OK, so my XML data looks like this:
    [code=xml]
    <xml id = "internalXMLDat a">

    <Contacts>
    <Contact>
    <Name>Jonnie Graham</Name>
    <Phone type="home">(09 ) 3888 466</Phone>
    <Phone type ="mobile"/>
    <Phone type ="work"/>
    <email>jonnie@p oomail.com</email>
    <email>jonnie@s hitmail.com</email>
    </Contact>

    <Contact>
    <Name>Andre Sapeas</Name>
    <Phone type="home"/>
    <Phone type="mobile">( 123) 456 3757</Phone>
    <Phone type="work"/>
    <email>info@som edomain.co.nz</email>
    <email>andre_sa peas@somedomain .com</email>
    </Contact>
    <Contacts>

    </xml>
    [/code]
    ...see how there is more than 1 "type" of phone number, and more than 1 possible email address?

    to reference, say the Name, we would write: <span datafld="Name"> , but how would we reference each "type" of phone number (or in other words how woud one reference each specifically/uniquely attributed phone number?), -for example??

    Thanks heaps!
    Last edited by Frinavale; Dec 9 '08, 03:59 PM. Reason: added code tags
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if you want all users to use your functionality go for JavaScript/DOM (DOM gives you the ultimate access to the document tree you need for this). see Using XML Data Islands in Mozilla (more on Google)

    regards

    PS: this is the first time I heard of this

    Comment

    Working...