Results 1 to 3 of 3

Thread: Calling all XML gurus ....

  1. #1
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Calling all XML gurus ....

    Hi all,

    I have a feeling this is going to be a long shot but hopefully there are some XML gurus who could help me out with something ....

    I want to have an page in IE that has two "divs" areas on it.

    In the left hand one I want an "explorer" tree built from an XML document.

    The XML document will look like
    Code:
    <GROUP>
      <ID = "1">
      <SKILL>
        <ID = "1">
      </SKILL>
    </GROUP>
    <GROUP>
      <ID = "2">
      <SKILL>
        <ID = "2">
      </SKILL>
      <SKILL>
        <ID = "3">
      </SKILL>
    </GROUP>
    ie a number of GROUPS each of which contain any number of SKILLS.

    The "div" block on the right is initially empty. On clicking on a branch/node in the left hand tree, I want that node/branch added to to the 'tree' on the right. If a branch's node doesn't exist in the right hand tree when a branch is clicked then the branch will need to be added as well.

    Clicking on a branch/node in the right hand tree simply removes it from the tree.

    Finally, at any time I need to be able to get a list of the (group id, skill id) currently in the right hand tree.

    As I say ... I know it's a long shot but does anyone know if the above is possible ?? Or better still got any pointers as to where to start/sample code/working examples ??

    TIA for any help.

    Regards,

    Adam Brunt

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    there should be an error in the xml. you had a tag name with NO END TAG! plus the attribute was assigned to the tag itself!!!

    -magicyte

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    A number of errors in the mentioned XML. Please find the mentioned issues below:

    1. XML version and encoding declaration is missing.

    2. In the mentioned XML data there is no root element and without a root element XML is not valid.

    3.
    Code:
    <ID = "1">
    The above code is incorrect you can't assign a value without an attribute. This can be changed to something like the follow:
    Code:
    <ID value="1">
    4.
    Code:
    <ID = "1">
    The above tag must close. The XML tag rules are very strict when you compare XML with HTML. I mean the nesting of tag elements must be correct and each tag should be closed properly.
    Code:
    <ID value="1"/>
    An example code is below. I've done this with your XML;
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GROUPS> <!-- Root node begins -->
        <GROUP>
            <ID value="1"/>
            <SKILL>
                <ID value="1"/>
            </SKILL>
        </GROUP>
        
        <GROUP>
            <ID value="2"/>
            <SKILL>
                <ID value="2"/>
            </SKILL>
            <SKILL>
                <ID value="3"/>
            </SKILL>
        </GROUP>
    </GROUPS> <!-- Root node ends -->
    Hope this helps. If you need any more assistance post more details with complete XML

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
  •