ql-io / ql.io

A node.js based declarative, data-retrieval and aggregation gateway for quickly consuming HTTP APIs
http://ql.io
Other
931 stars 112 forks source link

Jsonify XML enclosed in CDATA section #399

Closed smunamala closed 12 years ago

smunamala commented 12 years ago

When an XML is enclosed in a CDATA section of an XML ,, is it possible to return the XML inside the CDATA section in JSON as part of the XML to JSON transformation

example, below is the XML segment enclosed in "Value" element.

       <mapping>
           <field xsi:type="Member" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
              <namespace>ProductDetailDictionary</namespace>
              <name>PRODUCT_FULL_DESCRIPTION</name>
           </field>
           <fieldValue xsi:type="StringFieldValue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
              <value><![CDATA[<?xml version="1.0" encoding="UTF-8"?><property_info><property><name>3D Technology</name><value>3D Not Supported</value></property><property><name>Brand_enum</name><value>Vizio</value></property><property><name>Ebay Title</name><value>Vizio E321VL 32" 720p HD LCD Television</value></property><property><name>Expanded Product Features</name><value>&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Ambient lighting&lt;/strong&gt;&lt;br /&gt;Energy efficient sensors auto-adjust brightness for the perfect picture regardless of room conditions.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SRS TruVolume&lt;/strong&gt;&lt;br /&gt;Limits volume inconsistencies between programming.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Dynamic Contrast Ratio&lt;/strong&gt;&lt;br /&gt;A 100,000:1 Dynamic Contrast Ratio delivers deeper blacks and brighter whites through contrast and dimensions.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SRS TruSurround HD&lt;/strong&gt;&lt;br /&gt;Delivers immersive virtual high definition surround sound.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Eco HD&lt;/strong&gt;&lt;br /&gt;Eco HD saves you money on your utility bills while limiting the impact on the environment.&lt;/li&gt;&lt;/ul&gt;</value></property><property><name>Internet Content Support</name><value>Not Supported</value></property><property><name>Native Resolution</name><value>720p</value></property><property><name>Refresh Rate</name><value>60 Hz</value></property><property><name>sdc.computed.enum.Display Technology</name><value>LCD</value></property><property><name>sdc.computed.enum.TV Type</name><value>Plasma and LCD TVs</value></property><property><name>sdc.computed.squelch_marketing_text</name><value>N</value></property><property><name>sdc.string.Aspect Ratio</name><value>16:9</value></property><property><name>sdc.string.Audio Type</name><value>Stereo</value></property><property><name>sdc.string.Brand</name><value>Vizio</value></property><property><name>sdc.string.Brightness (Display)</name><value>500 cd/m²</value></property><property><name>sdc.string.Built-in Tuner (List)</name><value>NTSC</value></property><property><name>sdc.string.Cabinet Color (List)</name><value>Black</value></property><property><name>sdc.string.Comb Filter</name><value>3DYC / 3D Digital</value></property><property><name>sdc.string.Digital Standard (List)</name><value>HDTV</value></property><property><name>sdc.string.Display Format (List)</name><value>720p (HDTV)</value></property><property><name>sdc.string.Display Resolution</name><value>1366 x 768 pixels</value></property><property><name>sdc.string.Exterior Color (List)</name><value>Black</value></property><property><name>sdc.string.MPN</name><value>E321VL</value></property><property><name>sdc.string.Native Aspect Ratio</name><value>16:9</value></property><property><name>sdc.string.Number of Speakers (Num)</name><value>2</value></property><property><name>sdc.string.Response Time (Display)</name><value>8 ms</value></property><property><name>sdc.string.Room Type (CDA)</name><value>Commercial Space</value><value>Living Room</value></property><property><name>sdc.string.Screen Size (Display)</name><value>32"</value></property><property><name>sdc.string.TV Type (CDA)</name><value>Flat-Panel</value></property><property><name>sdc.string.Viewing Angle (display)</name><value>178°</value></property><property><name>sdc.string.ebay_desc</name><value>The Vizio E321VL television delivers superior quality picture with 100,000:1 dynamic contrast ratio and 720p HD resolution. This Vizio HDTV LCD television boasts Ambient Light Sensing technology, which automatically adjusts backlight levels to the brightness of its surroundings. This Vizio 32-inch television features SRS TruVolume, which limits volume inconsistencies between programming and SRS TruSurround HD audio for advanced virtual surround sound. The Vizio E321VL is equipped with two HDMI ports to accommodate your home theater setup. This Vizio 32-inch television exceeds ENERGY STAR 4.1 guidelines by using technology with remarkably low energy consumption.</value></property><property><name>sdc_pc_product_languages.model_number</name><value>E321VL</value></property><property><name>sdc_pc_product_languages.upc</name><value>845226005343</value></property></property_info>]]></value>
           </fieldValue>
        </mapping>
s3u commented 12 years ago

@idralyuk - can you spend some brain cycles and see if this makes sense?