473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to create a simple tree

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
Sep 9 '08 #1
3 1661
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/
Sep 9 '08 #2
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.
Sep 9 '08 #3
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 }
Sep 9 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rolf Kemper | last post by:
Dear All, somehow I remember that such or similar question was discussed already somewhere. But I can't find it anymore. I have a template calling itself. As long it goes deeper into the...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
7
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
2
by: Mriganka | last post by:
I want to create a hierarchical tree from the array of strings obtained by extracting a jar file.I want to do this using Javascript. For ex, I am having the entries in the array as...
6
by: Sebastian | last post by:
Do you have a simple example for creating a simple hello world compiler in c# or vb.net? thanks Sebastian
1
by: hn.ft.pris | last post by:
I have the following code: Tree.h defines a simple binary search tree node structure ########## FILE Tree.h ################ #ifndef TREE_H #define TREE_H //using namespace std; template...
5
gekko3558
by: gekko3558 | last post by:
I am writing a simple binary search tree (nodes are int nodes) with a BSTNode class and a BST class. I have followed the instructions from my C++ book, and now I am trying to get a remove method...
4
by: Travis | last post by:
I'm creating a real simple tree. No sorting and every node can have infinite children. // TreeNode.h #ifndef TREENODE_H #define TREENODE_H #include <iostream> #include <iomanip>
1
by: HighBuddha | last post by:
Hello, i have a question about game trees. I've been given an assignment in class (highschool) and the assignment is to write a program the simulates The Game Of Eight. The game runs like this: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.