XMLv2 accent - encoding

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

XMLv2 accent - encoding

Hello everyone:

 

I have a question, I trying read an xml file from a webservice, all is ok until I want load result into a dataset. The problem occurrs by an accent into xml tag, by example <country>México</country>.

 

This is the code:

 

filename response '/tmp/Output.xml';
filename respmap '/tmp/Output.map';

Libname response xmlv2 xmlmap=respmap automap=replace;
Libname clmfile XMLV2 '/tmp/Output.xml' XMLMAP='/tmp/Output.map';

 

The error is:

 

ERROR: The creation of the XML Mapper file failed.
ERROR: Error in the LIBNAME statement.

 

Thanks in advance.


Accepted Solutions
Solution
a month ago
Occasional Contributor
Posts: 13

Re: XMLv2 accent - encoding

Hello everyone:

 

I can resolve the problem with this lines

 

proc soap in=<filein> out=<fileout> url=<url> soapaction=<soapaction> envelope;

 

envelop is an option of proc soap that store complete soap result in the outputfile, fileout in this case. The complete result include

 

<?xml version="1.0" encoding="iso-8859-1" ?>

 

Thanks very much.

 

View solution in original post


All Replies
Super User
Super User
Posts: 6,499

Re: XMLv2 accent - encoding

What encoding is your SAS session using?  Run either of these lines of code to find out.

proc options option=encoding; run;
%put %sysfunc(getoption(encoding));
Occasional Contributor
Posts: 13

Re: XMLv2 accent - encoding

Hello Tom:

 

Thanks for your help the result was:

 

%put %sysfunc(getoption(encoding));
LATIN1

 

Thanks in advance.

Super User
Super User
Posts: 6,499

Re: XMLv2 accent - encoding

You will probably need to run SAS with unicode support so that it can handle the characters.

You might be able to just get away with adding an ENCODING=option to the filename statement that points to the XML file.

Super User
Posts: 9,676

Re: XMLv2 accent - encoding


filename x temp;
Libname response xmlv2 '/tmp/Output.xml'   xmlmap=x   automap=replace;

proc copy in=response  out=work noclone;

run;

Occasional Contributor
Posts: 13

Re: XMLv2 accent - encoding

Hello everyone:

 

I add manually

 

<?xml version="1.0" encoding="iso-8859-1" ?>

to the out file of proc soap, and work very well. ¿proc soap can add this automatically? 

 

Thanks in advance.

Solution
a month ago
Occasional Contributor
Posts: 13

Re: XMLv2 accent - encoding

Hello everyone:

 

I can resolve the problem with this lines

 

proc soap in=<filein> out=<fileout> url=<url> soapaction=<soapaction> envelope;

 

envelop is an option of proc soap that store complete soap result in the outputfile, fileout in this case. The complete result include

 

<?xml version="1.0" encoding="iso-8859-1" ?>

 

Thanks very much.

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 205 views
  • 3 likes
  • 3 in conversation