How to create a simple tree

J

jma

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
 
M

Martin Honnen

jma said:
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
 
J

Jürgen Kahrs

jma said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top