xsl-list
[Top] [All Lists]

RE: (newby) extraction of CDATA nodes to different XML files

2005-04-01 03:42:03


Hi M.K,

     Maybe all the guy wants to do is copy the contents of the cdata
sections to individual files.

As one of the solutions mentioned,
if the 3 nodes containing cdata sections were

<foo><![CDATA[   .....snip.....   ]]></foo>
<bar><![CDATA[   .....snip.....   ]]></bar>
<foobar><![CDATA[   .....snip.....   ]]></foobar>

All he needs is 3 templates and the logic to write the content out to
individual files can be nested in those templates.

As for writing to multiple files, I remember reading somewhere XSLT is not
good at this sort of thing.

Regards,
Omprakash.V









                                                                                
                                   
                    "Michael Kay"                                               
                                   
                    <mike(_at_)saxonic        To:     
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>                              
   
                    a.com>               cc:     (bcc: omprakash.v/Polaris)     
                                   
                                         Subject:     RE: [xsl] (newby) 
extraction of CDATA nodes to different XML 
                    04/01/2005           files                                  
                                   
                    02:58 PM                                                    
                                   
                    Please                                                      
                                   
                    respond to                                                  
                                   
                    xsl-list                                                    
                                   
                                                                                
                                   
                                                                                
                                   




Can't be done in XSLT: CDATA is not considered to be information-bearing in
the XPath data model. In other words,

<![CDATA[xyz]]>

is exactly the same content as

xyz

just as a="3" and a='3' are considered simply as two different ways of
writing the same thing.

If you have used CDATA in your source document to convey information that
needs to be retained, consider a textual transformation (e.g. in Perl) to
replace the CDATA delimiters by element start and end tags.

Michael Kay
http://www.saxonica.com/



-----Original Message-----
From: dalloro(_at_)gmail(_dot_)com [mailto:dalloro(_at_)gmail(_dot_)com]
Sent: 01 April 2005 10:03
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] (newby) extraction of CDATA nodes to different
XML files

Hi,

I need to extract the contents of three particular nodes in an XML
file to three separate XMLs.
The elements have the strange definition shown below:
<![CDATA[   .....snip.....   ]]>

Whenever I encounter that type of construct I would like to extract
the data that it contains to a separate XML.

Can you give some hints to solve this task?

Thank you very much.
Best regards.

Livio

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to 
you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its 
attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--