Results 1 to 5 of 5
  1. #1
    basfot is offline Member
    Join Date
    Feb 2012
    Posts
    16
    Rep Power
    0

    Default How to dynamic read XML

    I have this XML:

    XML Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <root>
      <file change="2010" name="Main" type="folder">
        <file change="Januar" name="Thomas" type="folder">
            <file change="10" name="Dan" type="file"/>
            <file change="20" name="Thomas" type="file"/>   
        </file>
        <file change="Februar" name="Thomas" type="folder">
             <file change="11" name="Jaro" type="file"/>
             <file change="29" name="Thomas" type="folder">
               <file change="29.1" name="Thomas" type="file"/>
               <file change="29.2" name="Thomas" type="file"/>
             </file>
         </file>
      </file>
    </root>
    And I need on the output this:

    2010-Main-Folder
    --------
    Januar
    -file: 10,Dan,file
    -file: 20,Thomas,file
    Februar
    -file: 11,Dan,file
    -file: 29,Thomas,folder
    --file: 29.1,Thomas,file
    --file: 29.2,Thomas,file

    Can we help me? And count of child in parent can be always different. E.g.
    -file
    --file
    ---file
    ----file ...

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default Re: How to dynamic read XML

    Did you try anything on that? This is a forum, not a place to get done your homework done. Show your effort first of all here.

  3. #3
    basfot is offline Member
    Join Date
    Feb 2012
    Posts
    16
    Rep Power
    0

    Default Re: How to dynamic read XML

    Yes, I tried it, but i didn't want here post 10 bad examples.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: How to dynamic read XML

    Quote Originally Posted by basfot View Post
    Yes, I tried it, but i didn't want here post 10 bad examples.
    How about showing us your *best* bad example and also any error messages that you're getting or describing any misbehaviors.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default Re: How to dynamic read XML

    Quote Originally Posted by basfot View Post
    Yes, I tried it, but i didn't want here post 10 bad examples.
    Without knowing that what you have done how can we comment on it. To do the same thing there are thousands of ways and we don't know your approach. So as Fubarable says post the most bad example you have work around and we can comment on it. Don't forget to post error messages if you have any.

Similar Threads

  1. Replies: 0
    Last Post: 11-15-2011, 10:13 PM
  2. Dynamic Casting
    By Thorton in forum Advanced Java
    Replies: 30
    Last Post: 01-12-2010, 10:01 PM
  3. Dynamic GUI
    By ike2u in forum New To Java
    Replies: 4
    Last Post: 08-08-2009, 03:50 AM
  4. Replies: 5
    Last Post: 10-17-2008, 03:13 PM
  5. Help for dynamic classes
    By Bender in forum Advanced Java
    Replies: 1
    Last Post: 12-19-2007, 09:46 PM

Posting Permissions

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