Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] need help

Zeeshan

2007-04-27

Replies:

Hi every one
 
I am unable to transform the xml to text using the xslt. in fact  I am getting following as output
 
 <s:div StyleClass ="top_banner_right1"> This is heading(August 31-September 3, 2007) Saroba garden lahore
 
the contents of the files are also pasted below
page.xml
<Event>
<Page>
<DIV StyleClass="top_banner_right1">
<H1 Class="h1_1">This is heading</H1>
<B>(August 31-September 3, 2007)</B>
<BREAK />
<B>Saroba garden lahore</B>
</DIV>
</Page>
</Event>
page.xslt

<xsl:template match="Event/Page/DIV"><xsl:text><![CDATA[<s:div ]]></xsl:text><xsl:if test="@StyleClass"><xsl:text><![CDATA[StyleClass ="]]></xsl:text><xsl:value-of select="@StyleClass" /><xsl:text><![CDATA[">]]></xsl:text></xsl:if><xsl:text><![CDATA[ ]]></xsl:text><xsl:value-of select="."/><xsl:text><![CDATA[]]></xsl:text></xsl:template>

<xsl:template match="Event/Page/DIV/H1"><xsl:text><![CDATA[<h1>]]></xsl:text><xsl:value-of select="."/><xsl:text><![CDATA[</h1>]]></xsl:text></xsl:template>

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

<xsl:template match="Event/Page/DIV/BREAK">

<xsl:text><![CDATA[<br>]]></xsl:text><xsl:value-of select="."/><xsl:text><!CDATA[</br>]]></xsl:text></xsl:template>

 

regards

Zeeshan

 


Attachment: page.xslt

Attachment: page.xml
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.