RE: need help

"Michael Kay" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <00cf01c788c1$e41c8b10$6401a8c0@turtle>
Well, you've got exactly the output you asked for, so I don't know what
makes you think it isn't working. Only your first template rule is
activated; it doesn't call apply-templates so the other template rules are
never fired.
 
However, this has to be the worst XSLT code I have seen for a long time.
Don't try to output markup as text using CDATA, do it properly by creating a
result tree and leaving the serializer to generate the markup.
 
You're on the wrong forum anyway: try the xsl-list at
http://www.mulberrytech.com/ . Your post has nothing to do with JDOM.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Zeeshan
Sent: 27 April 2007 12:01
To: [email protected]
Subject: [jdom-interest] need help


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

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.