Generating tree-structure with xsl
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Mon Oct 17, 2005 11:10 am
Generating tree-structure with xsl
Hello experts,
I want to diplay the same tree-structure with XSL as it is in my XML file.
The structure is as follows:
<?xml version="1.0" encoding="iso-8859-1"?>
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
</CONTACT>
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
</CONTACT>
</CONTACT>
How can i get a useful XSL -File with <xsl:for-each select="CONTACT"> or such a thing.
I've already tried to use a recursive Procedure, but the problem is, that all the XML-Nodes have the same name ("CONTACT").
Can somebody help me?
Thanks
Cordoba
I want to diplay the same tree-structure with XSL as it is in my XML file.
The structure is as follows:
<?xml version="1.0" encoding="iso-8859-1"?>
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
</CONTACT>
<CONTACT>
<CONTACTDATE>...</CONTACTDATE>
<CONTACTTIME>...</CONTACTTIME>
.
.
</CONTACT>
</CONTACT>
How can i get a useful XSL -File with <xsl:for-each select="CONTACT"> or such a thing.
I've already tried to use a recursive Procedure, but the problem is, that all the XML-Nodes have the same name ("CONTACT").
Can somebody help me?
Thanks
Cordoba
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Cordoba,
You can start from the following copy template. It matches any node and then copies it and all its content to the output.
Best Regards,
George
You can start from the following copy template. It matches any node and then copies it and all its content to the output.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service