Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to create a simple tree

Reply
Thread Tools

How to create a simple tree

 
 
jma
Guest
Posts: n/a
 
      09-09-2008
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-09-2008
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/m...html#d7506e200


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Jürgen Kahrs
Guest
Posts: n/a
 
      09-09-2008
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/...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.
 
Reply With Quote
 
Jürgen Kahrs
Guest
Posts: n/a
 
      09-09-2008
Jürgen Kahrs wrote:

> I hope this is what you need.


Oh sorry, I overlooked that you want the data
transformed the other way round, you _dont_ want
the tags, but you want the textual data. Then,
things are much simpler:

http://home.vrweb.de/~juergen.kahrs/...character-sets

@load xml
XMLCHARDATA { printf $0 }
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Create XML tree from another partial tree Peter Reimer XML 4 04-12-2010 10:06 PM
B+ Tree versus Ternary Search Tree Ramkumar Menon Java 2 08-16-2005 08:13 PM
B tree, B+ tree and B* tree Stub C Programming 3 11-12-2003 01:51 PM
Spanning Tree And Per Vlan Spanning Tree Amy L. Cisco 0 07-24-2003 10:01 PM



Advertisments