xsl problem

wxdqz

New Member
Hi
I have the following xsl:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="Children"/>
</xsl:template>

<xsl:template match="Children">
<xsl:apply-templates select="Node"/>
</xsl:template>

<xsl:template match="Node">
<xsl:element name="DIV">
<xsl:attribute name="id"><xsl:value-of select="ID"/></xsl:attribute>
<xsl:attribute name="style">background-color:pink; margin-left:5px;</xsl:attribute>

<xsl:element name="SPAN">
<xsl:attribute name="style">
width:11px;
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>


I tried to make it as simple as possible
For example use the following xml:


<Children>
<Node>
<ID>myID</ID>
</Node>
</Children>


The weird this is the span close tag is after the div close tag, at least for me when i apply the xsl on the xml.

Anyone can explain this to me, maybe solve this?
 
Back
Top