Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi guys,

I have one xml file, where i have this

   <description><![CDATA[

<img src="http://s.abc.com/img_s/8f/8fbb098189355d21fd75183a623c101a_w290_h250.jpg"  />
<br/>

يحسم مجلس الشورى اليوم (الثلاثاء) تحويل الرئاسة العامة لرعاية الشباب إلى وزارة للشباب والرياضة، حيث سيناقش توصية العضو منصور الكريديس المطالبة بذلك والتي رفضت لجنة الشؤون الاجتماعية والأسرة والشباب قبولها وضمها لتوصياتها على تقرير الرئاسة السنوي الأخير المعروضة</description>


i have to convert this into xslt(transform)..

can anyone please help me in this.

Thanks
Posted
Comments
Kornfeld Eliyahu Peter 24-Mar-15 14:03pm    
What exactly do you want to convert to XSLT?
Or you want some XSLT to convert this XML to something else?

1 solution

The question really makes no sense.

First of all, <![CDATA[...]]> is not a part of logical structure. When you parse XML, it simply does not exist. This is just another form of regular text node. The purpose of it is to simplify writing a string which contains XML meta-characters like < or >, which otherwise would need escaping using character entities. Please see: http://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/CDATASection.html.

Secondly, the question on "convert" is something like asking "help me to convert C strings into a C function". XML represents data. XSLT is also XML, but specialized. It represents data, but the data used to declare some rules from transformation of one package of data into another, say, XML data to HTML data or text. Even if XSLT takes the form of XML text data, the transformation rules are written using specialized XML Schema: http://www.w3.org/2007/schema-for-xslt20.xsd.

See also:
http://en.wikipedia.org/wiki/XSLT,
http://en.wikipedia.org/wiki/XML_schema.

It is possible that your input XML is meant to be some non-standard form expressing some transformation rules which needs to be translated into standard XSLT, but your code sample does not look like that. If it means something in terms of data transformation, please explain.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900