XML Special Character mapping

Hi,
I am new to XML.
Can anyone tell me how to map tilde(~) in XML?
My code is in Java and when ever I am using the tilde(~) for any field, its getting blank.
Thanks in Advance

Hi,
My code is encoded like this:
if (c == '<')
{filtered.append("~lt;");}
else if (c == '>')
{filtered.append("~gt;");}
else if (c == '"')
{filtered.append("~quot;");}
else if (c == '\'')
{filtered.append("~apos;");}
else if (c == '&')
{filtered.append("~amp;");}
And it has decoded like this:
xml = xml.replaceAll("~gt;", ">");
xml = xml.replaceAll("~quot;", """);
xml = xml.replaceAll("~apos;", "&apos;");
xml = xml.replaceAll("~amp;", "&");
xml = xml.replaceAll("~#13;", "&#13;");
xml = xml.replaceAll("~#10;", "&#10;");
xml = xml.replaceAll("~#16;", "%");
xml = xml.replaceAll("~#17;", "^");
xml = xml.replaceAll("~#19;", "@");
xml = xml.replaceAll("~#20;", "*");
In this way for tilde I used the following code:
if (c == '~')
filtered.append("~tilde;");
//filtered.append("~sim;");
and decoded it like
xml = xml.replaceAll("~tilde;", "&tilde;");
But in my case Tilde is getting removed.
Can you put some light in it?

Similar Messages

  • XML special character/encoding problem

    Hi
    I would like to store XML in a MSSQL database into a column with the datatype xml.
    It seems like the xml datatype in an xMII transaction allways is stored with encoding type UTF-8
    and the MSSQL xml datatype is UTF-16. This gives me some problem with special characters when inserting into the MSSQL database (in the example below is the MSSQL datatype xml):
    INSERT INTO
         VALUES
    The error returned is this:
    "com.microsoft.sqlserver.jdbc.SQLServerException: XML parsing: line 1, character 62, illegal xml character"
    If I replace the 'ä' with a normal 'a' the command executes ok.
    I am currently using a workaround that looks like this, when setting the parameter in my transaction:
    stringreplace(Local.test, " encoding=" & doublequote & "UTF-8" & doublequote, "")
    But I was hoping I could get rid of the stringreplace.
    Is there a solution / recommended way of doing this?
    Best Regards
    Simon Bruun
    Edited by: Simon Bruun on Mar 4, 2011 10:43 AM

    I solved this. I convert to Unicode UTF-8

  • Generate XML - Special Character in data causing error

    Hello,
    I have a procedure written using DBMS_XMLGEN to create xml output. A problem that I am running into is some of my data has an eacute in it. How can I code the XML to account for this and any other weird characters that may exist?
    (ie - i need to be able to specify the encoding part of ?xml version=1.0 encoding=ISO-8859-1?)
    Here is an excerpt of what i have so far...the results are fine until I run to include the data with the eacute. Then nothing is generated at all. I tried .convert, but I don't know if that's what I need, or if I am calling it correctly.
    Thanks!
    Janel
    ctx := dbms_xmlgen.newContext(rc_data);
    -- set name of root element --
    dbms_xmlgen.setRowsetTag(ctx, 'XXFA10022');
    -- set name of element separating all rows --
    -- default is ROW --
    dbms_xmlgen.setRowTag(ctx, 'G_DATA');
    -- generate XML document --
    xml := dbms_xmlgen.getXml(Ctx);
    xml := dbms_xmlgen.convert(xml, dbms_xmlgen.ENTITY_ENCODE);
    i := dbms_xmlgen.getNumRowsProcessed(ctx);
    dbms_xmlgen.closeContext(Ctx);
    apps.fnd_file.put_line(apps.fnd_file.log, 'rows processed -' || i);
    apps.fnd_file.put_line(apps.fnd_file.log, 'close');
    apps.fnd_file.put_line(apps.fnd_file.log, xml);
    apps.fnd_file.put_line(apps.fnd_file.output, xml);
    -- free clob content --
    dbms_lob.freetemporary(xml);

    No. There are no XML components that will clean up malformed XML. Your options are to go to whoever sent you that document and tell them that their XML is malformed and that in future they should not do that, or to write your own component to clean up the malformed XML. Since that would involve more work than writing a full XML parser, I don't recommend the second option.

  • Xml special character

    I have an XML formated document from an external apps that I
    cannot change looking like this:
    <?xml version="1.0" encoding="utf-8" ?>
    <row>
    <charge>3</charge>
    <duration>5</duration>
    <fdomain>1</fdomain>
    <from>"Allibaba"<sip:[email protected]>;tag=169e3f2c</from>
    <fuser><fuser />
    <start>1167420888.001000</start>
    <tdomain>1</tdomain>
    <to>"John Blaire"
    <sip:4162595623@localhost></to>
    <tuser>80</tuser>
    </row>
    Reading and outputing this XML is giving me :
    3
    5
    1
    "Allibaba";tag=169e3f2c
    1167420888.001000
    1
    "John Blaire"
    80
    Wen I would like to get:
    3
    5
    1
    "Allibaba" 18002633394
    1167420888.001000
    1
    "John Blaire" 4162595623
    80
    The Parsing is removing <> but in 2 case I need to
    extract the number followed by <sip: and before @ and remove all
    the rest
    Is this possible and how?

    Before you process the xml, strip it
    <cfset regXML =
    "\<sip\:[0-9]*\@sip\.\host\.ca\>\;tag\=[A-Za-z0-9]*">
    <cfset newXML = REReplaceNoCase(myXML,regXML,"","all")>

  • Handle special character in mapping

    Hi Experts,
    I have requirement to handle special character in mapping.
    ö this tiny special charcter comes in I/O file and we cant avoid.
    Refering the given blog:  http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    FILE --- XI --- FILE where Source and target structures are same, using 1:1 mapping with FCC at both the side..
    Input/Output files consist of special charcters ö due to which getting error in mapping.
    Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x13(:main:, row:8237, col:22) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x13(:main:, row:8237, col:22) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:157) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java(Compiled Code))
    Do we required Java mapping? Is there any other way to acheive wtihout using Java mapping?
    How can we hadle in mapping?
    Sameer

    ö this tiny special charcter comes in I/O file and we cant avoid.
    Refering the given blog:  http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    What has an ö to do with an ampersand?
    Assign the correct encoding to the file adapter channel.

  • Special character in receiver xml

    Dear All,
    I have a file being moved from SAP to Market end point server. The receiver side is in xml format (no FCC)
    Code page conversion is used - UTF8 TO UTF16LE
    A special character is occurring in the receiver side: [] It is actually new line character and I suupose due to incompatibility it is coming.
    How do we get rid of this character?
    Thanks

    Hi,
    What Kind of mapping do you use? I have explored this behaviour in a XSLT Mapping and i resolved it by using <xsl:strip-space element = "*" />
    Maybe this help?
    Regards,
    Björn

  • Error in XSLT Mapping when special character is passed through

    Hi Experts,
    We have used the XSLT mapping. When ever any special character like é is being passed, then the below mentioned error is displayed in the Integration engine.
    Error occurred during XSLT mapping of the application
    It is working fine with normal case if we are not sending any special character.
    I am not sure whether the problem exists in XSLT mapping or the issue with the legacy system?
    Early response would be highly appreciated and points will be awarded.
    Thanks in Advance,
    Jitender

    hi,
       [Problem in transforming XML to string using XSLT;
    Chk the above link.might solve ur issue.
    Regards.
    Siddhesh Naik

  • Special Character being replaced by Question Marks in Java Mapping

    Hi All,
    I need some help on Java Mapping related to special characters.
    The problem is that i'm using a Java Mapping to add some information to the XML inside the Interface Mapping. This works fine on our development environment but, in our production environment, it replaces the special character with question marks (eg.: á --> ??).
    I'm suspecting of some configuration on the Java Virtual Machine that sets the encoding, but i don't have access to it. Does anyone have any clues about this problem?
    Thanks a lot,
    Leonardo

    Hi Leonardo
    Have a look at this forum thread, this might help you to solve your problem.
    Java Map Causing error because of ampersand &

  • Xml publisher reprot - special character problem

    I invoice report through xml publisher. I have '&' special character in vendor list. I am getting below error
    A semi colon character was expected. Error processing resource.
    Below is the code
    CREATE OR REPLACE PACKAGE BODY XML_RPT AS
        FUNCTION XML_TAG (p_tag IN VARCHAR2, p_data IN VARCHAR2) RETURN VARCHAR2 IS
        l_ret_str VARCHAR2(5000);
        BEGIN
            l_ret_str := '<'||p_tag||'>'||p_data||'</'||p_tag||'>';
            RETURN l_ret_str;
        END XML_TAG;
         PROCEDURE VENDOR(errbuf          OUT  VARCHAR2,
                         retcode         OUT  NUMBER) IS
        CURSOR inv_Cur  IS
            select pv.vendor_name          
            from po_vendors pv;        
         xmldata            varchar2(1000);
         l_sqlstr           varchar2(1000);
         l_seqnum           varchar2(3);
         l_vendor_name      varchar2(100);
        BEGIN
          xmldata := '<?xml version="1.0" encoding="UTF-8"?>';     
          xmldata :=xmldata|| '<VENDOR>';
          xmldata := xmldata||' <LIST_VENDOR>';
          fnd_file.put_line(fnd_file.output,xmldata);    
          FOR rpt_rec IN inv_Cur LOOP
              xmldata := '<VENDOR_REC>';
              l_vendor_name := replace(rpt_rec.VENDOR_NAME,'&','&amp');         
              xmldata := xmldata || XXMCG_XML_TAG('VENDOR_NAME',L_VENDOR_NAME);
              xmldata :=xmldata|| '</VENDOR_REC>';
              fnd_file.put_line(fnd_file.output,xmldata);
          END LOOP;
          xmldata := '</LIST_VENDOR>';
          xmldata := xmldata||'</VENDOR>';
         fnd_file.put_line(fnd_file.output,xmldata);
        EXCEPTION
        WHEN OTHERS THEN
             fnd_file.put_line(fnd_file.log,substr(SQLERRM,1,500));
        END VENDOR;
    END XML_RPT;can any one advice.

    Duplicate post ? xml publisher report problem
    Srini

  • Need to prevent special character in generated XML file

    Hello,
    I am using E-business Suite 12.1.3 and XML version 5.6.3.
    My XML file is ending up with a special character (a Latin capital letter U with circumflex) at the end, after the final closing tag.
    Due to this the concurrent program that needs to output the XML is ending with warning.
    My XML file is produced using a PL/SQL procedure, as follows (I've simplified it):
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="UTF-8" ?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<DOCS>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LETTER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<EMP_NAME>Michaela Hart</EMP_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</LETTER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</DOCS>');
    But when I run the concurrent request that creates the output then try to view the output in Internet Explorer I get the following error:
    Invalid at the top level of the document. Error processing resource 'http://servername.domain...
    </DOCS>
    If I view the source of the page in Internet Explorer it shows a square after </DOCS> indicating the special character that has been added.
    I checked this by looking at the output file in unix (cat -v o7766582.req) and it showed up the Latin U character.
    I realise it could be to do with the character set I am using. I checked what we had on the server:
    > echo $NLS_LANG
    American_America.UTF8
    I would have thought that corresponded with the XML declaration character set but I'm not sure.
    Does anyone have any other ideas about why I have this special character, and how it could be removed?
    Thanks in advance,
    Hazel

    Hi AlexAnd,
    thanks very much for your reply.
    I'm now unable to recreate the problem since dbms_xmlgen worked. If I switch back to my previous method it works fine!
    I'm not sure your suggestion would help, as there were no special characters in the data, the special character was added after the last tag I output. I hard coded the data (as in my example) for testing purposes so there was no SQL in use and the special character was still added at the end of the XML output. But I will definitely give it a try if I get the problem again.
    I had the idea that maybe I should have been using FND_FILE.PUT rather than FND_FILE.PUT_LINE but now the error is gone I can't tell if that would have solved the problem either.
    I appreciate your input.
    Regards
    Hazel

  • Special character in XML causing the file to hit worng folder.

    I am facing program, while sending a data to a repository using SOAP XML. The file path which is needed has a special character and this is not getting identified at the target.
    here is the brief descriptio.
    1) We generate the PDF using the XML report in ERP.
    2) Using the same data, we generate SOAP XML file and send to a respoitory.
    3) Here using this SOAP XML, the PDF is generated and stored in a location which is sent in the file.
    we are sending the target path as "PO's from Customer" as below:
    '&lt;target_folder_path&gt;'||'/Documents/'||TO_CHAR(SYSDATE,'YYYY')||'/PO's from Customer'||'&lt;/target_folder_path&gt;';
    The path needed is '/Documents/2012/PO's from Customer' , but due the apostrophe, the file is hit /adadmin path.
    I have tried replcaing the special character by &apos; , but still no luck. If i remove the special characters, then the file is hitting correct path.
    But the requirement is to have '/Documents/2012/PO's from Customer' .
    Is there is a way this can be achived. Please advice.

    Is it as simple as using two single quotes between PO and s?
    '/PO''s from Customer'I can't tell from what you wrote how you are generating the value in the first place so if not correct provide more details related to whatever builds the path.

  • Special Character Restrictions for Native XML Driver

    Hi,
    I have found the following special character restrictions in the documentation:
    "Because they are handled specially by the Native XML driver, do not use the following special characters to define element types and attributes in your XML schema:u201C.u201D, u201C/u201D, u201C\u201D, u201C:u201D u201C@u201D."
    After checking the createad XML-Files in our projects that we will use for CR4E there is often a  u201C.u201D in the definition. Because this is delivered from third-party, we wish that the  u201C.u201D  will be enabled.
    In the moment we create the XSD-Files from the XML-File with XML2XSD.
    It is possible in the future?
    Best Regards
    Arnold Meier

    The changes aren't in XI Release 2, but in 2008.
    Do you still have Nha's XML data?  I edited Document_Policy, Policy_AllCoverages, Policy_Beneficiary to Document.Policy, Policy.AllCoverages, Policy.Beneficiary, then use the following code in CR4E 2.0:
    reportClientDocument reportClientDocument;
    ConnectionInfo connectionInfo;
    PropertyBag propertyBag;
    * Connect to the Java Print Engine and create a new document.
    reportClientDocument = new ReportClientDocument();
    reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
    reportClientDocument.newDocument();
    * Define connection to the XML and XSD files.
    propertyBag = new PropertyBag();
    propertyBag.put("Local XML File", "C:\\Documents and Settings\\tueda\\Desktop\\nha.xml");
    propertyBag.put("Local Schema File", "C:\\Documents and Settings\\tueda\\Desktop\\nha.xsd");
    propertyBag.put("Convert Multivalue to Table", Boolean.FALSE);
    propertyBag.put("Database DLL", "crdb_xml.dll");
    connectionInfo = new ConnectionInfo();
    connectionInfo.setAttributes(propertyBag);
    * Specify the dataset in the XML as a Table, and add to the report.
    Table table = new Table();
    table.setConnectionInfo(connectionInfo);
    table.setName("Document.Policy/Policy.Beneficiary");
    table.setAlias("Document_Policy/Policy_Beneficiary");
    reportClientDocument.getDatabaseController().addTable(table, null);
    * Save report to file C:\local_xml.rpt
    reportClientDocument.saveAs("nha_local_xml.rpt", "C:\\", ReportSaveAsOptions._overwriteExisting);
    reportClientDocument.close();
    Sincerely,
    Ted Ueda

  • Parsing xml that contains special character

    this is my xml file.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <grid_assessment>
         <chart>
              <range>5</range>
              <sharing_charging>
                   <score>3</score>
                   <label><![CDATA[SHARING &#38; CHARGING POLICIES]]></label>
    this is my java code.
              SAXParser parser = new SAXParser();
              parser.setContentHandler(this);
              parser.setErrorHandler(this);
              try
                   fis = new FileInputStream(xmlFile);
              catch(IOException ioe)
                   System.out.println( ioe.getMessage() );
              InputSource inputSource = new InputSource((InputStream)fis);
              try
                   parser.parse(inputSource);
              catch(SAXException saxe)
                   System.out.println( saxe.getMessage() );
              catch(IOException ioe)
                   System.out.println(ioe.getMessage());
    when i parse the xml file, i got an error message like this.
    org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.Stopping after fatal error: The entity name must immediately follow the '&' in the entity reference.
    is there anybody who knows how to parse the xml file that contais special character?
    i tried "&#38;" instead of "&". but it didn't work...
    please help...
    thanks in advance...

    this is my java code.
              SAXParser parser = new SAXParser();If that is javax.xml.parsers.SAXParser then your code won't compile; i suspect you might be using some non-standard parser?
              parser.setContentHandler(this);
              parser.setErrorHandler(this);These methods are deprecated.
    when i parse the xml file, i got an error message like this.
    org.xml.sax.SAXParseException: The entity name must
    immediately follow the '&' in the entity
    reference.Stopping after fatal error: The entity name
    must immediately follow the '&' in the entity
    reference.I don't; maybe it's your parser. What parser are you using, and what version?
    is there anybody who knows how to parse the xml file
    that contais special character?There is nothing more you need to do; the codeimport javax.xml.parsers.*;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.*;
    import java.io.*;
    public class CeasarKim1Parser extends DefaultHandler {
      public static void main (String[] args) {
        try {
          SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
          FileInputStream fis = null;
          fis = new FileInputStream(args[0]);
          InputSource inputSource = new InputSource((InputStream)fis);
          parser.parse(inputSource, new CeasarKim1Parser () );
        } catch(SAXException saxe) {
          saxe.printStackTrace();
        } catch(IOException ioe) {
          ioe.printStackTrace();
        } catch (ParserConfigurationException pce) {
          pce.printStackTrace();
      public void characters(char[] ch, int start, int length) {
        System.out.println(new String(ch, start, length));
    // similar implementations of the other content handler methods
    }which is basically a compilable and non-deprecated version of yours, with the file<?xml version="1.0" encoding="ISO-8859-1" ?>
    <grid_assessment>
      <chart>
        <range>5</range>
        <sharing_charging>
          <score>3</score>
          <label><![CDATA[SHARING & CHARGING POLICIES]]></label>
        </sharing_charging>
      </chart>
    </grid_assessment>does not generate any exceptions and parses the CDATA section correctly. That is using 1.4.1 and the default org.apache.crimson.jaxp.SAXParserImpl parser.
    Pete

  • Need a list of special character in XML

    Hi All,
    Could you please provide the list of the special characters in XML.
    Regards
    B.kishan

    I will assume you are asking for this
    [url http://www.w3.org/TR/REC-xml/#sec-predefined-ent]Predefined Entities
    which defines the five special characters of
    < & ' " >
    If not, you could try google with
    xml special characters
    or
    xml predefined entities
    to see what comes back.

  • Using the Alt key and numeric code from Character Map to insert special characters in Office 2010 programs

    I am used to using the ALT key and specific numbers for characters from the Character Map to place characters in Office programs like Outlook, Word, Excel. I have a new Lenovo T530 Laptop running the Windows 7 Professional Operating System. I have MS Office
    2010 Home and Business. In previous versions of Office, this feature worked first time, every time. On this machine, it is a 'no go' situation. Lenovo tech support says it is a Microsoft issue and Microsoft says it is a Lenovo issue. Either way, I'm having
    difficulty resolving the issue and getting this wonderful featrure working for me. Any suggestions and guidance would really be appreciated. Thank you. 

    Hi,
    Haven't been verified this myself, but since this feature require to use the numeric keypad to input the value, I suspect the cause of the issue is the laptop keyboard.
    To workaround this issue, try enable the numeric keypad from your laptop keyboard, normally, we can enable it by press
    Fn + Num Lock.
    After that, try insert characters again.
    Max Meng
    TechNet Community Support

Maybe you are looking for

  • What steps to I have to take when selling my iPhone?

    I am selling my iPhone 4S for the iPhone 5, and I want to make sure that all of my data is cleared from the 4S before the buyer uses it.  I see that there are a couple of options under setters to reset the phone, so what one do I choose to use?  Shou

  • IPod playlists out of order

    In iTunes, all the songs on a CD are still in the correct order and list the track numbers. But on my iPod, some albums are out of order. I checked and the iPod is not on shuffle in any way. I just browse to the artist and album, but the songs aren't

  • Problem in first request's navigation in JSF

    Hi all I want to redirect to first page of application thru faces-config. Please have look at the code flow 1. First time request comes to our Java filter, this filter forward the controle to our facelets (i.e. dispatcher.xhtml). 2. From this facelet

  • Measure daily message store usage in Unity 7.0

    Does anyone know a way to measure the daily message voulme in minutes or daily message store storage usage?

  • IMac backlight OR LED Screen Panel Problem.

    So for about 6 months now i've noticed these 'smudge marks' people have been talking about behind the glass screen in my iMac 27" which is a late 2011 model (about 13/14 months old) and was bought new fro the iMac store. Then about 6 weeks ago i star