SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use PHP to Create a XML document with sub children

    Basically I am creating a mind mapping tool using Flex. Currently the data is loaded in Flex using an xml document set out like this.
    PHP Code:
    [HIGHLIGHT="XML"]
    <?xml version="1.0"?>
    <mindmap>
    <words>
    <word value="a"></word>
    <word value="b">
    <word value="c"></word>
    <word value="b"></word>
    </word>
    <word value="d"></word>
    <word value="e"></word>
    </word>
    </words>
    </mindmap>
    [/HIGHLIGHT]
    Each sub child represents a branch coming off the mind map node. This all works fine. However I was wondering how I could create appropriate MySQL database and PHP page to create this xml sheet dynamically.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    That XML is invalid. Do you have another sample?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it because of the space in the node title word value. I just had a look at the code with firefox and it came up with a parsing error. But the sheet seems to read fine once through Flex. Is that possible?

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Does the following, valid XML, work?
    Code XML:
    <?xml version="1.0"?>
    <mindmap>
        <words>
            <word value="a" />
            <word value="b" />
            <word value="c" />
            <word value="d" />
            <word value="e" />
            <word value="f" />
        </words>
    </mindmap>
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the PM, maybe this will help.

    http://dev.mysql.com/tech-resources/...ical-data.html
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a million, I will let you know how it goes


Tags for this Thread

Bookmarks

Posting Permissions

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