[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Splitting content from sub-elements
At 2009-06-16 15:30 +0200, Casper Voortman wrote:
I'm having trouble with breaking down a piece of XML into a simpler structure by using xslt 1.0. Sounds to me like you are trying to use pull (xsl:for-each) rather than push (xsl:apply-templates). Any suggestions would be much appreciated. I hope the example below helps. Note that your desired output is the same order as the input, so it is a simple matter of substitution. . . . . . . . . . . . Ken
<xsl:template match="Paragraph"> <para><xsl:apply-templates/></para> </xsl:template> <xsl:template match="FootNote"> <footnote label="{@ID}"><xsl:apply-templates/></footnote> </xsl:template> <xsl:template match="Text[@Cstyle='Cursief']"> <emphasis role="italic"><xsl:apply-templates/></emphasis> </xsl:template> <xsl:template match="Text"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> t:\ftemp>rem Done! -- Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|