This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re:XSL for element containing mixed content.


Hi, Sandeep,

Following xslt is a workable solution,  hopefully the gurus in the list
could provide you better solution.

Please note I am using msxml 3 by using  < xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
I move the html and body element into the top template instead of in each
template.

Using node select , it can catch the correct element occuring sequence
inside of  each templates.
**  xslt  **
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<html><body>
 <xsl:apply-templates/>
</body></html>
</xsl:template>

<xsl:template match="directory">
 <br/><xsl:apply-templates select="node()"/><br/>


</xsl:template>

<xsl:template match="subdirectory">
<font color="red">
 <br/><xsl:apply-templates select="node()"/><br/>

 </font>
</xsl:template>

<xsl:template match="file">
<font color="blue">
 <br/><xsl:value-of select="."/></font><br/>
</xsl:template>
</xsl:stylesheet>

Hope it can give some help.
Cheers!


Sun-Fu Yang

sfyang@unisvr.net.tw



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]