473,396 Members | 1,724 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,396 software developers and data experts.

How to print a whole XML-tree with XSLT?

Hi there!
I'm a newbie in XSLT, so maybe this problem is easy to solve, but I
just don't get it and hours of searching for an answer didn't help me
either.

Is there any possibility to print a whole XML-tree, including all
(child)elements and attributes, from a XML to a (X)HTML-file using
xsl(t)?

I got a dynamic XML like this:

-- xml --

<configSet>
<xmlSet id="0">
<!-- Dynamic content -->
</xmlSet>

<xmlSet id="1">
<!-- Dynamic content -->
</xmlSet>

<xmlSet id="2">
<!-- Dynamic content -->
</xmlSet>
</configSet>

-- end of xml --
The xmlSet-Elements can contain various elements, which names and
attributes I don't know (since they're created dynamically). I even
don't know how deep they're nested.

What I'd like to get is a HTML like this:

-- html --

<html>
<body>
<h1>Content of id 0</h1>

<!-- The whole content of the xmlSet-element with the id "0" including
all children and their attributes go here -->

<h1>Content of id 1</h1>

<!-- The whole content of the xmlSet-element with the id "1" including
all children and their attributes go here -->

....

</body>
</html>

-- end of html --
Can you guys help me? Thanks in advance!

Oct 3 '05 #1
3 1758


me***********@googlemail.com wrote:

Is there any possibility to print a whole XML-tree, including all
(child)elements and attributes, from a XML to a (X)HTML-file using
xsl(t)?


Programmatically you can certainly copy any stuff from the input XML to
the XSLT output (e.g. with <xsl:copy-of select="xmlSet" />) but I don't
see what sense it would make to have the XML elements then in a HTML
document. What should the browser do with XML in a HTML document when it
renders the HTML? It will parse the whole document with its HTML tag
soup parser and treat that XML as unknown HTML stuff and render any text
nodes probably. Is that what you want?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 3 '05 #2
Thanks a lot for your answer! Now i know where my problem is. What i
didn't regard is the fact that the browser won't show me the elements
he doesn't know, since they're not text for them.
In fact, what i want is an output like this:

--- browser output --

Content of id 1:

<xmlSet id="1">

<!-- Dynamic content starts here -->

<otherNode>
<andAnotherOne />
</otherNode>

<!-- Dynamic content starts here -->

</xmlSet>

....

-- end of browser output --

So my elements have to be transformed into text. Do you see any
possibility there?

Oct 3 '05 #3
Thanks a lot for your answer! Now i know where my problem is. What i
didn't regard is the fact that the browser won't show me the elements
he doesn't know, since they're not text for them.
In fact, what i want is an output like this:

--- browser output --

Content of id 1:

<xmlSet id="1">

<!-- Dynamic content starts here -->

<otherNode>
<andAnotherOne />
</otherNode>

<!-- Dynamic content starts here -->

</xmlSet>

....

-- end of browser output --

So my elements have to be transformed into text. Do you see any
possibility there?
---
EDIT:

I finally found a solution: I just surrounded the output of the
xmlSet-Elements by "textarea"-tags!

Thanks again, Martin!

Oct 3 '05 #4

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

Similar topics

5
by: MouseHart | last post by:
I've written a simple program in VB 6.0 to list all my MP3 files. To show them on the screen I used an MSFlexGrid named TextGrid (which is not associated with any table or text file) in the...
16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
2
by: jimmyfishbean | last post by:
Hi, I am using VB6, SAX (implementing IVBSAXContentHandler). I need to extract binary encoded data (images) from large XML files and decode this data and generate the appropriate images onto...
0
by: Siv | last post by:
Hi, I am working on a VB.NET application that uses the Print Preview. When I call up the print preview and print from my laser printer the whole page comes out no problem. When I do the same...
0
by: karinya_89 | last post by:
I want to print more than one XML file at a time i.e. the user click OK in ShowPrintDialog() only once and all the XML files in a folder are printed out. Now i can print only one XML file at a...
7
by: anatoli.barski | last post by:
I currently use xml.dom.minidom and ext to create a dom-tree which I would write to an xml-file. My intention is to create something like this: <Robot> <!-- armar3 --> <Joint> </Joint> ...
0
by: Marv | last post by:
Is it possible to print the path of all leaf nodes of an XML using XML::Simple This is the kind of output text that i'm trying to print (not the leaf node values but the path to reach them) c:\>...
1
by: mahfuza via DotNetMonster.com | last post by:
Hi I have an Xml file.I Load it in a Datagrid, My Xml file has child tables, and I want to print this, so I want to see its print preview, but when I want to do it, only it is shown the root table...
1
by: Andrus | last post by:
How to remove whole Xmlnode so that outer tags are also removed ? To reproduce, run the code. Observed result: <Query> <DataSourceName>DS1</DataSourceName> <QueryParameters>...
7
by: raghudr | last post by:
<?xml version="1.0" standalone="yes" ?> - <AddressSpace xsi:noNamespaceSchemaLocation="prince.xsd" Name="U2" ConfigMax="1" xmlns:xsi="http://www.rag.org/2001/XMLSchema-instance"> <Item Name="raj"...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.