UTF-8 conversion to XML entities

I'm looking for a function/method for converting UTF-8 encoded text into XML entities (like & etc.) anyone that can help?
/Niels

hi nilesh,
UTF 8 does not recognise those special characters. You will have to change the encoding to <b>ISO-8859-1</b>.
For into on how to do this, check this thread,
Java Mapping Parsing Error
Regards,
Bhavesh

Similar Messages

  • Perform unicode to UTF-8 conversion on F110 bacs payment file in ABAP

    Hi,
    I am facing a conversion issue for the UK BACS payment files.
    The payment run tcode F110 creates a payment file but the file when created on the application server has soem sort of code conversion. If I removed the # value, i can read most of the data.
    The data example is as below-
    #V#O#L#1#0#0#1#5#8#8# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #2#4#3#3#0#9#
    #H#D#R#1#A#2#4#3#3#0#9#S# # #1#2#4#3#3#0#9#0#0#0#0#0#2#0#0#0#1#0#0#0#1# # # # # # # #1#0#1#1#2#
    #H#D#R#2#F#0#2#0#0#0#0#0#1#0#0# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #U#H#L#1# #1#0#1#1#3#9#9#9#9#9#9# # # # #0#0#0#0#0#0#0#0#1# #D#A#I#L#Y# # #0#0#0# # # # # # # #
    This is then transferred to the bank via the FTP UNIX Script but after the conversion which is happening as-
    #Perform unicode to UTF-8 conversion on bacs file
    $a = "iconv -f UNICODE -t UTF-8 $tmpUNI > $tmpASC";
    The need going forward is to bring the details via the interface and then make an uplaod.
    The ABAP code should be able to make the conversion, remove the additional chracters and then send the file across.
    I have searched everywhere but I am not able to find out how to make the same conversion in ABAP.
    We are on ECC6.
    Can someone please help me?
    Regards,
    Archana

    Hi Archana,
    can  you please check SAP notes 1064779 and 1365764 (including the attachment) and see if this helps you ?
    Best regards,
    Nils Buerckel
    SAP AG

  • XML entities in xs:base64Binary

    Hi there,
    this is my first Post, and i hope i am at the right place in this forum.
    I am integrating a third party application, that provides WSDL files for generating web services. An internal Web Service is creating an XML which is than encoded via base64 an sent as a SOAP message to the application.
    So the SOAP message contains an element (type xsd:base64Binary) in wich the base64 content is transported. The problem is, that in this base64 string, there are xml entities &amp;#xA; instead of the allowed base64 whitespace characters.
    Can anyone give me a hint, if these character entities can be supressed?
    Best
    Thomas

    Hi,
    Sorry, but i think i cant do search and replace here.
    @David: the SOAP message containing the base64Binary element is sent from SAP to the application. It is created by a consumer proxy we generated from the WSDL files provided by the third party application (namely StreamServe) . The application cant handle the character entities &amp;#xA; the base64 string contains.
    We also regenerated the proxy class, but there ist still a mapping from the xml schema type xsd:base64Binary to ABAP RAWSTRING.
    This error (or these character entities) occur, since we upgraded to EHP1, so i think there might be the cause for this behaviour.
    Best
    Thomas

  • Encoding Individual Strings with XML entities to replace "&", " ", etc.

    We use templates to create XML files. The tags are in the templates and just the values get substituted in. Sometimes the variable value contains an ampersand or other XML-banned character.
    1) Is there a simple method in the Java or Xerces class libraries that takes a string and returns one with the suspect characters replaced by XML entities?
    2) Sometimes, though rarely (I have no control over this!) the variables arrive with the forbidden characters already replaced by entities. Is there a method which will tell me if the string already contains entities, or at least is already a valid XML string? Otherwise I'm afraid the ampersand in an already-converted entity name will itself be converted to another entity.
    Thanks!

    I'm not aware of any built-in mechanism for doing that kind of escaping short of a full XML generator. Here's a lightweight solution that replaces ampersands only if they're not part of an XML entity. Just grab a copy of Elliott Hughes' Rewriter and implement it like this: public class Test
      /* Rewriter can be found here:
       * http://elliotth.blogspot.com/2004/07/java-implementation-of-rubys-gsub.html
      public static void main(String... args) throws Exception
        Rewriter xmlEscaper = new Rewriter("[<>'\"]|&(?!(?:lt|gt|apos|quot|amp);)")
          public String replacement()
            char ch = group(0).charAt(0);
            switch (ch)
              case '<'  : return "&#38;lt;";
              case '>'  : return "&#38;gt;";
              case '\'' : return "&#38;apos;";
              case '"'  : return "&#38quot;";
              case '&'  : return "&#38amp;";
              default :
                throw new IllegalStateException("this can't happen");
        String str = "this & that & the <other&#38gt;";
        System.out.println(xmlEscaper.rewrite(str));
    }

  • Resolving xml entities only in a string

    Hi!
    Is there any function in any API that can resolve XML entities like & to &, > to > and so on that can handle the input as a string?
    /Tec

    If you mean, is there any Java method to convert "&lt;" to < and so on, no, there isn't. However if you use standard XML parsers then you don't have to worry about that issue because they take care of it for you. If you're writing your own parser then you have to write the unescaping code yourself.

  • Conversion of XML file from ANSI to UTF-8 encoding in SAP 4.6C

    Hi All,
      Im working on SAP 4.6C version.I have generated a XML file from my custom report.It is downloading in ANSI format.But i need to download this into UTF-8 format.So can anyone please let me know how to do this?
    Is this possible in 4.6C version?
    Thanks in Advance,
    Aruna A N

    Hello
    It is possible in 4.6.
    Try this code:
    REPORT Z_TEST_XML_DOWN .
    data:
      lp_ixml type ref to if_ixml,
      lp_xdoc type ref to if_ixml_document,
      lp_sfac type ref to if_ixml_stream_factory,
      lp_ostr type ref to if_ixml_ostream,
      lp_rend type ref to if_ixml_renderer,
      lp_enco type ref to if_ixml_encoding.
    data:
      lp_root type ref to if_ixml_element,
      lp_coll type ref to if_ixml_element,
      lp_elem type ref to if_ixml_element.
    class cl_ixml definition load.
    data:
    udat like lfa1,
    s type string.
    select single * from lfa1 into udat where lifnr = '0000000001'. " <- set here real number
    *** create xml
    lp_ixml = cl_ixml=>create( ).
    lp_xdoc = lp_ixml->create_document( ).
    lp_root = lp_xdoc->create_simple_element( name = 'Node'
                                              parent = lp_xdoc ).
    s = udat-land1.
    call method lp_root->set_attribute( name = 'country_name'
                                        value = s ).
    s = udat-name1.
    call method lp_root->set_attribute( name = 'vendor_name'
                                        value = s ).
    s = udat-ort01.
    call method lp_root->set_attribute( name = 'city_name'
                                        value = s ).
    *** render xml
    types: begin of xml_tab_line,
             line(256) type x,
           end of xml_tab_line.
    types: xtab type table of xml_tab_line.
    data: t_xml type xtab,
          size type i,
          rc type i.
    lp_sfac = lp_ixml->create_stream_factory( ).
    lp_ostr = lp_sfac->create_ostream_itable( table = t_xml ).
    lp_enco = lp_ixml->create_encoding( character_set = 'utf-8'
                                   byte_order = if_ixml_encoding=>co_none ).
    call method lp_ostr->set_encoding( encoding = lp_enco ).
    lp_rend = lp_ixml->create_renderer( ostream = lp_ostr
                                        document = lp_xdoc ).
    rc = lp_rend->render( ).
    *** export to file
    size = lp_ostr->get_num_written_raw( ).
    call function 'WS_DOWNLOAD'
      exporting
        bin_filesize = size
        filename = 'c:\sapxml_test.xml'
        filetype = 'BIN'
      tables
        data_tab = t_xml
      exceptions
        others = 1.
    It is just simple example.

  • Problem in file content conversion from XML to CSV

    Hi Experts,
    I am finding problem in file content conversion. I need to convert the following XML file into CSV file:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_CROSS_REF xmlns:ns0="urn:dabur:idoc2file:pos">
          <Update_type>2</Update_type>
          <PLU>00000000</PLU>
          <Cross_ref_PLU>7777777</Cross_ref_PLU>
          <Capture_PLU />
          <Package_size />
          <Package_desc />
      </ns0:MT_CROSS_REF>
    The output file data has to be like:
    2,00000000,7777777,,,,
    The problem I am facing is while specifying the content conversion parameters in communication channel i dont know what recordset structure i should mention as all the records are directly under root. If I mention recordset structure as "ns0:MT_CROSS_REF" and parameters as
    ns0:MT_CROSS_REF.fieldSeparator   ,
    ns0:MT_CROSS_REF.endSeparator    'nl'
    i get error in communication channel monitoring and no file is posted.
    Please help me as to what correct parameter i should mention in my case.
    Thanks,
    Regards,
    Yash

    Hi Chirag,
    I cannot change the xml file as it comes after mapping idoc to a message type. How can I add ROOT in the xml? My message type is like MT_CROSS_REF and it has those 6 fields as in the XML (Update_type, PLU etc.). I do the mapping of these fields from a IDOC and get the XML.
    I hope you got my point.
    Thanks,
    Yash

  • Conversion of XML file in Noepad

    Hi Folks,
    i have a requiremnt like sending .TXT file and output is .XML.
    when i open the file in internet explorer i Got right output. when open the same file in notepad the file is look like below
    <?xml version="1.0" encoding="UTF-8"?>
    <EDS_PII_XML><Header><FILE_DATE></FILE_DATE></Header><Employee><EMPLID>010203</EMPLID><LAST_NAME>PUBLIC</LAST_NAME><FIRST_NAME>JOHN</FIRST_NAME><Deductions><DEDUCTION_CODE>HM</DEDUCTION_CODE><RECORD_TYPE>A</RECORD_TYPE><BEGIN_DT>2009-01-01</BEGIN_DT><END_DT></END_DT><PRE_TAX_COST>33.48</PRE_TAX_COST><AFTER_TAX_COST>0.00</AFTER_TAX_COST><OPTION>KAHI</OPTION><COVERAGE_LEVEL>EF</COVERAGE_LEVEL><IMPUTED_INCOME>0.00
    but i need the file like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <EDS_PII_XML>
    <Header>
    <FILE_DATE></FILE_DATE>
    </Header>
         <Employee>
              <EMPLID>010203</EMPLID>
              <LAST_NAME>PUBLIC</LAST_NAME>
              <FIRST_NAME>JOHN</FIRST_NAME>
              <Deductions>
                   <DEDUCTION_CODE>HM</DEDUCTION_CODE>
                   <RECORD_TYPE>A</RECORD_TYPE>
                   <BEGIN_DT>2009-01-01</BEGIN_DT>
                   <END_DT/>
                   <PRE_TAX_COST>33.48</PRE_TAX_COST>
                   <AFTER_TAX_COST>0.00</AFTER_TAX_COST>
                   <OPTION>KAHI</OPTION>
                   <COVERAGE_LEVEL>EF</COVERAGE_LEVEL>
                   <IMPUTED_INCOME>0.00</IMPUTED_INCOME>
                   <GOAL_AMOUNT>0.00</GOAL_AMOUNT>
              </Deductions>
              <Deductions>
                   <DEDUCTION_CODE>HS</DEDUCTION_CODE>
                   <RECORD_TYPE>A</RECORD_TYPE>
                   <BEGIN_DT>2009-01-01</BEGIN_DT>
                   <END_DT/>
                   <PRE_TAX_COST>15.25</PRE_TAX_COST>
                   <AFTER_TAX_COST>0.00</AFTER_TAX_COST>
                   <OPTION>01</OPTION>
                   <COVERAGE_LEVEL>EF</COVERAGE_LEVEL>
                   <IMPUTED_INCOME>0.00</IMPUTED_INCOME>
                   <GOAL_AMOUNT>150.00</GOAL_AMOUNT>
    Any conversion is there in XI?
    please let me know ASAP.
    points also rewarded.
    Thanks
    Anil M

    Hi Anil,
    You can do the conversion with XSLT. Here's the code:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="utf-8" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="@*|node()">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
      </xsl:template>
    </xsl:transform>
    (This copies the complete XML, and created a formatted output - indent="yes". All other content remains untouched.)
    How to integrate in SAP, read here: http://www.heidoc.net/joomla/en/technology-science/sap-and-xslt/5-tutorial-data-exchange-between-abap-and-xml
    Best wishes,
    Jan
    Edited by: Jan Krohn on Jul 15, 2011 10:57 AM

  • Conversion from xml to csv using xsl

    hi i am converting from xml to csv using xsl i am getting the extra junk character(space) in the csv file.below i written the xml file and xsl file
    xml file
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?xml-stylesheet type="text/xsl"?>
    <DOCUMENTS>
         <FILE>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>SQL</TEXT>
              <LINK>http://www.sql.org/</LINK>
         </DOCUMENT>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>Information</TEXT>
              <LINK>http://google.com/</LINK>
         </DOCUMENT>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>Configuration</TEXT>
              <LINK>http://msdn.microsoft.com/</LINK>
         </DOCUMENT>
         </FILE>
    </DOCUMENTS>
    xsl file
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text" indent="yes"/>
    <xsl:template match="DOCUMENTS">
    <xsl:text>Business,Program,Project,DocumentName,Textforlink,Hyperlink</xsl:text>
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="FILE">
    <xsl:value-of select="DOCUMENT/BUSINESS"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/PROGRAM"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/PROJECT"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/NAME"/>
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="DOCUMENT">
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="TEXT"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="LINK"/>
    </xsl:template>
    </xsl:stylesheet>
    for converting to csv i am using java program.
    please go through it.

    <xsl:value-of select="','"/>That's not the correct way to output a literal comma. Just write the comma directly, or use xsl:text. And don't put in those line breaks either. You can reduce the rule for FILE to something like this:
    xsl:template match="FILE">
    <xsl:value-of select="DOCUMENT/BUSINESS"/>, <xsl:value-of select="DOCUMENT/PROGRAM"/>, <xsl:value-of select="DOCUMENT/PROJECT"/>, <xsl:value-of select="DOCUMENT/NAME"/>
    <xsl:apply-templates/>
    </xsl:template>

  • Can't get UTF-8 characters from XML file displayed correctly (Cocoa Touch)

    Hi there,
    I'm trying to read an XML file with Japanese and Korean characters (encoded UTF-8) into a String like
    NSString *s = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://.../data1.xml"] encoding:NSUTF8StringEncoding error:&e];
    However, the output just gives me some wrong characters. I also tried use NSData, but the result was the same.
    The same when I parse the XML file with
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:URL];
    The parser function just gives back gibberish.
    When I write the data into a table cell (cell.text = ...), only the first character is displayed followed by "...".
    Where can I start looking to get this right? I'm not so experienced in Cocoa yet, so I feel that I'm missing something simple here...
    Thanks,
    Thomas

    I think so (haven't checked), but it is a really simple test xml which is not really error prone).
    But the problem is a different one, because I also just tried to read a txt file with some Japanese characters into an NSString using initWithContentsOfURL.
    When I print the string in the console, I only get messed up characters (the latin characters next to the Japanese are displayed fine).
    It is a general problem of reading out an UTF-8 file from an url.
    Spent the whole last night to google something helpful but couldn't find anything. Now I'm tired at work
    Thomas

  • Remove ?xml version="1.0" encoding="UTF-8"? from xml file

    I have generated an XML file using sax paraser. In the XML file thats generated I have the version and the encoding line
    <?xml version="1.0" encoding="UTF-8"?>which is automatically generated in my XML file. Is there any way that I can avoid that from the XML file thats generated.

      try
                            FileWriter fr = new FileWriter(new File(path, fileName));
                            Document docNode = docNodeMap.get(name);
                            XMLOutputter outputter = new XMLOutputter();
                            outputter.output(docNode, fr);
                            fr.close();
                    catch (IOException e)
                            e.printStackTrace();
                    }this the code generating xml file.

  • Remove ?xml version="1.0" encoding="UTF-8"?   from XML doc

    I have generated an XML file using javax XML transformer. In the XML file thats generated I have the version and the encoding line
    <?xml version="1.0" encoding="UTF-8"?>
    which is automatically generated in my XML file. Is there any way that I can avoid that from the XML file thats generated.
    Here is the transformer that I have used.
    public static void printToXML(String fileName){
               try{
                    File file = new File(fileName);
                    Transformer tr = TransformerFactory.newInstance().newTransformer();
                    tr.setOutputProperty(OutputKeys.INDENT, "yes");
                    tr.setOutputProperty(OutputKeys.METHOD,"xml");
                    tr.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3");
                    tr.transform( new DOMSource(dom),new StreamResult(new FileWriter(file)));
               }catch(TransformerConfigurationException tcex){
                    logger.info("TransformerConfigurationException at printToXML method in CSVtoXML.java");
                    logger.error("TransformerConfigurationException", tcex);
               }catch(TransformerException tex){
                    logger.info("TransformerException at printToXML method in CSVtoXML.java");
                    logger.error("TransformerException", tex);
               }catch(IOException ioex){
                    logger.info("IOException at printToXML method in CSVtoXML.java");
                    logger.error("IOException", ioex);
          }

    Well, it is a pretty important line. Why do you need it removed? Anything that really processes XML knows how to read it and determine what encoding was used. That is vital, if you look at the number of questions posted here about foreign language text in XML. If you really have a text processsor that knows how to open a file called something.xml, and knows how to process or ignore most of the pointy bracket things, but not this one, it is time to fix it.
    Dave Patterson

  • File Adapter - File Content Conversion to XML last element missing

    I'm using the SAP File Adapter with File Content Conversion to convert | (pipe) delimited records into XML.
    When the last field is blank, I would expect that an empty node gets created, however, the node doesn't get created at all.
    For example given these settings...
    Record.fieldSeparator = |
    Record.endSeparator = 'nl'
    Record.fieldNames = FIELD1,FIELD2,FIELD3
    Using this three record file as my data...
    |123|XYZ
    ABC||XYZ
    ABC|123|
    When converted to XML, this is what the recordset XML structure looks like...
    <Recordset>
    <Record>
    <FIELD1 />
    <FIELD2>123</FIELD2>
    <FIELD3>XYZ</FIELD3>
    </Record>
    <Record>
    <FIELD1>ABC</FIELD1>
    <FIELD2 />
    <FIELD3>XYZ</FIELD3>
    </Record>
    <Record>
    <FIELD1>ABC</FIELD1>
    <FIELD2>123</FIELD2>
    </Record>
    </Recordset>
    Notice that the last record is missing the "FIELD3" element.
    Edited by: William Krick on Jun 17, 2011 4:49 PM

    Giuseppe Agnello wrote:
    > Sorry, there was a typo in the parameter name.
    > Word fields should start with capital F.
    > Try with Record.missingLastFields, with value "add"
    >
    > http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    >
    > Similar issue was resolved with same parameter in this thread:
    > Sender file adapter with FCC not creating last field
    That did the trick.  It was a typo.  Thanks Giuseppe.
    I'm willing to bet that this parameter was added to fix the parsing bug without breaking existing users that had already worked around the original bug.   You shouldn't really have to special case the last field.

  • Using File Content Conversion converting XML format to text format

    Hi All,
                 I am able to convert to Text format using file content conversion, But the requirement is to convert the same for the structure with additional subnodes  as in the example (also complex nested structures)
    <ns0:SendXSDEmployeeDetails xmlns:ns0="http://ehro.eds.com/FRAMEWORK/FileToFile/FileCConverion">
        <Employee>
                  <Employee_ID>2</Employee_ID>
                   <Employee_Name>KannanKumar</Employee_Name>
                     <Address>
        <Street>13th Cross Reddy</Street>
        <City>Bangalore</City>
        <Pincode>641026</Pincode>
        <Phone_No>
            <t1>9901934934</t1>
            <t2>9901934934</t2>
        </Phone_No>
    </Address>
       </Employee>
    </ns0:SendXSDEmployeeDetails>
    can any one help on this please
    I have already seen the blogs :
    /people/krishnakumar.ramamoorthy3/blog/2007/01/27/generic-mapping-to-convert-nested-xml-to-flat--receiver-file-adatper
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    <b>Can any one help to do  this in simple way</b><br>

    Hi,
    Like correctly pointed by JaiShankar, the Sender File Adapter currently does not supoort such stracutures.
    the strcuture supported is described in this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Regards
    Bhavesh

  • String utf-16 conversion

    Hello,
    I call rfc (via xi) and get result as flat xml String from r/3.
    This string contains english and hebrew characters. The english is o.k. but the value nodes in hebrew looks like " &#1523; &#1523;&#65533;&#1523;™ &#1523;&#65533;&#1523;™&#1523; &#1523;™&#1523;&#65533;&#1523;¨&#1523;&#1523;˜/&#1523;™&#1523;’&#1523;&#65533;&#1523;&#65533; "
    how can i convert the string in order to see my language characters?
    I think the source unicode is utf-8, and i need to convert it to utf-16 but i'm not sure about that nor how to do that.
    Thanks for your help.
    Roni.

    Hi Roni,
    If your RFC returns an XML file as a java.lang.String object, the String itself is by definition UTF-16. To see if the XML file is correct, you could write it to disk and open it with your favourite text editor. Something like this.
    private void save(String xml) throws IOException {
      OutputStream out = new FileOutputStream(new File("/tmp/result.xml"));
      out.write(xml.getBytes("UTF-8"));
      out.close();
    Or whatever supported encoding you like and that's supported by your text editor, e.g. ISO-8859-8 is Latin/Hebrew Alphabet; see http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html
    Obviously, to correctly see the characters you need the necessary fonts too.
    In case the above doesn't work, it means the xml String you receive from the RFC call is already corrupt. However, if it does work, the RFC as such works correctly.
    The next step is likely to parse the XML to extract the information you need and store it in your Web Dynpro context. An XML parser usually expects bytes (a java.io.InputStream) as input, which means you need to convert the String to bytes and by doing that, you need to choose a character encoding. It could be something like the following.
    SAXParserFactory.newInstance().newSAXParser().parse(new ByteArrayInputStream(xml.getBytes("UTF-8")), handler);
    Note that the character encoding you specify here does make a difference. It should be the same, in order not to "confuse" the XML parser, as defined in the XML file's document type declaration, e.g. <?xml version="1.0" encoding="UTF-8"?>
    BTW, what exactly do you do with the received XML to obtain the value nodes?
    Kind regards,
    Sigiswald

Maybe you are looking for