[Home] [By Thread] [By Date] [Recent Entries]
Hi again David,
On 12/23/2010 11:45 AM, Michael Kay wrote: On 23/12/2010 14:37, David Lee wrote:Still thinking how to change Also, I think you should simply consider <xsl:apply-templates select="." mode="handle-text"/> I.e., a dedicated mode that does what you intend to do with the text content. In other words, I think you may have answered your own question. No, it doesn't have the context of any of the text nodes, but of the parent element. But you could have <xsl:template match="*" mode="handle-text">
<xsl:for-each select="text()">
... etc.And yes, if you have only this single template in the mode, you could use a named template instead (or even collapse the call entirely). I admit I'm fumbling in the dark (as are we all) without a fuller description of requirements. But I also suspect that you are close to a solution -- and that the essential problem is to distinguish text-content elements (containing only PCDATA, comments and PIs, where you can do this sort of thing without concern for data integrity) from mixed-content elements (where you can't) ... and again, your schema can help you with that. 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 ======================================================================
|

Cart



