[Home] [By Thread] [By Date] [Recent Entries]
At 2006-03-24 13:51 -0500, Terry Ofner wrote:
I would like to take the pStyle attribute; convert it into an element tag and surround the w:t text with the tags. I'm not sure what questions you have ... you've only given before and after and not where you are having the problem understanding your XSLT. A very short stylesheet is all that is needed. I hope this helps. . . . . . . Ken T:\ftemp>type ofner.xml
<w:body xmlns:w="urn:x-this" xmlns:wx="urn:x-that">
<wx:sect>
<w:p>
<w:pPr>
<w:pStyle w:val="A-Head"/>
</w:pPr>
<w:r>
<w:t>Nouns</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pStyle w:val="Textwindent"/>
</w:pPr>
<w:r>
<w:t>A dictionary lists thousands of words. All
these words can be divided into eight groups called the
parts of speech. A word's part of speech is determined
by the job it does in a sentence.</w:t>
</w:r>
</w:p>
</wx:sect>
</w:body>
T:\ftemp>xslt ofner.xml ofner.xsl con
<?xml version="1.0" encoding="utf-8"?> <A-Head>Nouns</A-Head>
<Textwindent>A dictionary lists thousands of words. All
these words can be divided into eight groups called the
parts of speech. A word's part of speech is determined
by the job it does in a sentence.</Textwindent>
<xsl:template match="w:p">
<xsl:element name="{w:pPr/w:pStyle/@w:val}">
<xsl:apply-templates select="w:r/w:t/node()"/>
</xsl:element>
</xsl:template></xsl:stylesheet> T:\ftemp> -- Upcoming XSLT/XSL-FO hands-on courses: Washington,DC 2006-06-12/16 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|

Cart



