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

Re: Detecting the tags inside CDATA section

Subject: Re: Detecting the tags inside CDATA section
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Sun, 13 Jul 2003 10:17:48 +0200
cdata inside cdata
There are no "tags" inside a CDATA section -- it is a regular text node and
its value is a string. If a string happens to contains the text
representation of an xml document, this does not help -- it would be
necessary to call an extension function that will parse this string and
return the node-set comprising of its top element.

> All the data inside the CDATA section here is actually an XML document

Then do put it as-is within the xml document -- not within a CDATA section.
In this case you'd be able to extract it with a single xsl:copy-of
instruction.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL



In case
"Deepti Kodeboyina" <dkodeboy@xxxxxxxxxxxxxx> wrote in message
news:Pine.GSO.4.53.0307130139470.19137@xxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> I have a problem regarding a CDATA section in an XML file. I want to
> convert this XML file into HTML to be displayed on a portal.My document
> looks something like this
>
> ----------------------------
> XML FILE
> -----------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <gridDataServiceResponse xmlns="">
>     <response name="requestsynch">
>         <result name="Engine">GDS Engine - request
>             &quot;requestsynch&quot; was stored successfully</result>
>     </response>
>     <response name="executerequestsynch">
>         <result name="statement">COMPLETE</result>
>         <result name="d1">
>             <data><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE RowSet PUBLIC '-//Sun Microsystems, Inc.//DTD RowSet//EN'
'http://java.sun.com/j2ee/dtds/RowSet.dtd'>
> <RowSet>
> <data>
>   <row>
>    <col>bitternut01.cs.indiana.edu</col>
>    <col>1024</col>
>    <col>896</col>
>    <col>1024</col>
>    <col>407626</col>
>   </row>
>   <row>
>    <col>bitternut02.cs.indiana.edu</col>
>    <col>1024</col>
>    <col>768</col>
>    <col>2048</col>
>    <col>407522</col>
>   </row>
> </data>
> </RowSet>]]></data>
>         </result>
>     </response>
> </gridDataServiceResponse>
>
> All the data inside the CDATA section here is actually an XML document
> that I want to parse and convert to a html file. But I dont know how to
> detect the tags inside a CDATA section and parse them. Does anyone know
> how this could be done ?
>
> Although it doesnt work my xslt stylesheet looks something like this
> ________________________________________
> STYLESHEET
> ________________________________________
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:util="http://www.oracle.com/XSL/Transform/java/Util"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xalan="http://xml.apache.org/xslt">
>
> <xsl:template match="/">
>   <html>
>   <body>
>     <h2>Query Output</h2>
>     <table border="1">
>                 <xsl:for-each select="gridDataServiceResponse/response">
>                         <tr bgcolor="#99CCFF">
>                                 <td>Response-<xsl:value-of
select="@name"/></td>
>                         </tr>
>
>                         <xsl:for-each select="result">
>                                 <tr>
>                                         <td>Result<xsl:value-of
select="@name"/></td>
>                                 </tr>
>                                 <tr>
>                                         <td><xsl:value-of
select="."/></td>
>                                 </tr>
>
>
>                                 <xsl:for-each select="data">
>                                         <xsl:for-each
select="/RowSet/data/row">
>                                         <tr bgcolor="#FFFFFF">
>                                                 <xsl:for-each
select="col">
>                                                 <td><xsl:value-of
select="."/></td>
>                                                 </xsl:for-each>
>                                         </tr>
>                                         </xsl:for-each>
>                                 </xsl:for-each>
>
>                         </xsl:for-each>
>
>                 </xsl:for-each>
>     </table>
>   </body>
>   </html>
> </xsl:template>
> </xsl:stylesheet>
>
> I am trying to convert the XML file into a table in HTML. I basically need
> to know how to detect the tags inside a CDATA section.
>
> Thank you,
> Deepti Kodeboyina
> Computer Science Dept.
> (dkodeboy@xxxxxxxxxxxxxx)
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.