How to retain CRLF when reading from an XML CDATA field?

Reply
Occasional Contributor
Posts: 12

How to retain CRLF when reading from an XML CDATA field?


Hello all,

     Thanks for reading this first off.

          Here's the deal, when I read an XML CDATA field into SAS I loose '0D0A'x characters. Even when I specify a $charw. informat! I've searched everywhere to figure out how to retain these characters when reading character data that contains them, but to no avail.

Help?

Huey

Respected Advisor
Posts: 4,173

Re: How to retain CRLF when reading from an XML CDATA field?

Please post your code reading this field.

Occasional Contributor
Posts: 12

Re: How to retain CRLF when reading from an XML CDATA field?

Thanks for the reply.

Below is the part of the XML Map corresponding to the misbehaving field:

        <COLUMN name="Item_Response">

            <PATH syntax="XPath">/QS_Scoring/CR_Item_Resp_Record/Item_Response</PATH>

            <TYPE>character</TYPE>

            <DATATYPE>string</DATATYPE>

            <LENGTH>20000</LENGTH>

            <FORMAT width="20000">$CHAR</FORMAT>

            <INFORMAT width="20000">$CHAR</INFORMAT>

        </COLUMN>

Below is the SAS code libname statment (I'm using SAS 9.2):

     libname XML_lib xml "&workhere.\MyFile.xml" xmlmap="&workhere.\XML_MAP.map";

Thanks again,

Huey

Ask a Question
Discussion stats
  • 2 replies
  • 290 views
  • 0 likes
  • 2 in conversation