XML Parser - Character Encoding

Hi,
I am trying to parse a XML document containing Korean characters. Using XSL stylesheet to generate HTML output in Java Servlet.
How can i do to make it work?
I'm using WintNT with IIS - ServletExec3.1 for servlet engine.
Here's the error messages...
java.io.UTFDataFormatException: Invalid UTF8 encoding
at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:65)
at oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(XMLUTF8Reader.java:162)
at oracle.xml.parser.v2.XMLUTF8Reader.fillLastBuffer(XMLUTF8Reader.java:142)
at oracle.xml.parser.v2.XMLByteReader.fillByteBuffer(XMLByteReader.java:300)
at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:108)
at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:277)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:163)
Thanks...
TN
null

Yes, I did.
I tried with:
1. encoding="EUC-KR"
2. encoding="IOS2022KR"
3. encoding="UTF-8"
4. and some ...
but it still return the same error.
Any ideas,
Thanks,
Tuan
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by oracle xml team:
Have you set your encoding in the header of xml file?<HR></BLOCKQUOTE>
null

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

  • XML Server character encoding

    Hi, I'm using the proxy generated by UDS for XML Server published service object. I have some problems with strings return types with some locales ( e.g:spanish ).
    How can I set the XML Server response character encoding to avoid this problem?

    This tech note will help:
    http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsunone%2F7717&zone_110=7717%2A%20
    ka

  • XML export character encoding bug

    I've found a bug with Final Cut Pro XML export for any projects where media has a "#" in the name. Premiere Pro passes the "#" character into the file pathname instead of encoding it as "%23". The result is any clips with names such as "clip #1", "clip #2", "clip #3", etc. will be broken whe the XML is imported by another application. Compare:
    Premiere Pro XML (does not work):
    <pathurl>file://localhost/Volumes/P50%20Production%20Drive%202/CNMT%202011-12/CNMT%202011- 12%20Final%20Cut%20Pro%20Documents/Mom%20is%20Never%20Wrong/
    CNMT_MomNeverWrong_Street_12_14_11/Clip%20#2.mov</pathurl>
    Final Cut Pro XML (works properly):
    <pathurl>file://localhost/Volumes/P50%20Production%20Drive%202/CNMT%202011-12/CNMT%202011- 12%20Final%20Cut%20Pro%20Documents/Mom%20is%20Never%20Wrong/
    CNMT_MomNeverWrong_Street_12_14_11/Clip%20%232.mov</pathurl>
    Note the difference in the clip name. A global search and replace of "#" with "%23" makes the Premiere Pro XML work properly.
    This bug is easily repeatable and verifiable. I've filed a bug report but wanted to post here just to give folks a heads up.
    Thanks for your help!
    --dhl

    This tech note will help:
    http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsunone%2F7717&zone_110=7717%2A%20
    ka

  • Adobe Designer 7.0 - XML parsing error when data connection to XML with UTF-16

    Hi all
    <br />
    <br />I need to change my data connection xml file to use UTF-16 instead of ISO-8859-1. When I connect the file with the UTF-16 encoding, I receive the following error
    <br />
    <br />Invalid XML: Xml parsing error: encoding specified in XML declaration is incorrect (error code 19) ..
    <br />
    <br />The XML declaration is:
    <br /><?xml version="1.0" encoding="utf-16"?>
    <br />
    <br />I am able to succesfully set the encoding to "UTF-8". UTF-16 should also be possible.
    <br />
    <br />Has anyone seen this error before ? How can I resolve this ?
    <br />
    <br />Thanks in advance
    <br />
    <br />Bilal Haniff

    Thank you, expert, for your quick reply.
    Described problem got solved: we noticed later that the extra text only appears for users using Adobe professional 7.0, 'normal' users with adobe 8.0 reader don't get the extra text, so that is ok for us.

  • XML parser not detecting character encoding

    Hi,
    I am using Jdeveloper 9.0.5 preview and the same problem is happening in our production AS 9.0.2 release.
    The character encoding of an xml document is not correctly being detected by the oracle v2 parser even though the xml declaration correctly contains
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    instead it treats the document as UTF8 encoding which is fine until a document comes along with an extended character which then causes a
    java.io.UTFDataFormatException: Invalid UTF8 encoding.
    at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:160)
    at oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(XMLUTF8Reader.java:187)
    at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:120)
    at oracle.xml.parser.v2.XMLByteReader.saveBuffer(XMLByteReader.java:448)
    at oracle.xml.parser.v2.XMLReader.fillBuffer(XMLReader.java:2023)
    at oracle.xml.parser.v2.XMLReader.tryRead(XMLReader.java:972)
    at oracle.xml.parser.v2.XMLReader.scanXMLDecl(XMLReader.java:2589)
    at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:485)
    at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:192)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:144)
    as you can see it is explicitly casting the XMLUTF8Reader to perform the read.
    I can get around this by hard coding the xml input stream to be processed by a reader
    XMLSource = new StreamSource(new InputStreamReader(XMLInStream,"ISO-8859-1"));
    however the manual documents that the character encoding is automatically picked up from the xml file and casting into a reader is not necessary, so I should be able to write
    XMLSource = new StreamSource(XMLInStream)
    Does anyone else experience this same problem?
    having to hardcode the encoding causes my software to lose flexibility.
    Jarrod Sharp.

    An XML document should be created with 'ISO-8859-1' encoding to be parsed as 'ISO-8859-1' encoding.

  • XML Parsing attributes with encoded ampersand causes wrong order

    Hi all,
    I am writing in the forum first (because it could be that i am doing something wrong.... but i think it is a bug. Nonetheless, i thought i'd write my problem up here first.
    I am using Java 6, and this has been reproduced on both windows and linux.
    java version "1.6.0_03"
    Problem:
    read XML file into org.w3c.dom.Document.
    XML File has some attributes which contain ampersand. These are escaped as (i think) is prescribed by the rule of XML. For example:
    <?xml version="1.0" encoding="UTF-8"?>
         <lang>
              <text dna="8233" ro="chisturi de plex coroid (&gt;=1.5 mm)" it="Cisti del plesso corioideo(&gt;=1.5mm)" tr="Koro&#305;d pleksus kisti (&gt;=1.5 mm)" pt_br="Cisto do plexo cor&oacute;ide (&gt;=1,5 mm)" de="Choroidplexus Zyste (&gt;=1,5 mm)" el="&Kappa;&#973;&sigma;&tau;&epsilon;&iota;&sigmaf; &chi;&omicron;&rho;&omicron;&epsilon;&iota;&delta;&omicron;&#973;&sigmaf; &pi;&lambda;&#941;&gamma;&mu;&alpha;&tau;&omicron;&sigmaf; (&gt;= 1.5 mm)" zh_cn="&#33033;&#32476;&#33180;&#22218;&#32959;&#65288;&gt;= 1.5 mm&#65289;" pt="Quisto do plexo coroideu (&gt;=1,5 mm)" bg="&#1050;&#1080;&#1089;&#1090;&#1072; &#1085;&#1072; &#1093;&#1086;&#1088;&#1080;&#1086;&#1080;&#1076;&#1085;&#1080;&#1103; &#1087;&#1083;&#1077;&#1082;&#1089;&#1091;&#1089; (&gt;= 1.5 mm)" fr="Kystes du plexus choroide (&gt;= 1,5 mm)" en="Choroid plexus cysts (&gt;=1.5 mm)" ru="&#1082;&#1080;&#1089;&#1090;&#1099; &#1089;&#1086;&#1089;&#1091;&#1076;&#1080;&#1089;&#1090;&#1099;&#1093; &#1089;&#1087;&#1083;&#1077;&#1090;&#1077;&#1085;&#1080;&#1081; (&gt;=1.5 mm)" es="Quiste del plexo coroideo (&gt;=1.5 mm)" ja="&#33032;&#32097;&#33180;&#22178;&#32990;&#65288;&gt;=1.5mm&#65289;" nl="Plexus choroidus cyste (&gt;= 1,5 mm)" />
    </lang>As you might understand, we need to have the fixed text '>' for later processing. (not the greater than symbol '>' but the escaped version of it).
    Therefore, I escape the ampersand (encode?) and leave the rest of the text as is. And so my > becomes >
    All ok?
    Symptom:
    in fetching attributes, for example by the getAttribute("en") type call, the wrong attribute values are fetched.
    Not only that, if i only read to Document instance, and write back to file, the attributes are shown mixed up.
    eg:
    dna: 8233, ro=chisturi de plex coroid (>=1.5 mm), en=&#1082;&#1080;&#1089;&#1090;&#1099; &#1089;&#1086;&#1089;&#1091;&#1076;&#1080;&#1089;&#1090;&#1099;&#1093; &#1089;&#1087;&#1083;&#1077;&#1090;&#1077;&#1085;&#1080;&#1081; (>=1, de=Choroidplexus Zyste (>=1,5 mm)Here you can see that 'en' is shown holding what looks like greek, ... (what is ru as a country-code anyway?) where it should have obviously had the english text that originally was associated with the attribute 'en'
    This seems very strange and unexpected to me. I would have thought that in escaping (encoding) the ampersand, i have fulfilled all requirements of me, and that should be that.
    There is also no error that seems to occur.... we simply get the wrong order when fetching attributes.
    Am I doing something wrong? Or is this a bug that should be submitted?
    Kind Regards, and thanks to all responders/readers.
    Sean
    p.s. previously I had not been escaping the ampersand. This meant that I lost my ampersand in fetching attributes, AND the attribute order was ALSO WRONG!
    In fact, the wrong order was what led me to read about how to correctly encode ampersand at all. I had been hoping that correctly encoding would fix the order problem, but it didn't.
    Edited by: svaens on Mar 31, 2008 6:21 AM

    Hi kdgregory ,
    Firstly, sorry if there has been a misunderstanding on my part. If i did not reply to the question you raised, I appologise.
    In this 'reply' I hope not to risk further misunderstanding, and have simply given the most basic example which will cause the problem I am talking about, as well as short instructions on what XML to remove to make the problem disappear.
    Secondly, as this page seems to be displayed in ISO 8859-1, this is the reason the xml I have posted looks garbled. The xml is UTF-8. I have provided a link to the example xml file for the sample below
    [example xml file UTF-8|http://sean.freeshell.org/java/less2.xml]
    As for your most recent questions:
    Is it specified as an entity? To my knowledge (so far as my understanding of what an entity is) , yes, I am including entities in my xml. In my below example, the entities are the code for the greater than symbol. I am under the understanding that this is allowed in XML ??
    Is it an actual literal character (0xA0)? No, I am specifying 'greater than' entity (code?) in order to include the actual symbol in the end result. I am encoding it in form 'ampersand', 'g character', 't character', 'colon' in order for it to work, according to information I have read on various web pages. A quick google search will show you where I got such information from, example website: https://studio.tellme.com/general/xmlprimer.html
    Here is my sample program. It is longer than the one you kindly provided only because it prints out all attributes of the element it looks for. To use it, only change the name of the file it loads.
    I have given the xml code seperately so it can be easily copied and saved to file.
    Results you can expect from running this small test example?
    1. a mixed up list of attributes where attribute node name no longer matches its assigned attribute values (not for all attributes, but some).
    2. removing the attribute bg from the 'text' element will reduce most of these symptoms, but not all. Removing another attribute from the element will most likely make the end result look normal again.
    3. No exception is thrown by the presence of non xml characters.
    IMPORTANT!!! I have only just (unfortunately) noticed what this page does to my unicode characters... all the the international characters get turned into funny codes when previewed and viewed on this page.
    Whereas the only codes I am explicitly including in this XML is the greater than symbol. The rest were international characters.
    Perhaps that is the problem?
    Perhaps there is an international characters problem?
    I am quite sure that these characters are all UTF-8 because when I open up this xml file in firefox, It displays correctly, and in checking the character encoding, firefox reports UTF-8.
    In order to provide an un-garbled xml file, I will provide it at this link:
    link to xml file: [http://sean.freeshell.org/java/less2.xml]
    Again, sorry for any hassle and/or delay with my reply, or poor reply. I did not mean to waste anyones time.
    It will be appreciated however if an answer can be found for this problem. Chiefly,
    1. Is this a bug?
    2. Is the XML correct? (if not, then all those websites i've been reading are giving false information? )
    Kindest Regards,
    Sean
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class Example
        public static void main(String[] argv)
              try
                   FileInputStream fis = new FileInputStream("/home/sean/Desktop/chris/less2.xml");
                 Document doc = DocumentBuilderFactory.newInstance()
                 .newDocumentBuilder()
                 .parse(new InputSource(fis));
                   Element root = doc.getDocumentElement();
                   NodeList textnodes = root.getElementsByTagName("text");
                   int len = textnodes.getLength();
                   int index = 0;
                   int attindex = 0;
                   int attrlen = 0;
                   NamedNodeMap attrs = null;
                   while (index<len)
                        Element te = (Element)textnodes.item(index);
                        attrs = te.getAttributes();
                        attrlen = attrs.getLength();
                        attindex = 0;
                        Node node = null;
                        while (attindex<attrlen)
                             node = attrs.item(attindex);          
                             System.out.println("attr: "+node.getNodeName()+ " is shown holding value: " + node.getNodeValue());
                             attindex++;                         
                        index++;
                        System.out.println("-------------");
                 fis.close();
              catch(Exception e)
                   System.out.println("we've had an exception, type "+ e);
    }  [example xml file|http://sean.freeshell.org/java/less2.xml]
    FOR THE XML, Please see link above, as it is UTF-8, and this page is not. Edited by: svaens on Apr 7, 2008 7:03 AM
    Edited by: svaens on Apr 7, 2008 7:23 AM
    Edited by: svaens on Apr 7, 2008 7:37 AM
    Edited by: svaens on Apr 7, 2008 7:41 AM

  • Character Encoding in XML

    Hello All,
    I am not clear about solving the problem.
    We have a Java application on NT that is supposed to communicate with the same application on MVS mainframe through XML.
    We have a character encoding for these XML commands we send for communication.
    The problem is, on MVS the parser is not understaning the US-ASCII character encoding. And so we are getting the infamous "illegal character error".
    The main frame file.encoding=CP1047 and
    NT's file.encoding = us-ascii.
    Is there any character encoding that is common to these two machines: mainframe and NT.
    IF it is Unicode, what is the correct notation for it.
    Or is there any way for specifying the parsers to which character encoding should be used.
    thanks,
    Sridhar

    On the mainframe end maybe something like-
    FileInputStream fris = new FileInputStream("C:\\whatever.xml");
    InputStreamReader is= new InputStreamReader(fris, "ASCII");//or maybe "us-ascii" "US-ASCII"
    BufferedReader brin = new BufferedReader(is);
    Or give inputstream/buffered reader to whatever application you are using to parse the xml. The input stream reader should allow you to set your encoding even if the system doesnt have the native encoding. Depends though on which/whose jvm using you are using jdk1.2 at least supports following on this page http://as400bks.rochester.ibm.com/pubs/html/as400/v4r4/ic2924/info/java/rzaha/javaapi/intl/encoding.doc.html

  • XML Parser and Content-type/encoding problem

    I've write a little and simple XML parser and a simple "trasformer" that recive an XML file and an XSL one and return HTML, here is the code:
    public static String toHTML(Document doc, String xslSource){
            ByteArrayOutputStream testo = new ByteArrayOutputStream();
            try{
                DOMSource source = new DOMSource(doc);
                TransformerFactory tFactory = TransformerFactory.newInstance();
                System.out.println("----> " + xslSource);
                Transformer transformer = tFactory.newTransformer(new StreamSource(xslSource));
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
                transformer.setOutputProperty(OutputKeys.METHOD, "html");
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
             transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.transform(source, new StreamResult(testo));
            }catch(Exception ioe){
                System.out.println("2 XMLTool.toHTML " + new java.util.Date());
                System.out.println(ioe);        
            return testo.toString();
        }the problem is that I would like to put the HTML code its return into a JEditorPane; now I'm trying with this code:
    JEditorPane jep1 = new JEditorPane();
    jep1.setContentType("text/html");
    jep1.setText(v);
    // 'v' is the string returned by the code posted up (the XML/XSL transformer)but I can't see anything in my JEditorPane.
    I think that the problem is this line of code that the transformer add automaticaly ad HTML code:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">Infact if I try to delete this line from the code I can see what I want but is'n good delete a line of code without understend where is the problem.
    So, can anyone help me?

    good.
    when u set ur output properties to html , transformer
    searches for all entity references and converts accordingly.
    if u r using xalan these files will be used for conversion of
    Character entity references for markup-significant
    output_html.properties
    (this should be in templates package)
    and HTMLEntities.res(should be in serialize package)
    vasanth-ct

  • Deserialization error: XML parsing error: Illegal XML character

    Hi All,
    Anybody knows what caused this? This error occured at the client side when the server returned an object that contains other objects to client during a jaxrpc call. It worked before, something is definitely changed, I reversed my changes but still the same.
    Please help, thanx a lot.
    [java] java.rmi.RemoteException: Runtime exception; nested exception is:
    [java] deserialization error: deserialization error: deserialization error: XML parsing error: com.sun.xml.rpc.sp.ParseException:2: Illegal XML character:
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:234)
    [java] at com.ummq.ME_Stub.getMsg(MsgExpertIF_Stub.java:1333)
    [java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    [java] at javax.swing.AbstractButton$ForwardActionEvents.actionPerforme
    d(AbstractButton.java:1817)
    [java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    [java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    [java] at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    [java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
    [java] at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mous
    eReleased(BasicMenuItemUI.java:943)
    [java] at java.awt.Component.processMouseEvent(Component.java:5093)
    [java] at java.awt.Component.processEvent(Component.java:4890)
    [java] at java.awt.Container.processEvent(Container.java:1566)
    [java] at java.awt.Component.dispatchEventImpl(Component.java:3598)
    [java] at java.awt.Container.dispatchEventImpl(Container.java:1623)
    [java] at java.awt.Component.dispatchEvent(Component.java:3439)
    [java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    [java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    [java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    [java] at java.awt.Container.dispatchEventImpl(Container.java:1609)
    [java] at java.awt.Window.dispatchEventImpl(Window.java:1585)
    [java] at java.awt.Component.dispatchEvent(Component.java:3439)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    [java] Caused by: deserialization error: deserialization error: deserialization error: XML parsing error: com.sun.xml.rpc.sp.ParseException:2: Illegal XML character:
    [java] at com.sun.xml.rpc.encoding.SOAPDeserializationContext.deseriali
    zeMultiRefObjects(SOAPDeserializationContext.java:65)
    [java] before getMsg
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:175)
    [java] ... 30 more
    [java] java.rmi.RemoteException: Runtime exception; nested exception is:
    [java] deserialization error: deserialization error: deserialization error: XML parsing error: com.sun.xml.rpc.sp.ParseException:2: Illegal XML character:
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:234)
    [java] at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1161)
    [java] at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1218)
    [java] at javax.swing.JComboBox.contentsChanged(JComboBox.java:1265)
    [java] at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
    [java] at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:88)
    [java] at javax.swing.JComboBox.setSelectedItem(JComboBox.java:551)
    [java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    [java] at javax.swing.AbstractButton$ForwardActionEvents.actionPerforme
    d(AbstractButton.java:1817)
    [java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    [java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    [java] at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    [java] at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
    [java] at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mous
    eReleased(BasicMenuItemUI.java:943)
    [java] at java.awt.Component.processMouseEvent(Component.java:5093)
    [java] at java.awt.Component.processEvent(Component.java:4890)
    [java] at java.awt.Container.processEvent(Container.java:1566)
    [java] at java.awt.Component.dispatchEventImpl(Component.java:3598)
    [java] at java.awt.Container.dispatchEventImpl(Container.java:1623)
    [java] at java.awt.Component.dispatchEvent(Component.java:3439)
    [java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    [java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    [java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    [java] at java.awt.Container.dispatchEventImpl(Container.java:1609)
    [java] at java.awt.Window.dispatchEventImpl(Window.java:1585)
    [java] at java.awt.Component.dispatchEvent(Component.java:3439)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    [java] Caused by: deserialization error: deserialization error: deserializa
    tion error: XML parsing error: com.sun.xml.rpc.sp.ParseException:2: Illegal XML character:
    [java] at com.sun.xml.rpc.encoding.SOAPDeserializationContext.deseriali
    zeMultiRefObjects(SOAPDeserializationContext.java:65)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:175)
    [java] ... 39 more

    What type of encoding are you using? Do you transform a string in an array of bytes or viceversa?
    Marco

  • XML Character Encoding Using UTL_DBWS

    Hi,
    I have a database with WINDOWS-1252 character encoding. I'm using UTL_DBWS to call a web service method which echoes a given string. For this purpose, I do the following:
    DECLARE
        v_wsdl CONSTANT VARCHAR2(500) := 'http://myhost/myservice?wsdl';
        v_namespace CONSTANT VARCHAR2(500) := 'my.namespace';
        v_service_name CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'MyService');
        v_service_port CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'MySoapServicePort');
        v_ping CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'ping');
        v_wsdl_uri CONSTANT URITYPE := URIFACTORY.getURI(v_wsdl);
        v_str_request CONSTANT VARCHAR2(4000) :=
    '<?xml version="1.0" encoding="UTF-8" ?>
    <ping>
        <pingRequest>
            <echoData>Dev Team üöäß</echoData>
        </pingRequest>
    </ping>';
        v_service UTL_DBWS.SERVICE;
        v_call UTL_DBWS.CALL;
        v_request XMLTYPE := XMLTYPE (v_str_request);
        v_response SYS.XMLTYPE;
    BEGIN
        DBMS_JAVA.set_output(20000);
        UTL_DBWS.set_logger_level('FINE');
        v_service := UTL_DBWS.create_service(v_wsdl_uri, v_service_name);
        v_call := UTL_DBWS.create_call(v_service, v_service_port, v_ping);
        UTL_DBWS.set_property(v_call, 'oracle.webservices.charsetEncoding', 'UTF-8');
        v_response := UTL_DBWS.invoke(v_call, v_request);
        DBMS_OUTPUT.put_line(v_response.getStringVal());
        UTL_DBWS.release_call(v_call);
        UTL_DBWS.release_all_services;
    END;
    /Here is the SERVER OUTPUT:
    ServiceFacotory: oracle.j2ee.ws.client.ServiceFactoryImpl@a9deba8d
    WSDL: http://myhost/myservice?wsdl
    Service: oracle.j2ee.ws.client.dii.ConfiguredService@c881d39e
    *** Created service: -2121202561 - oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@afb58220 ***
    ServiceProxy.get(-2121202561) = oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@afb58220
    Collection Call info: port={my.namespace}MySoapServicePort, operation={my.namespace}ping, returnType={my.namespace}PingResponse, params count=1
    setProperty(oracle.webservices.charsetEncoding, UTF-8)
    dbwsproxy.add.map: ns, my.namespace
    Attribute 0: my.namespace: xmlns:ns, my.namespace
    dbwsproxy.lookup.map: ns, my.namespace
    createElement(ns:ping,null,my.namespace)
    dbwsproxy.add.soap.element.namespace: ns, my.namespace
    Attribute 0: my.namespace: xmlns:ns, my.namespace
    dbwsproxy.element.node.child.3: 1, null
    createElement(echoData,null,null)
    dbwsproxy.text.node.child.0: 3, Dev Team üöäß
    request:
    <ns:ping xmlns:ns="my.namespace">
       <pingRequest>
          <echoData>Dev Team üöäß</echoData>
       </pingRequest>
    </ns:ping>
    Jul 8, 2008 6:58:49 PM oracle.j2ee.ws.client.StreamingSender _sendImpl
    FINE: StreamingSender.response:<?xml version = '1.0' encoding = 'UTF-8'?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><ns0:pingResponse xmlns:ns0="my.namespace"><pingResponse><responseTimeMillis>0</responseTimeMillis><resultCode>0</resultCode><echoData>Dev Team üöäß</echoData></pingResponse></ns0:pingResponse></env:Body></env:Envelope>
    response:
    <ns0:pingResponse xmlns:ns0="my.namespace">
       <pingResponse>
          <responseTimeMillis>0</responseTimeMillis>
          <resultCode>0</resultCode>
          <echoData>Dev Team üöäß</echoData>
       </pingResponse>
    </ns0:pingResponse>As you can see the character encoding is broken in the request and in the response, i.e. the SOAP encoder does not take into consideration the UTF-8 encoding.
    I tracked down the problem to the method oracle.jpub.runtime.dbws.DbwsProxy.dom2SOAP(org.w3c.dom.Node, java.util.Hashtable); and more specifically to the calls of oracle.j2ee.ws.saaj.soap.soap11.SOAPFactory11.
    My question is: is there a way to make the SOAP encoder use the correct character encoding?
    Thanks a lot in advance!
    Greetings,
    Dimitar

    I found a workaround of the problem:
        v_response := XMLType(v_response.getBlobVal(NLS_CHARSET_ID('CHAR_CS')), NLS_CHARSET_ID('AL32UTF8'));Ugly, but I'm tired of decompiling and debugging Java classes ;)
    Greetings,
    Dimitar

  • XML parser not able to find encoding format of xml file with jre1.4.2

    Hi
    I am using jre1.4.2_05 and Weblogic 8.1 version and i have a problem with finding encoding format of xml file.
    I need to parse a xml file and need to find which encoding format that xml is based on that i need to change logic.
    Need to know after parsing each xml file what encoding format the xml is? Here the problem is we are using jre1.4.2_05 by default DOM \ SAX parser is not supported and i looked at few third party parser which are also don't have facility.
    But in latest jre 1.5 or jdk1.5 has this feature. Its difficult to the project to upgrade to jre1.5 or more.
    Please let me know if you have any idea about the issue.

    I had a quick look around and I think you might be able to find them in the support portal...
    SAP Support Portal > Software Downloads > SAP Software Download Centre > Support Packages and Patches > Archive for Support Packages and Patches > Archive - Browse our Download Catalog > SAP Connectors.
    Let me know if you find them.
    Regards,
    Stephen.

  • SQL Server 2012 Management Studio: Import XML File to SQL Table - XML parsing: illegal qualified name character

    Hi all,
    In my SQL Server 2012 Management Studio, I executed the following code:
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    I got the following message:
    Msg 9455, Level 16, State 1, Line 5
    XML parsing: line 3, character 12, illegal qualified name character
    I have no ideas why the "product" in the statement "SELECT X.product.query('SKU').value('.','INT')" is not legal qualified name charcter!!!???  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Manish, Thanks for your response.
    Here is a copy of my ZenProducts.xml:
    <Products>
    <Product>
    <SKU>1<</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2<</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3<</SKU>
    <Desc>Video</Desc>
    </Product>
    I found the wrong "<<" in my xml file and changed it to the right "<" for the statement<SKU>1</sku>. I executed the corrected code and I got the following new message:
    Msg 2714, Level 16, State 6, Line 1
    There is already an object named 'Products' in the database.
    I don't know how to remove the old, existing the 'Products' object in the database and execute the corrected code again. Please kindly help, advise and tell me how to resolve this new problem.
    Many Thanks,
    Scott Chang
    P. S. I played with another project to get the 'Products' object in my database before. Frankly, I don't know where the old 'Products' object and the database are. Please enlighten me in resolving this matter more clearly.
    You welcome Scott, As Olaf mentioned in this post, there was already a table exists , so need to drop your Products table.
    Apart from this, I guess either you did not pasted the full XML file or what, I needed to have the (  </Products>)closing tag in your XML file as follows.
    <Products>
    <Product>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Product>
    </Products>
    You can use following script to drop if your 
    Products table is already existing.
    if exists(select 1 from sys.tables where name ='Products')
    drop table Products
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    Let us know if you face any other problem.
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • Getting null value while parsing "XML String" with  encoding WINDOWS-1252.

    Hi,
    when I am converting the Follwoing "xml string " to Document, I am getting the "null" as a document value.
        String strXML =  "<?xml version="1.0" encoding="WINDOWS-1252"?>
                              <category name="SearchByAttributes" value="Search By Attributes">
                                <item name="ORDER_LINE_ID" description="Application Search Attributes" >
                                   <attribute name="Sequence" value="0001"/>
                                 </item>
                                </category>"      
    My "xml string" has the encoding vaule: WINDOWS-1252.
    I am using the following code to convert the "xml string" to Document. I am getting the Document values as a "null" while converting the above "string xml"
            String strXML = //my above string xml.
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            docBuilderFactory.setIgnoringElementContentWhitespace(true);
            docBuilder = docBuilderFactory.newDocumentBuilder();
            doc = docBuilder.parse(new InputSource(new StringReader(strXML)));              
            System.out.println("doc value.."+doc)//I am getting null value for "doc".
    Can anyone help me to resolve the issue.

    Thagelapally wrote:
    I am coverting the below "XML string" to Document, once it is converted I am reading that Document,which have an "attribue" Element in.
      String strXML = "<?xml version="1.0" encoding="WINDOWS-1252"?>
    <category name="SearchByAttributes" value="Search By Attributes">
    <item name="ORDER_LINE_ID" description="Application Search Attributes" >
    <attribute name="Sequence" value="0001"/>
    </item>
    </category>" I am using the above code to read the Document. When run the code in "OC4J Server" and using Jdeveloper as an editor,I am able to perfectly read the "attribute" element in the document with out any problem.Println statement printing as I expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."attribute"(as expected)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."oracle.xml.parser.v2.XMLAttrList@afe"But when run the same code(reading the same Document) in Tomcat and Eclipse,println satatement not printing as i expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."#text"(I am expecting output value "attribute" but it is printing "#text" which i don't know)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."null"(I am expecting output value object reference but it is printing "null"
    (without the rest of the code, i'm guessing that) most likely you are grabbing the first child node of the item element. however, you are not accounting for some text nodes that are most likely in that list, like the whitespace between the item element and the attribute element. please go read some tutorials on xml, there are thousands of them out there, and they will answer all you initial questions much more efficiently than posting each step to the forums.

  • ?xml version = '1.0' encoding = 'ASCII'? pl/sql xml parser

    When ever I parse a document which has the
    <?xml version = '1.0' encoding = 'ASCII'?> tag as the first line hangs the pl/sql xml parser . If I remove the "encoding = 'ASCII'" from the file everything works fine ! What is the problem ?
    version 8.1.6 / plsql parser v2 / hpux 11x
    Here is the input file
    <?xml version = '1.0' encoding = 'ASCII'?>
    !--- This is a comment -->
    <person>
    <employee>
    <lastname>GHANTASALA</lastname>
    <firstname>SREE</firstname>
    <age>32</age>
    </employee>
    <employee>
    <lastname>TAMATAM</lastname>
    <firstname>SATISH</firstname>
    <age>30</age>
    </employee>
    </person>
    Here is my program
    declare
    p xmlparser.parser;
    doc xmldom.DOMDocument;
    dir varchar2(100) := '/apps/oracle/drugstore';
    errfile varchar2(30) := 'err.txt' ;
    inpfile varchar2(30) := 'person.xml';
    nl xmldom.DOMNodeList;
    len number;
    n xmldom.DOMNode;
    new_node xmldom.DOMNode;
    node_name varchar2(100);
    node_value varchar2(100);
    begin
    -- new parser
    p := xmlparser.newParser;
    -- Set some characteristics
    xmlparser.setValidationMode(p, FALSE);
    xmlparser.setErrorLog(p, dir&#0124; &#0124;'/'&#0124; &#0124; errfile );
    xmlparser.setBaseDir(p, dir);
    -- parse input file
    xmlparser.parse(p, dir&#0124; &#0124;'/'&#0124; &#0124;inpfile);
    -- get document
    doc := xmlparser.getDocument(p);
    -- get all elements
    nl := xmldom.getElementsByTagName(doc, '*');
    len := xmldom.getLength(nl);
    dbms_output.put_line('Length='&#0124; &#0124;len);
    -- loop through elements
    for i in 0..len-1 loop
    n := xmldom.item(nl, i);
    node_name := xmldom.getNodeName(n);
    -- get the text node associated with the element node
    n := xmldom.getFirstChild(n);
    if xmldom.getNodeType(n) = xmldom.TEXT_NODE then
    node_value := xmldom.getNodeValue(n);
    if node_name='lastname' then
    dbms_output.put_line('The value you are looking for is -->:'&#0124; &#0124;node_value);
    if node_value = 'GHANTASALA' then
    xmldom.setNodeValue(n,'TEST2');
    end if;
    end if;
    end if;
    end loop;
    new_node := xmldom.makeNode(doc);
    xmldom.writeToFile(new_node, dir &#0124; &#0124;'/'&#0124; &#0124;'mod.xml');
    end ;
    null

    The encoding header is actually generated by
    by the following piece of code in my pl/sql program .
    new_node := xmldom.makeNode(doc);
    xmldom.writeToFile(new_node, dir &#0124; &#0124;'/'&#0124; &#0124;'mod.xml');
    Since this is a document created by the pl/sql parser, I assume there is some meaning to it !
    Also why is it hanging ? PL/sql parser should tell me that it is not a valid string !

Maybe you are looking for

  • Front Row is GONE!! Why, Front Row, why?!

    I haven't used Front Row in a long time (I lost my remote, oops), but on my recent trip home I found my remote again. When I used it on my MacBook, it worked fine. Suddenly though, it controls iTunes and the volume of the computer but hitting menu do

  • Javascript form.submit() fails when imbeded in table

    Before updating this worked fine, but now version 3.6.12 is failing to respond to javascript form.submit() inside a html select option control! Operating system is Windows 7 The problem seems to be, because the form is imbeded inside a table. Interne

  • Material Split Valuation Error

    Hi, We have recently implemented ECC 5.0 version of SAP. In case of certain material we are tracking value based on split valuation. In case of one material the code was opened without activating valuation category, subsequently we tried to activate

  • Service Pricing schema assignment

    Dear All I've configured service pricing condition and created new Service schema in External Service Management.I have done the assignment in "Variable calculation schema for services" by assigning the new document type with new service schema. But

  • Updating an Array returned from a User Defined Query

    I have the following code in the AddRecordsToSave method of a window. I am unsure how to save a change I want to make to a field in an Array. I have tried to use LogAttr (as pointed out in my code by the >>>>>>>> characters) and am unsure if this is