Subject: RE: [xsl] Result tree fragment to string? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 27 Aug 2008 14:06:16 -0400 |
The above doesn't handle namespaces, processing-instructions, comments, or mixed content, but it could be hacked to do so. Is there a reason why this approach would not work in XSL 1.0 to satisfy his needs?
Yes, the reason is that you can't do the apply-templates on the result tree fragment, you would first need to convert it to a node-set with an extension function.
<xsl:template match="paragraph" mode="HTMLwrite"> <!-- write an HTML-ish 'p' --> <xsl:text><p></xsl:text> <xsl:apply-templates mode="HTMLwrite"/> </xsl:text></p></xsl:text> </xsl:template>
<xsl:template match="paragraph" mode="HTMLwrite"> <xsl:call-template name="HTMLtag"/> <xsl:with-param name="tag" select="'p'"> <xsl:with-param name="attributes"> <xsl:apply-templates select="." mode="HTMLattributes"/> </xsl:with-param> </xsl:call-template> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Result tree fragment to s, Michael Kay | Thread | Re: [xsl] Result tree fragment to s, David Carlisle |
RE: [xsl] Result tree fragment to s, Houghton,Andrew | Date | RE: [xsl] Result tree fragment to s, Wendell Piez |
Month |