#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    3
    Rep Power
    0

    CDATA interpretation by the consumer - Results in technical fault in one enviornment


    Hi Team,

    Need your inputs to identify the mystery.

    Problem in rendering the CDATA portion in the xml body.

    Code:
    <tag>cdata placeholder</tag>
    Following cases are able to consume by consumer.

    Code:
    <tag><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?><tag1></tag1>....]]></tag>
    Code:
    <tag>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;tag1&gt;&lt;/tag1&gt;..</tag>
    In one enviorment alone, the logs are seen as below:

    Code:
    <tag>&lt;![CDATA[&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;tag1&gt;&lt;/tag1&gt;...]]&gt;</tag]
    And this results in technical fault.

    Thanks in Advance
    Rohit
    Last edited by rohit330; November 19th, 2013 at 05:36 PM. Reason: added the code placeholders
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    3
    Rep Power
    0
    Also, what is the normal format needs to be followed? Is that the third one is not a well formatted? Need your inputs for understanding the same.

    Regards
    Rohit


    Originally Posted by rohit330
    Hi Team,

    Need your inputs to identify the mystery.

    Problem in rendering the CDATA portion in the xml body.

    Code:
    <tag>cdata placeholder</tag>
    Following cases are able to consume by consumer.

    Code:
    <tag><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?><tag1></tag1>....]]></tag>
    Code:
    <tag>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;tag1&gt;&lt;/tag1&gt;..</tag>
    In one enviorment alone, the logs are seen as below:

    Code:
    <tag>&lt;![CDATA[&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;tag1&gt;&lt;/tag1&gt;...]]&gt;</tag]
    And this results in technical fault.

    Thanks in Advance
    Rohit
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    3
    Rep Power
    0
    The problem is not with one enviornment. When the logger level is INFO, the issue comes. If it is DEBUG, surprisingly passes thru.
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    First is correct use of CDATA. Second is correct lack of use of CDATA. Third is not correct.

    The third looks like someone tried to pass a literal "<[CDATA[<?xml..." string to whatever library they were using to generate the XML. In which case the CDATA shouldn't be there because the library automatically encodes the value and you don't need to worry about it.

IMN logo majestic logo threadwatch logo seochat tools logo