[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

newbie Q: how to format xml: <p>normal <b>bold</b> nor

Subject: newbie Q: how to format xml: <p>normal <b>bold</b> normal </p> :: to xhtml: <p>normal <b>bold</b> normal </p>
From: "Ed Eustace" <ed.eustace@xxxxxxxxxxxxxxxxx>
Date: Wed, 8 Sep 2004 16:26:50 +0100
xml bold
Hi,
I've been looking through the archives and I couldn't see anything that
matches this question. Excuse me if this is a repeat.

Heres my xml:
<article>
	<body>
		<module>
			<mbody>
			<p>some normal text <b>the bold text</b> back to
normal </p>
			<p>some more normal text <b>the bold text</b>
back to normal <b>and bold again</b></p>
			 </mbody>
		</module>
	 </body>
</article>


heres the xsl:
...
<xsl:template match = "/" >
<xsl:for-each select="article/body/module">
		<!-- mbody p-->
		<xsl:for-each select="mbody/p">
			  <xsl:apply-templates select = "//p" />
			  <xsl:apply-templates select = "//b"/>
		</xsl:for-each>
</xsl:for-each>
</xsl:template>


<xsl:template match = "p" >
	<xsl:value-of select = "." />
</xsl:template>

<xsl:template match = "b" >
<b>	<xsl:value-of select = "." /></b>
</xsl:template>

...
 and the xhtml I want should be:
...
<p>some normal text <b>the bold text</b> back to normal </p>
<p>some more normal text <b>the bold text</b> back to normal <b>and bold
again</b></p>

instead it displays the p tag then goes and does the b tag at the end.
Any guidance on this matter would be most appreciated.
ed


ed eustace
ed.eustace@xxxxxxxxxxxxxxxxx

openDemocracy.net
23 - 25 Gt Sutton Street
London EC1V 0DN

tel: +44 (0) 20 7608 2000
fax: +44 (0) 20 7608 2666

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.