[thelist] Xsl for each problems

MarsHall evolt at MARSorange.com
Wed Nov 20 20:37:01 CST 2002


On Wednesday, Nov 20, 2002, at 17:18 US/Central, fstorr wrote:
> I tried both this and Mars' idea but neither worked...  Any more help
> would be greatly appreciated.

I had to replace the namespace declaration, like Howard did, in order
to run the transform on both Sablotron and libXSLT. I didn't mention it
b/c you said you had to use the old MSXML engine. So, I don't know how
effective my suggestions will be, as I use XSLT 1.0 compliant engines ;)

Have you ever successfully run a transform with that namespace? The
XPath I supplied works, so perhaps you should tinker with the structure
of the whole transform.

IMHO, I wouldn't use an <xsl:for-each /> to build that unordered
list... it's forcing the XSLT to be procedural (not it's strong point).

The transform might work better (and you will gain a better
understanding of how XSLT works) if instead of the for-each, you use an
apply-stylesheets call (in a special mode):
	<xsl:apply-stylesheets select="//title" mode="buildUL" />

And have your list item template be defined as:
	<xsl:stylesheet match="title" mode="buildUL">
		<li><xsl:value-of /></li>
	</xsl:stylesheet>

Good luck!
Mars :)




More information about the thelist mailing list