[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: testing for position of an element and displaying
> Please tell me how this can be resolved. > So it is really not going in order in the style sheet, > and repeats the <a> content two ties 0once before the > <r1> and once aftr <r1>. It only repeats if you apply templates twice. If you don't do that it will only be processed once. Did you try any of the code posted earlier? clearly not on your sample input <a><para>Some other test</a></para> ^^^^^^^^^^ which isn't well formed. one last try... <r1> <a><para>Some test</para></a> <a><para>Some other test</para></a> <text><para>This is level1</para></text> <!--I can have any element here text, table --> <a><para>Some test 3</para></a> </r1> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="fo"> <xsl:template match="r1"> <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="a"> <fo:block><xsl:apply-templates/></fo:block> </xsl:template> <xsl:template match="table"> whatever you need for tables </xsl:template> <xsl:template match="r1/text[1]" priority="2"> <fo:block>1: <xsl:apply-templates/></fo:block> </xsl:template> </xsl:stylesheet> $ saxon m.xml m.xsl <?xml version="1.0" encoding="utf-8"?><fo:block xmlns:fo="fo"> <fo:block>Some test</fo:block> <fo:block>Some other test</fo:block> <fo:block>1: This is level1</fo:block> <fo:block>Some test 3</fo:block> </fo:block> which appears to be the result you wanted, although it's hard to be sure given your expected output had no markup. David
|
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
|