How to create a simple tree

Discussion in 'XML' started by jma, Sep 9, 2008.

  1. jma

    jma Guest

    Hi all,

    I have very little to do with XSLT... so I need some help here. The
    thing is I produce a log file in XML and want to present it in a tree
    structure. When I open it, I see the tree structure in my browser
    since no XSLT is defined. Now, what I want, is exactly the same thing
    without the XML tags. Googlig on the subject this seems to be really
    complicated?!? Any help highly appreciated.

    BR

    -- dimitris
    jma, Sep 9, 2008
    #1
    1. Advertising

  2. jma wrote:

    > I have very little to do with XSLT... so I need some help here. The
    > thing is I produce a log file in XML and want to present it in a tree
    > structure. When I open it, I see the tree structure in my browser
    > since no XSLT is defined. Now, what I want, is exactly the same thing
    > without the XML tags. Googlig on the subject this seems to be really
    > complicated?!? Any help highly appreciated.


    See 7./8. in http://www.dpawson.co.uk/xsl/sect2/microsoft.html#d7506e200


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Sep 9, 2008
    #2
    1. Advertising

  3. jma schrieb:

    > I have very little to do with XSLT... so I need some help here. The
    > thing is I produce a log file in XML and want to present it in a tree
    > structure. When I open it, I see the tree structure in my browser
    > since no XSLT is defined. Now, what I want, is exactly the same thing
    > without the XML tags. Googlig on the subject this seems to be really
    > complicated?!? Any help highly appreciated.


    Have a look at this:

    http://home.vrweb.de/~juergen.kahrs/gawk/XML/xmlgawk.html#Printing-an-outline-of-an-XML-file

    The idea of the script is to turn an XML file into
    indented ASCII output like this:

    book lang='en' id='hello-world'
    bookinfo
    title
    chapter id='introduction'
    title
    para
    sect1 id='about-this-book'
    title
    para
    sect1 id='work-in-progress'
    title
    para

    All that is needed is this script:

    @load xml
    XMLSTARTELEM {
    printf("%*s%s", 2*XMLDEPTH-2, "", XMLSTARTELEM)
    for (i=1; i<=NF; i++)
    printf(" %s='%s'", $i, XMLATTR[$i])
    print ""
    }

    I hope this is what you need.
    Jürgen Kahrs, Sep 9, 2008
    #3
  4. Jürgen Kahrs, Sep 9, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    2
    Views:
    1,582
    Roedy Green
    Aug 16, 2005
  2. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    0
    Views:
    419
    Ramkumar Menon
    Aug 16, 2005
  3. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    1
    Views:
    436
    Andrew Thompson
    Aug 16, 2005
  4. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,087
  5. Peter Reimer
    Replies:
    4
    Views:
    1,100
    Peter Flynn
    Apr 12, 2010
Loading...

Share This Page