www.webdeveloper.com
Results 1 to 3 of 3

Thread: anything 2 and over and it's dead

  1. #1
    Join Date
    Feb 2009
    Posts
    25

    Question anything 2 and over and it's dead

    Hey

    I got some XML i need to convert. i'm trying to make a web-based mail system using xml and php.

    the raw xml: http://71.193.112.221:8888/tools/tes...92.168.1.1.xml

    and my xsl file: http://71.193.112.221:8888/tools/tes...mail/maily.xsl

    these work great.

    that is... if my xml file looks like this:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="../maily.xsl"?>
    <amail>
    <from>Ben</from>
    <subject>Welcome to Simple Mail!</subject>
    <message>This is the most simple mail system ever. It uses PHP, and xml. Hope you like it!</message>
    </amail>
    as you see, each message is rapped up in the <amail> tag. if there's more, eg
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="../maily.xsl"?>
    <amail>
    <from>Ben</from>
    <subject>Welcome to Simple Mail!</subject>
    <message>This is the most simple mail system ever. It uses PHP, and xml. Hope you like it!</message>
    </amail>
    <amail>
    <from>Ben</from>
    <subject>What's up?</subject>
    <message>Hey there! Whats up?</message>
    </amail>
    <amail>
    <from>Ben</from>
    <subject>Oh good!</subject>
    <message>Oh good! That's good to hear.</message>
    </amail>
    , then it messes up and my result is a blank page. here's a messed up xml file because there's over 2 messages.

    http://71.193.112.221:8888/tools/tes...data/error.xml

    This error occurs when there's 2 or over AMAIL tags.

    Does anybody have a solotion?

    Thanks in advance, Ben.

  2. #2
    Join Date
    Mar 2009
    Posts
    96
    You would need to wrap the amail elements in one all-encompassing (read "godlike") element, such as amail-list:
    Code:
    <amail-list>
      <amail>
        <from>Ben</from>
        <subject>Welcome to Simple Mail!</subject>
        <message>This is the most simple mail system ever. It uses PHP, and xml. Hope you like it!</message>
      </amail>
      <amail>
        <from>Ben</from>
        <subject>What's up?</subject>
        <message>Hey there! Whats up?</message>
      </amail>
      <amail>
        <from>Ben</from>
        <subject>Oh good!</subject>
        <message>Oh good! That's good to hear.</message>
      </amail>
    </amail-list>
    I hope this helps! ^_^

  3. #3
    Join Date
    Feb 2009
    Posts
    25
    awesome!!!! thanks! i got it working now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles