Character reference in Apache xml serializer

Hi,
I am having some issues with XML serializer while having control characters in the String.
The control characters are getting converted to character reference in apache XML serializer.
Could anyone help me to disable the control characters getting converted to character reference?
or Do we have anyway to suprees/remove these control characters?
Could anyone please help us on this issue?
Thanks a lot!!!
Rajkumar R.

Since this is an apache product I suggest you look at the apache documentation on the apache web site or have a look at the apache forums.
You shouldn't need to worry about control characters being converted because the reader should convert them back again. If it doesn't it is probably a bug on the readers side.

Similar Messages

  • Import org.apache.xml.serialize.*;

    .java:66: package org.apache.xml.serialize does not exist
    import org.apache.xml.serialize.*;
    ^
    i am getting this error while running a java program, which i downloaded from a open source.
    i am using J Creator.
    i suppose i need to add a class path or package.
    can anybody tell me how to do this.
    and where can i find that package.
    if i can't find that in my system, where can i get it on net.

    .java:66: package org.apache.xml.serialize does notThe org.apache.xml.serialize.* package is part of Xerces:
    http://xml.apache.org/xerces-j/
    http://xml.apache.org/xerces2-j/index.html

  • Where to download java jar file with org.apache.xml.serialize.OutputFormat?

    Dear Friends,
    I try one program, it import org.apache.xml.serialize.OutputFormat;
    but I cannot fine it after I google a while.
    where can I find and download jar file that contain this:
    org.apache.xml.serialize.OutputFormat
    I use JDK1.6
    Thanks
    sunny

    So, to clear things up, there is no org.apache.xml.serialize.OutputFormat.JAR
    OutputFormat is a class.
    As I said in my previous post if you go at the xerces project home page (here) you will find a compiled version of xerces [here - direct link -> (fool proof)|http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip]. If you extract the archive you will find a compiled jar called xerces.jar. Open that one with winrar/winzip or whatever, browse to org\apache\xml\serialize\OutputFormat.class and there you go, you have it, just link this xerces library to your project...
    PS. Try searching on Google for "Google tutorial"

  • Help on jar file for org.apache.xml.serialize.OutputFormat

    Hi all, I need help regarding on org.apache.xml.serialize.OutputFormat
    and org.apache.xml.serialize.XMLSerializer. May I know which jar files
    contain these? Thanks

    After installing jdk 1.5 the problem is now resolved and after prefexing a few of the import statements with com.sun.
    There are however some more classes as part of the Xerces 2.7.1 jar file as compared to the JWSDP 1.6 installed and this requires the xercesimpl.jar to be included in the classpath.
    Rgds,
    Seetesh

  • Org.apache.xml.serialize.XMLSerializer

    Hi,
    I am using Eclipse for Weblogic 10.3.4 (OEPE1111). I imported a j2ee project. It doesn't include xercesImpl jar. Where should I add them in? On the Java Build Path screen, there are so many options. Thanks!

    I added. But I got Classpath Dependency Validator Message warning. Is it normal? I just ignore those?
    I have log4j for every projects. Do I have to add it for each? Is there an easier way to do?
    Thanks!

  • Which jar file has the org.apache.xml.serialize.*

    classes ?

    found here
    C:\bea\jrockit81sp1_141_03\console\lib\xercesImpl.jar
    and
    also C:\bea\weblogic81\workshop\lib\xerces.jar

  • XML Serializer....!

    Hi guys...!
    I'm writting a program in Java that prints out the content of an XML file. I imported different classes, but some of the class that I imported do not work. I don't know why.
    Since some of the classes do not work, I can't compile my java program.
    Here are the classes that give me error....
    import org.apache.xml.serialize; .============> ERROR
    import org.apache.xml.serialize.OutputFormat; ===========> ERROR
    import org.apache.xml.serialize.Serializer; ===============>ERROR
    import org.apache.xml.serialize.DOMSerializer; ===========>ERROR
    import org.apache.xml.serialize.SerializerFactory; =========>ERROR
    import org.apache.xml.serialize.XMLSerializer; ===========>ERROR
    and here are the codes that don't compile within my java program..
    OutputFormat format = new OutputFormat (doc); ==========>ERROR
    StringWriter stringOut = new StringWriter ();
    XMLSerializer serial = new XMLSerializer (stringOut, format); ==>ERROR
    serial.serialize(doc);
    System.out.println(stringOut.toString());
    Can you guys please help me finding out what is going on in my codes????
    Any help will be appreciated...
    Thanks...
    --- Spirit_Away

    While this problem is simple to someone who's battled classpath problems many, many times, it's frustrating as hell to those who haven't.
    You have a run time classpath and a compile time classpath.
    A compile-time classpath is used by javac or your IDE to find the classes that you're referencing when your code is compiled.
    If you compile a simple class from the command-line with javac, you'd use the -classpath option to specify to the Java compiler where it needs to look to find the classes you've referenced in your class.
    If you use an IDE, you need to tell your IDE where to find the classes you're referencing in your class -- each IDE does this slightly differently. In Eclipse, it's referred to as your "build path" and it contains either folders of classes or JAR files. As you add JARs or folders of classes to your build path, you make those classes available at compile time to your classes that you're compiling.
    If you manage to include those properly, you'll end up with YourClass.class -- a compiled version of your class.
    Now, to invoke your class, you need to make sure that the same classes/JARs that you put in your build path are also available to the Java Virtual Machine when you execute your class -- this is done through the CLI with the -classpath option to the java command.
    There are a few ways to get those classes in your runtime classpath.
    You can:
    a) set an environment variable called CLASSPATH which includes the JARs/class folders so that every time the jvm is invoked (e.g. prompt$ java MyClass ) those classes are included in the runtime classpath
    b) throw all of your dependent JARs/classes into $JAVA_HOME/jre/lib/ext so that anytime anyone on that machine executes the JVM, those dependent classes are included in the system-wide classpath
    c) include the JARs/class folders in the classpath argument when invoking the JVM (e.g. prompt$ java -classpath=".:HelperClasses.jar" MyClass )
    Personally, I find a) and b) to be bad ideas. Especially if you build Java apps to distribute. It makes it far too easy to forget to include dependent JARs and classes, because while they work for you on your system, they won't work on another system, unless that system also has the dependent JARs/classes installed properly in the classpath -- either for that system or the executing user.
    Another drawback is that by silently including classes in your runtime classpath, you can unknowingly create class conflicts as you can end up accidentally loading multiple copies of the same class -- sometimes different versions -- and you don't realize that the one you THINK is executing is actually not the one that ACTUALLY is.
    For this reason, I strongly suggest keeping your system class path and CLASSPATH variables empty and using option C -- until you have a strong handle on how classpaths work.
    Some people will throw all of their dependent classes/jar files into $JAVA_HOME/jre/lib/ext to avoid having to add them to their runtime classpath.
    In your case, you'd need to include the JAR files as options to the -classpath argument when you invoke the JVM.

  • Xml/serialize/XMLSerializer error in weblogic 7.0 SP6 app

    I am using weblogic 7.0sp6 and solaris 9
    We recently migrated app to another physical server but the same weblogic version.
    Once the application is deployed when we try to access that application it give us an exception.....
    java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer
    The same code/app is running successfull on the old server (solaris 9 and weblogic 7.0sp6)
    I compared the weblogic "lib" folder on both the servers and they looks identical...
    Any thoughts on why this is happening?

    We faced with the similar issue in WLS 7.X after below Assertion error after restoring services we were able to resolve this issue for time being as per the weblogic there is a patch provided by BEA and this sort of issue is resolved.
    This issue has been identified and updated under cars CR103525
    Regards,
    CSR
    BEA Analyst

  • Getting xml serializer exception

    dont know what this mean, did anybody got this exception before.
    Searched on google but got few results only which were not helpful.
    Frustrated posting this here . if anybody has seen this and resolved this , give me tips on how to get this working or atleast what could be cause of this problem.
    java.lang.NullPointerException
    at org.apache.xml.serialize.OutputFormat.whichMethod(Unknown Source)
    at org.apache.xml.serialize.OutputFormat.<init>(Unknown Source)
    at com.tibco.portalservices.administrator.AbstractDOMDeploymentDescriptorEditor.update(AbstractDOMDeploymentDesc
    riptorEditor.java:125)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.administrator.consoles.deploymentconfiguration.ServiceDetailPane.update(ServiceDetailPane.java:94)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractFrame.update(AbstractFrame.java:101)
    at com.tibco.wfc.FramesetComponent.update(FramesetComponent.java:186)
    at com.tibco.wfc.AbstractContainer.update(AbstractContainer.java:32)
    at com.tibco.wfc.AbstractFrame.update(AbstractFrame.java:101)
    at com.tibco.wfc.FrameManager.a(FrameManager.java:235)
    at com.tibco.wfc.FrameManager.service(FrameManager.java:142)
    at com.tibco.administrator.AdministratorServlet.service(AdministratorServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
    at java.lang.Thread.run(Thread.java:595)

    There is no HashMap in your ArrayList. Take a look at this line:
    selectedDataList.add(searchList);I think a object f type SearchBean is added to the list here. This is no HashMap I presume.
    Please use code tags when posting code. This looks lke this:
    public String getSelectedItems() {
    // Get selected items.
    HashMap map = new HashMap();
    DeleteContentDialog deleteContentDialog = new DeleteContentDialog();
    selectedDataList = new ArrayList();
    for (SearchBean searchList : searchResultdetails) {
    System.out.println("Inside getSelectedItems.........Inside for"+searchList);
    if (searchList.isSelected()) {
    System.out.println("Inside getSelectedItems........searchList."+searchList);
    selectedDataList.add(searchList);
    searchList.setSelected(false); // Reset.
    try {
    for(int i=0;i<selectedDataList.size();i++){
    System.out.println("Inside the delete Method");
    System.out.println("selectedDataList is "+selectedDataList.get(i));
    if (selectedDataList.size() != 0)
    System.out.println("Array List is having = "selectedDataList.size()" records");
    //printValuesTest(medianList);
    System.out.println("**************THESE ARE THE VALUES OF THE HASHMAP AT THE INDEX = "+i);
    map = (HashMap)selectedDataList.get(i);
    if (map.size() != 0)
    Iterator iterator = map.keySet().iterator();
    while (iterator.hasNext())
    String key = (String) iterator.next();
    String value = (String) map.get(key);
    System.out.println("Key = "key " and Value = "+value);
    deleteContentDialog.init(map);
    else
    System.out.println("Hashmap is empty");
    catch(Exception e){
    e.printStackTrace();
    return "deletedFile"; // Navigation case.
    }

  • Org.apache.xml

    Hi Guys,
    I'm getting the following error message when I create JAR file of my application and run:
    Caused by: java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalkerIf I execute my program from Eclipse then no error shows up. But if I create a JAR and try to run it, only then I get this error. I guess I am missing an external jar for xml. If I'm right, could you guys tell me which jar I will need and where can I find it.
    Thanks in advance.

    Hi all,
    Thanks for all of your cooperation... I think I should let you guys know about my experience(tedious !?!) so that people will be aware of this kind of error from now on....
    Here's what I found...
    The problem was not about apache jar.. The problem was with the xsl files; while I was in Eclipse environment and ran my program it easily finds all my xsl files... I was accessing those xsl file by
    Source xsltSource = new StreamSource(this.class.getResource(factorXslFileLocation).getPath()); no trouble so far....
    BUT when I packaged it as a JAR and run it... it always complain about all kind of different xml/xsltc/xalan jars..
    Then I downloaded all possible jars and added with my manifest file(xalan.jar, xercesImpl.jar, xsltc.jar,serializer.jar). Still didn't work.
    Finally I tried with the following way to access my xsl files and it worked( I had to remove all external jars from manifest file...)
    Source xsltSource = new StreamSource(this.getClass().getResourceAsStream(factorXslFileLocation)); If any one is using jre1.5 or above, then no need to add external jars for any xml or xsl stuff. I found so far what I needed is already built in there.

  • How to Improve XML Serializer Performance?

    I am writing a test program to generate an large XML data and then seralize this large XML document by SAX.
    The document structure is like this:
    <a>
    <b> 1M data </b>
    <b> 1M data </b>
    <b> 1M data </b>
    </a>
    I tried to use org.apache.xml.serialize.Serializer for the output, (using Seralizer.asContentHandler()) but found that it is very slow (it took several minutes to write out the whole document), mainly because of the characters() method designed in it.
    Any one here has any experience of using other APIs to serializer or write out of XML document? Or other ways to improve its performance?
    Or any one knows how to use xalan's Seralizer.asContentHandler() for document serialization?
    Thanks!

    The only thing I can suggest is that you direct the serializer's output to something that is buffered.

  • XML serializer problem

    I am trying to use an XML serializer to get an XML file place in an exist database and store it to the hard drive as an XML file.
    my code in order to do that is
    XMLResource documentbef = (XMLResource)r;
    doc2=(Document) documentbef.getContentAsDOM();
    doc2.normalize();
    OutputFormat format = new OutputFormat(doc2);
    format.setIndenting(true);
    XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlRoomCopy.xml")), format);
    serializer.serialize(doc2); i have included the needed jar files, and did the imports. but i get the following errors
    symbol  : constructor OutputFormat(org.w3c.dom.Document)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormatand
    symbol  : method setIndenting(boolean)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
    format.setIndenting(true);
    symbol  : constructor XMLSerializer(java.io.FileOutputStream,org.apache.xerces.domx.XGrammarWriter.OutputFormat)
    location: class org.apache.xml.serialize.XMLSerializer
    XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlRoomCopy.xml")), format);i'm new at this so I could have done the dumbest mistake.
    thank you

    Hi.
    Check this:
    drop type msm force;
    drop type list_msm force;
    create type msm as object(
    nume VARchar2(20)     --VARCHAR2 NOT CHAR
    create type list_msm as table of msm;
    create table produse
    den char(20)
    INSERT INTO produse VALUES('Prod.1');
    INSERT INTO produse VALUES('Prod.2');
    INSERT INTO produse VALUES('Prod.3');
    COMMIT;
    select xmlserialize (document xmlelement("values",
    cast(multiset(
    select trim(p.den) from produse p) as list_msm
    ) as clob indent size=2
    ) as "xml"
    from dual;
    <values>
      <LIST_MSM>
        <MSM>
          <NUME>Prod.1</NUME>
        </MSM>
        <MSM>
          <NUME>Prod.2</NUME>
        </MSM>
        <MSM>
          <NUME>Prod.3</NUME>
        </MSM>
      </LIST_MSM>
    </values>Hope this helps.

  • LPX-00217 invalid character error - Using reference characters in XML file

    Hi, I hope you will help me to understand and to fix the error I get during insert of an XML file into a table with XML Type field.
    I used Oracle documentation for this:
    1. Create table
    CREATE TABLE XMLDOC
    ( XMLCOLUMN xmltype);
    2. Create external directory
    CREATE OR REPLACE DIRECTORY FILESDIR AS 'E:\ora_xml_test\';
    3. Create function
    CREATE OR REPLACE function DSS.getClobDocument(
    filename in varchar2,
    charset in varchar2 default NULL)
    return CLOB deterministic
    is
    file bfile := bfilename('FILESDIR',filename);
    charContent CLOB := ' ';
    targetFile bfile;
    lang_ctx number := DBMS_LOB.default_lang_ctx;
    charset_id number := 0;
    src_offset number := 1 ;
    dst_offset number := 1 ;
    warning number;
    begin
    if charset is not null then
    charset_id := NLS_CHARSET_ID(charset);
    end if;
    targetFile := file;
    DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    DBMS_LOB.LOADCLOBFROMFILE(charContent, targetFile,
    DBMS_LOB.getLength(targetFile), src_offset, dst_offset,
    charset_id, lang_ctx,warning);
    DBMS_LOB.fileclose(targetFile);
    return charContent;
    end;
    And now appears the problem when I use different character references - one of them are parsed by the XML parser and another -are not:
    test1.xml - Contains a charachter from Latin language -ă (&#x103)
    <?xml version="1.0" encoding="UTF-8"?>
    <ROWSET>
    <ROW
    <IDNO>1</IDNO>
    <NAME>aaa (&#x103)</NAME>
    </ROW>
    </ROWSET>
    --a semicolumn must be added after 103
    SQL> insert into XMLDOC values(xmltype(getClobDocument('test1.xml','UTF8')));
    1 row created.
    test2.xml - Contains a charachter from Cyrillic language -ш (&#x404)
    <?xml version="1.0" encoding="UTF-8"?>
    <ROWSET>
    <ROW>
    <IDNO>1</IDNO>
    <NAME>aaa (&#x404)</NAME>
    </ROW>
    </ROWSET>
    --a semicolumn must be added after 404
    SQL> insert into XMLDOC values(xmltype(getClobDocument('test2.xml','UTF8')));
    insert into XMLDOC values(xmltype(getClobDocument('test2.xml','UTF8')))
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 1028 (\u0404)
    Error at line 5
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    I am not familiar to Unicode and encoding maybe I ' missing something.
    Please help!!!

    Which database version are you using and what is the characterset used during its creation...?
    There is a lot on this forum which has been already answered / addressed but the database must support it, in other words the characterset must support it. Among others, see Re: XML-Document with special characters for instance.
    Conversion like you are doing (&#x103) is not needed.

  • RFC to JDBC - Character reference invalid XML character

    Dear all Gurus,
    I have developed a RFC to JDBC scenareo and when trying to pass data i get a error saying (sxmb_moni) - "Runtime exception occurred during application mapping com/sap/xi/tf/_MM_de_cx_xd01_va01_2_Siebel_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Character reference (&quot;&amp;#00&quot;) is an invalid XML character"
    I dont pass any blank values here & tried to pass one value(there is only one not null value in the table) to the Oracle Table again above error accurs.

    Hi,
    You can solve this problem performing following steps in your ECC system:
    1. Go to transaction sm59 and locate the RFC Destination for your PI system. Double-click to open it.
    2. Perform a "Unicode Test" using the button in top menu or pressing Ctrl+F5. The result will either say "Target is a unicode system" or "is NOT a unicode system".
    3. Go to "MDMP & Unicode" tab page and set Non-Unicode or Unicode connection mode, depending on the result of your test in step 2.
    Alternatively, you can also find your Sender Communication Channel in PI's ID and set the Unicode indicator there - it should be consistent with what is set in sm59 in your backend system.
    Hope this helps,
    Greg

  • Character reference "&#0" is an invalid XML character

    Hi When I am trying to parse the XMl using SAX , its giving me the following FATAL error
    FATAL Error while validating the XML document:
    Character reference "&#0" is an invalid XML character
    Pl shelp me to resolve this

    My xml file contains illegal char such as 0x00 0x10 am trying to
    remove them and replace them with " &#14 or &#16" he SAX parser says " &#14 or &#16" an illegal inavlid char.
    What would be the probable solution for this.
    Thanks
    Naveen
    Message was edited by:
    Naveen_Ratkal

Maybe you are looking for

  • What's considered due diligence in finding the owner?

    I found an iPhone 5 with a completelly smashed screen in a parking lo. I tried turning it on and heard nothing. It was very dusty and may have been there for some time. I put up signs around the area to try and find the owner. No one has made a corre

  • Restricting changing the status of an order

    Hello, When creating an order (tcode va01), it is possible to change the status of the object. Some of the statuses are for example:   u2022 1 Napp Not Approved u2022 2 App Approved u2022 3 Reje Rejected u2022 u2026. Is it possible to restrict people

  • Repair in safe mode 10.5.8

    Hello, so I'm having some issues; My MacBook Pro 17" dual core 2.3 w/4gb ram (A1212) running 10.5.8 started acting up. I started getting 2" gray boxes and copying program pages when the window would close or move. I assumed that my graphics card gave

  • Can't view photos or stream videos from websites on iPad 3

    When I go to a website with safari, I can't stream video or view photo galleries.  It tells me that I need adobo flash player.  That is not supported for this device.  How do I see photoographs or stream video from websites??

  • Shared components (multiple parents)

    Hi, I have posted a question in the AWT section, but it relates to Swing too, so I'm posting a link here. Please take a look: http://forum.java.sun.com/thread.jspa?threadID=786181&tstart=0 Thanks.