A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: xml error

  1. #1

    xml error

    when i view this xml file in mozilla, it spits out an error. why is it doing this?

    PHP Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <general ver="8" reload="2" updated="2005-07-07 02:52:50" atis_min="20" numClients="323" />
    <servers>
      <object>
        <ident>ASIA-S</ident>
        <hostname>152.104.96.225</hostname>
        <location>Hong Kong</location>
        <name>South Asian Server - Provided by VATROC</name>
        <allow_connections>1</allow_connections>
      </object>
    </servers>
    here's the error:

    PHP Code:
    XML Parsing Errorjunk after document element
    Location
    www.domain.com
    Line Number 3
    Column 1:
    <
    servers>

    Dan Schultz
    Intrigue Media
    www.intriguemedia.net

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Need to have a single encompassing node.
    Added the 'main' tags - but you can call it anything you want.
    PHP Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <main>
    <general ver="8" reload="2" updated="2005-07-07 02:52:50" atis_min="20" numClients="323" /> 
    <servers> 
      <object> 
        <ident>ASIA-S</ident> 
        <hostname>152.104.96.225</hostname> 
        <location>Hong Kong</location> 
        <name>South Asian Server - Provided by VATROC</name> 
        <allow_connections>1</allow_connections> 
      </object> 
    </servers>
    </main>

  3. #3
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    This is correct an XML document should only have 1 root node, but flash will allow you to have multiple, but you should make compliant XML, as someone or something might also want to use your XML down the track.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

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