← Prev in month
← Prev in thread
xsl processing problem with multiple templates
Hi. I have a bunch of fixn.xml files which contain something like: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="fix.xsl"?> <fix> <number>BED012</number> ... </fix> Apart from being able to display them alone (via the embedded xsl) I'd like to turn them into a list of fixes. It looks like xinclude is what I need for this, but it isn't actually implemented in any standard browser yet. However there's a partial workaround at http://forums.devx.com/showthread.php?t=160331 which I'm trying to get going. But I appear to be able to drive the including *or* the transformation, but not both. Is this just a namespace issue or is there something insurmountable here? My master list of fixes looks like: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="xinclude.xsl"?> <fixlist xmlns:xi="http://www.w3.org/2001/XInclude"> <fix><number>BED000</number></fix> <fix><number>BED111</number></fix> <xi:include href="fix1.xml"/> <xi:include href="fix2.xml"/> </fixlist> and the xinclude.xsl, based off the referenced article: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="f" xmlns:xi="http://www.w3.org/2001/XInclude" exclude-result-prefixes="xi"> <xsl:include href="no-ns-identity.xsl"/> <xsl:template match="xi:include"> <xsl:message>Matched include root</xsl:message> <xsl:apply-templates select="document(@href)"/> </xsl:template> <xsl:template match="fixlist"> <xsl:message>Matched data root</xsl:message> <html> <body> <xsl:for-each select="fix"> <p>Change number: <xsl:value-of select="number"/></p> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> Like this, the fixlist match fires and generates the desired html, but without the includes. Or if I prevent the fixlist from matching then the xi:include match will fire and the correct xml is generated, but (of course) is not transformed into html. I've tried putting the fixlist into a different namespace, but with no difference. Is there anyway of getting them both to work in harmony? ian .. Ian S. Worthington, MBCS. me: http://isw.me.uk/ photos: http://gallery.isw.me.uk/ Free 2GB online backups: https://mozy.com/?code=HJW4C8 (code gets you 256MB extra) Web hosting and support from $2.99/month: www.cirtexhosting.com/affiliates/idevaffiliate.php?id=463 Dulce et decorum est pro patria mori, sed dulcius pro patria vivere, et dulcissimus pro patria biber. Ergo, bibiamo pro salute patriae.
← Prev in month
← Prev in thread