 |
 |
 |
Hi,
I still have the same problem as before (see: Problem with modified "Pretty
XML Tree Viewer"):
Used the tree-view.xsl by Mike J. Brown and Jeni Tennison for my output.
I stripped down the tree-view.xsl to a minimum.
My problem:
I get this as an output:
root
|
|___Tabelle DB
|
|___Tabelle Nina
| |
| |___Tabelle Servus
| | |
| | |___Tabelle Chip
| |
| |___Tabelle Hallo
| | |
| | |___Tabelle Warum
| | | |
| | | |___Tabelle Serve
| | |
| | |___Tabelle PC
|
|___Tabelle Peddaaa
| |
| |___Tabelle Horst
| | |
| | |___Tabelle like
But I want this for my output (without the unessessary "|"'s):
root
|
|___Tabelle DB
|
|___Tabelle Nina
| |
| |___Tabelle Servus
| | |
| | |___Tabelle Chip
| |
| |___Tabelle Hallo
| |
| |___Tabelle Warum
| | |
| | |___Tabelle Serve
| |
| |___Tabelle PC
|
|___Tabelle Peddaaa
|
|___Tabelle Horst
|
|___Tabelle like
My stripped down tree-view.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="no"/>
<xsl:template match="/">
<html>
<head>
<title>tree-view by Mike J. Brown and Jeni Tennison</title>
</head>
<body>
<h3>Can't find the solution for my problem</h3>
<xsl:apply-templates select="." mode="render"/>
</body>
</html>
</xsl:template>
<xsl:template match="/" mode="render">
root
<br/>
<xsl:apply-templates mode="render"/>
</xsl:template>
<xsl:template match="*" mode="render">
<xsl:call-template name="ascii-art-hierarchy"/>
<br/>
<xsl:call-template
name="ascii-art-hierarchy"/>___Tabelle <xsl:value-of
select="local-name()"/>
<br/>
<xsl:apply-templates mode="render"/>
</xsl:template>
<xsl:template name="ascii-art-hierarchy">
<xsl:for-each select="ancestor::*">
<xsl:choose>
<xsl:when
test="following-sibling::node()">  |   </xsl:when>
<xsl:otherwise>      </xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:choose>
<xsl:when test="parent::node() and
../child::node()">  |</xsl:when>
<xsl:otherwise>   </xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
tree-view.xml
<?xml version="1.0" encoding="utf-8"?>
<DB>
<Nina>
<Servus>
<Chip/>
</Servus>
<Hallo>
<Warum>
<Serve/>
</Warum>
<PC/>
</Hallo>
</Nina>
<Peddaaa>
<Horst>
<Like/>
</Horst>
</Peddaaa>
</DB>
Tried a lot with XPath logic, but I couldn' solve the problem myself.
Anyone got an idea?
Thanks
Jonny
_________________________________________________________________
MSN Messenger - sehen, welche Freunde online sind!
http://www.msn.de/messenger Jetzt kostenlos downloaden und mitmachen!
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |