A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Parse XML with s: inside node???

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    15

    Parse XML with s: inside node???

    Hello,

    My xml data has some s: stuff inside the nodes (see below)

    xmlData = new XML(<myxml><sroduct>
    <s:googleId>10919696106289776705</s:googleId>
    <s:author>
    <s:name>Best Buy</s:name>
    <s:accountId>1311674</s:accountId>
    </s:author>
    </sroduct></myxml>);

    How would one access the nodes enclosed in s: ?

    I know that xmlData.myxml will print out everything inside but how would i get to say googleId?

    I have tried:
    xmlData.myxml.s
    xmlData.myxml.googleId

    But nothing seems to work?

    Please help.

    Thanks.

  2. #2
    Member
    Join Date
    Apr 2010
    Posts
    87
    from senocular.com
    Actionscript Code:
    // XML with xpl namespace
    var xml:XML =
        <xml xmlns:xpl="http://www.example.com/uri/">
            <text>Hello World</text>
            <xpl:text>Hello Namespace</xpl:text>
        </xml>;
       
    // Make a namespace instance based
    // on the xpl namespace's URI
    var xplNs:Namespace = new Namespace("http://www.example.com/uri/");

    // Accessing the text element
    trace(xml.text); // traces "Hello World"

    // Use the name qualifier operator to
    // reference the text tag using the namespace
    // and the element's base name
    trace(xml.xplNs::text); // traces "Hello Namespace"

    for more information about Namespaces refer to this page -> http://www.senocular.com/flash/tutor...ashcs3/?page=4

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

HTML5 Development Center