|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: inline XML <emphasis>
> I get very close if I add a closing emphasis tag,
> </emphasis>, before my literal element and reopen the
> <emphasis type="default"> after my literal element.
XSLT doesn't deal in tags, in deals in trees and nodes. If you think tags,
you'll never get to grips with the language.
As far as I can see all you're trying to do is to wrap text nodes that
appear as direct children of a para element inside an <emphasis> element wit
the attribute type="default". That's a rule that translates directly into
XSLT:
<xsl:template match="para">
...
<xsl:apply-templates/>
...
</xsl:template>
<xsl:template match="para/text()">
<emphasis type="default">
<xsl:value-of select="."/>
</emphasis>
</xsl:template>
In fact, looking back over the thread, I see you were already given this
solution, so heaven only knows why you are still fighting with the problem.
> Just take the identity transformation and add:
> <xsl:template match="para/text()">
> <emphasis type="default">
> <xsl:value-of select="."/>
> </emphasis>
> </xsl:template>
> This way you select only text-nodes which are children of the
> para element.
>
One other point, IIRC your original justification for doing this was that
you found mixed content distasteful. That's a poor rationale.
Michael Kay
http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






