[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Problems with mixed content and inline elements when transforming XHTML into another XML format


Subject: RE: [xsl] Problems with mixed content and inline elements when transforming XHTML into another XML format
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 27 Feb 2006 09:39:47 -0000

> Sorry to keep asking about this problem but I am still having issues.
> The change you mention below does remove the error but now it never
> hits the block of code to wrap the elements in the textnode. It is
> simply outputting the input verbatim. 

I'm afraid that when I reply to a question, I supply snippets of code that
address the issue you're having, but don't attempt to supply a complete
working solution: I leave that to you. Usually I reckon that this forces
people to understand the solution rather than just transcribing it, which
means they will learn more and have less need to return for further help...

Looking at your code, you're inside a template with match="/", so
select="node()" is only going to select the outermost element, and grouping
a single element is not very useful. You need to put this code in the
template rule for the element that contains the nodes to be grouped. You may
also need to apply it at more than one level, in which case the xsl:copy-of
should be replaced by an xsl:apply-templates.

Michael Kay
http://www.saxonica.com/


Current Thread