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

not working as expected

Subject: not working as expected
From: "Zeeshan" <zmustansar@xxxxxxxxxxx>
Date: Mon, 14 May 2007 12:59:34 +0500
 not working as expected
Hi everyone

I need to generate a XHTML page similar to the one presented below. (I know it is wrong use of CDATA but I was unable generate some tages that are presented in the required xhtml page)

/*
---- xhtml to be generated
<s:div StyleClass ="block_c_1"><p>
<b>Welcome Zeeshan!</b><br /> <br />
<b>DOB: </b>August 20 1979 <br /> <br />
<b>We are committed to provide an enlightening and safe environment to all convention attendees.<br /> <br /></b>
<b>Site: Saroba Garden Lahore </b><br /> <br /> </p>
</s:div>


--- xhtml generated
<s:div StyleClass ="block_c_1"><p><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />
<b>Welcome Zeeshan!</b>
<b>DOB: </b>
<b>We are committed to provide an enlightening and safe environment to all convention attendees.</b>
<b>Site: Saroba Garden Lahore </b></p>
</s:div>
--- xml used
<DIVS StyleClass="block_c_1" > <PG>
<B>Welcome Zeeshan!</B>
<BREAK /><BREAK />
<B>DOB: </B>August 20 1979<BREAK /><BREAK />
<B>We are committed to provide an enlightening and safe environment to all convention attendees.</B><BREAK /><BREAK />
<B>Site: Saroba Garden Lahore </B> <BREAK /><BREAK />
</PG>
</DIVS>
------- xslt (I know it is wrong use of CDATA but I was unable generate the tages that are presented in the req xhtml page)
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>


<xsl:template match="DIVS">
<xsl:text><![CDATA[
<s:div ]]></xsl:text>
<xsl:if test="@StyleClass"><xsl:text>StyleClass ="</xsl:text>
<xsl:value-of select="@StyleClass" /><xsl:text><![CDATA[">]]></xsl:text>
</xsl:if>
<xsl:apply-templates select="PG"/>
<xsl:text><![CDATA[
</s:div>]]></xsl:text></xsl:template>

<xsl:template match="PG"> <xsl:text><![CDATA[<p>]]></xsl:text>
<xsl:apply-templates select="BREAK"/>
<xsl:apply-templates select="B"/>
<xsl:text><![CDATA[</p>]]></xsl:text></xsl:template>

<xsl:template match="BREAK"><xsl:text><![CDATA[<br /> ]]></xsl:text></xsl:template>

<xsl:template match="B"> <xsl:text><![CDATA[
<b>]]></xsl:text>
<xsl:value-of select="."/>
<xsl:text><![CDATA[</b>]]></xsl:text></xsl:template>
*/


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-2011 All Rights Reserved.