[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: removing nesting in data structure
Ok, Ive found a problem already... for some reason it applies subpara3 twice. Why is this? When I use Xselerator's debugger I can see that when Im matching say subpara1 the line <apply-templates select="subpara1|subpara2|subpara3"/> matches both subpara2 and subpara3 - which is correct as it is creating a union of the matches. What select should I use instead? Will I need to split up the template? cheers andrew =====xml===== <?xml version="1.0"?> <root> <para0> <para>para 0</para> <subpara1> <para>subpara 1</para> <subpara2> <para>subpara 2</para> <subpara3> <para>subpara 3</para> </subpara3> </subpara2> </subpara1> </para0> </root> ====xslt====== <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="1.0"> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="para0|subpara1|subpara2|subpara3"> <xsl:copy> <xsl:apply-templates select="*[not(subpara1)][not(subpara2)][not(subpara3)]"/> </xsl:copy> <xsl:apply-templates select="subpara1|subpara2|subpara3"/> </xsl:template> </xsl:stylesheet> --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|