[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL for WordML -> specific HTML
I have a WordML based xml document which contains content along the
lines of:
<wx:sub-section> <w:p> <w:pPr> <w:pStyle w:val="Heading1"/> </w:pPr> <w:r> <w:t>Hello 1</w:t> </w:r> </w:p> <w:p> <w:r> <w:t>Some random normal text 1</w:t> </w:r> </w:p> <wx:sub-section> <w:p> <w:pPr> <w:pStyle w:val="Heading2"/> </w:pPr> <w:r> <w:t>Hello 2</w:t> </w:r> </w:p> <w:p> <w:r> <w:t>Some random normal text 2</w:t> </w:r> </w:p> and I want to output that as: <div style="level1">Hello 1</div> <p>Some random normal text 1</p> <div style="level2">Hello 2</div> <p>Some random normal text 2</p> Obviously I may have headings all over the document, so I want something generic that will pick them all out nicely. Currently I have a rather messy: <xsl:template match="w:pStyle[@w:val='Heading1']"> <div class="section_L1"> <xsl:value-of select="../../w:r/w:t/text()"/> </div> </xsl:template> <xsl:template match="w:pStyle[@w:val='Heading2']"> <div class="section_L2"> <xsl:value-of select="../../w:r/w:t/text()"/> </div> </xsl:template> that outputs: <div class="section_L1"></div><div class="section_L2"></div><div class="section_L1">Hello 1</div>Some random normal text 1<div class="section_L2">Hello 2</div>Some random normal text 2 Anyone have any useful ideas?
("\''/").___..--'''"-._ `0_ O ) `-. ( ).`-.__.`) (_Y_.)' ._ ) `._ `. ``-..-' _..`--'_..-_/ /--'_.' .' ((i).-'' ((i).' (((.-'
|
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
|