Topic
3 replies Latest Post - ‏2012-11-10T13:03:01Z by SystemAdmin
SystemAdmin
SystemAdmin
6772 Posts
ACCEPTED ANSWER

Pinned topic Convert String to XML nodeset in Data power

‏2012-11-08T19:47:24Z |
I am facing an issue ... i need to convert a string to XML which is extracted from a CDATA tag and need to validate this XML against some XSD
For E.g like mentioned below

<DATA>
<![CDATA<innerXML> <abc></abc> <xyz></xyz> </innerXML>]>
</DATA>

But when ever i am extracting this inside xml i always found this as of String Type.
HermannSW expecting some help from your side.
Updated on 2012-11-10T13:03:01Z at 2012-11-10T13:03:01Z by SystemAdmin
  • kenhygh
    kenhygh
    1306 Posts
    ACCEPTED ANSWER

    Re: Convert String to XML nodeset in Data power

    ‏2012-11-08T20:43:54Z  in response to SystemAdmin
    dp:parse() is your friend.

    Ken
    • HermannSW
      HermannSW
      4141 Posts
      ACCEPTED ANSWER

      Re: Convert String to XML nodeset in Data power

      ‏2012-11-08T21:59:12Z  in response to kenhygh
      Ken is right, the text in <DATA> element need's to get "dp:parsed".

      Here you can see the difference:
      $ xpath++ "/DATA" cdata.xml 
      <DATA>
      &​lt;innerXML> &​lt;abc>&​lt;/abc> &​lt;xyz>&​lt;/xyz> &​lt;/innerXML>
      </DATA>
      $ xpath++ "dp:parse(/DATA)" cdata.xml 
      <innerXML> <abc/> <xyz/> </innerXML>
      $
      


      Hermann <myXsltBlog/> <myXsltTweets/>
      Updated on 2014-03-25T02:46:03Z at 2014-03-25T02:46:03Z by iron-man
      • SystemAdmin
        SystemAdmin
        6772 Posts
        ACCEPTED ANSWER

        Re: Convert String to XML nodeset in Data power

        ‏2012-11-10T13:03:01Z  in response to HermannSW
        Thanks Ken and Hermann for your help.