[Home] [By Thread] [By Date] [Recent Entries]
Per your request -- sorry, but this is pretty long ... Any help is appreciated ... here again is the issue ... ** I am parsing some xml to output as a tree. The transform works, but I'm also seeing the xml data in the result. Example follows: ** <?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"/> <xsl:template match="/">
<html>
<head>
<LINK REL="stylesheet" type="text/css" href="css/tree.css"/>
<SCRIPT LANGUAGE="Javascript" SRC="tree.js"></SCRIPT>
<SCRIPT LANGUAGE="Javascript" SRC="../common/css.js"></SCRIPT>
</head>
<body>
<table>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template><xsl:template match="//contents">
<!-- THIS IS THE ENTITY ROW THAT WILL BE OPENED -->
<tr>
<td>
<xsl:attribute name="id">level<xsl:value-of
select="parent::entity/attribute::id"/></xsl:attribute>
<xsl:choose>
<xsl:when test="parent::entity[1]/@parent = '/'">
<xsl:attribute name="STYLE">display:block;
padding-left: 7px; font-family: Verdana; font-size: 11px; color:
black;</xsl:attribute>
</xsl:when>
<xsl:when test="parent::entity[1]/@parent = '/e0'">
<xsl:attribute name="STYLE">display:none;
padding-left: 12px; font-family: Verdana; font-size: 11px; font-color:
red;</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="STYLE">display:block;
padding-left: 7px; font-family: Verdana; font-size: 11px; color:
black;</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<table>
<xsl:for-each select="child::entity">
<xsl:call-template name="tree">
</xsl:call-template>
<xsl:apply-templates/>
</xsl:for-each>
</table>
</td>
</tr>
<!-- </xsl:for-each> -->
</xsl:template>
</xsl:template> </xsl:stylesheet> ************************** XML <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="newtree.xsl"?> <tree> <entity id="e0" parent="/"> <description>Archives</description> <descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
<entity id="e00" parent="/e0">
<description>Entire Murray Holdings</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick>displayCustomer(12346)</onClick>
<contents>
<entity id="e000" parent="/e00">
<description>American Democracy</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e001" parent="/e00">
<description>Female Leadership</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e002" parent="/e00">
<description>Labor Relations</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
</contents>
</entity>
<entity id="e01" parent="/e0">
<description>ICPSR</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick>displayCustomer(12345)</onClick>
<contents>
<entity id="e010" parent="/e01">
<description>Census Enumerations</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e011" parent="/e01">
<description>Community and Urban Studies</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e012" parent="/e01">
<description>Conflict, Aggression, Violence,
Wars</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
</contents>
</entity>
<entity id="e02" parent="/e0">
<description>Roper</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick>displayCustomer(12347)</onClick>
<contents>
<entity id="e020" parent="/e02">
<description>Elections</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
<contents>
<entity id="e0201" parent="/e020">
<description>CNN Poll</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e0202" parent="/e020">
<description>ABC News Poll</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e0203" parent="/e020">
<description>Another Folder</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
<contents>
<entity id="e02030" parent="/e020">
<description>ABC News Poll</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<onClick></onClick>
</entity>
</contents>
</entity>
</contents>
</entity>
</contents>
</entity>
<entity id="e03" parent="/e0">
<description>Census</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick>displayCustomer(12348)</onClick>
<contents>
<entity id="e030" parent="/e03">
<description>2000</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e031" parent="/e03">
<description>1990</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e032" parent="/e03">
<description>1980</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
<entity id="e033" parent="/e03">
<description>1970</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<onClick></onClick>
</entity>
</contents>
</entity>
<entity id="e04" parent="/e0">
<description>ODUM</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
<entity id="e040" parent="/e04">
<description>Public Opinion</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e041" parent="/e04">
<description>NC Vital Statistics</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e042" parent="/e04">
<description>Social Psych Data</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/paper.gif</image>
<imageOpen>images/paper.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e043" parent="/e04">
<description>Public Opinion</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e044" parent="/e04">
<description>NC Vital Statistics</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e045" parent="/e04">
<description>Social Psych Data</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
<entity id="e046" parent="/e04">
<description>Test Group 1</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
</contents>
</entity>
<entity id="e047" parent="/e04">
<description>Test Group 2</description><descriptionuri>http://192.168.40.129/VDC/prototypes/collections/index.html</
descriptionuri>
<oncontextmenu></oncontextmenu>
<image>images/nodeclosed.gif</image>
<imageOpen>images/nodeopen.gif</imageOpen>
<contents>
</contents>
</entity>
</contents>
</entity>
</contents>
</entity>
</contents>
</entity>
</tree>
***********************Quoting Jagdishwar B <jagdishwar.beemanati@xxxxxxxxx>: Hi,
|

Cart



