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.

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

  • XML Serialization Error- While testing BAPI turned Web service

    I have a requirement to create sales order in SAP R/3 from an e-commerce site. I went through many forums suggesting "exposing FMs into Web Service". I wrapped BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT into one FM and exposed as Web Service. I did a successful test-sequence.
    When I tested the web service without giving values I got a response asking for "Sold-to Party or Ship-To Party". While testing the Web service with some values, I got the below error -
    XML Serialization Error. Object content does not correspond to Schema restrictions of type [urn:sap-com:document:sap:rfc:functions][numeric4].
    The e-commerce team tried to hit the Web service and got the below error-
    IWAB0383E Error validating parameters
    Note: Our servers does not have any ENHPacks. Only ECC 6.0.
    Please suggest what might have gone wrong and how to resolve this.
    Thanks!

    Hi Gourav Khare,
    I have created WSDL file through function module in SAP-ECC 5.0v.
    I have followed below steps:
    Crated FM (SE37)
    Crated Web-service (SE37)
    Generated WSDL file using (WSADMIN)
    And consumed WSDF file in SOAP UI (SOAP UI 4.5.2 Trailer version)
    Problem is: while consuming WSDL file in  SOAP UI I getting  ‘Serialisation failed’
    For your reference I have furnished xml string below.
    SOAP UI Input:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:rfc:functions">
    <soapenv:Header/>
    <soapenv:Body>
    <urn:YSDF_INV_PRINT_FINAL_RFC_WS_N>
    <!--Optional:-->
    <PWR_INVOICE>
    <INVOICE_SHIPPED_LINE>
    <!--Zero or more repetitions:-->
    <item>
    <POSITION1></POSITION1>
    <SALES_PART></SALES_PART>
                      <PART_DESC></PART_DESC>
    <PRICE></PRICE>
    <QUANTITY></QUANTITY>
    <CUSTOMER_TAX_NO></CUSTOMER_TAX_NO>
    <PROD_NONINVENTORY></PROD_NONINVENTORY>
    <PROD_TAXABLE></PROD_TAXABLE>
    <TAX_LEVEL></TAX_LEVEL>
    </item>
    </INVOICE_SHIPPED_LINE>
    <INVOICE_NO></INVOICE_NO>
    <ORDER_NO></ORDER_NO>
    <DATE_PRINTED></DATE_PRINTED>
    <DIV_CD></DIV_CD>
                <LAST_COST_INVOICE></LAST_COST_INVOICE>
    <DELETE_ZERO_COST></DELETE_ZERO_COST>
    <DELETE_NON_SHIPPED></DELETE_NON_SHIPPED>
    <GLOBALREF></GLOBALREF>
    <ORIGIN></ORIGIN>
    <ORIGINID></ORIGINID>
    </PWR_INVOICE>
    </urn:YSDF_INV_PRINT_FINAL_RFC_WS_N>
    </soapenv:Body>
    </soapenv:Envelope>
    SOAP UI Output:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
    <soap-env:Fault>
    <faultcode>soap-env:Client</faultcode>
    <faultstring xml:lang="en">Serialisation failed</faultstring>
    <detail>
    <n0:SimpleTransformationFault xmlns:n0="http://www.sap.com/transformation-templates">
    <MainName>/1BCDWB/WSS0130716111624448000</MainName>
    <ProgName>/1BCDWB/WSS0130716111624448000</ProgName>
    <Line>8</Line>
    <Valid>X</Valid>
    <ReferenceFault>
    <DescriptionText>Error accessing the ref. node 'INVOICE_ID'</DescriptionText>
    <RefName>INVOICE_ID</RefName>
    </ReferenceFault>
    <Caller>
                      <Class>CL_SRG_RFC_PROXY_CONTEXT</Class>
    <Method>IF_SXML_PART~DECODE</Method>
    <Positions>1</Positions>
    </Caller>
    </n0:SimpleTransformationFault>
    </detail>
    </soap-env:Fault>
    </soap-env:Body>
    </soap-env:Envelope>
    And one more things are
    I don't know the exact reason, but now the WSDL is working fine. No Idea, will it be consistent.
    No changes in import and export parameters of RFC and no change in code, even if the logic is changed it should not affect the output on SOAP UI but in my case it does.
    Wonder why all this happens, I cannot explain the exact reason technically because my RFC works fine every time, only issue is with SOAP UI.
    From SAP point of view FM is working fine, and input parameter of FM is optional, validations are done by the programming logic and it will capture the message and its details with respect to input data.
    I am not sure SOAP will work consistently and we are using ECC 5.0 most of the t-code not there like "SOAMANAGER" and all.  
    Kindly help me on this
    Thanks & Regards,
       Akshath.L.T

  • 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"

  • 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

  • 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.

  • XML Serialization

    Ok so im at a loss, can anyone point me in the right direction:
    Im trying to serialize to XML a simple object node (see below). Im using archiver
    (http://java.sun.com/products/jfc/tsc/articles/persistence/index.html) to do this.
    Heres the code im using to serialize:
        public static void main(String[] args) {
            try {
                Node n = new Node("Frying pan","N1",Node.MAIN);
                ObjectOutput os = new XMLOutputStream(System.out);
                os.writeObject(n);
                os.close();
            catch (Exception e) {
                e.printStackTrace();
        }(so Node.Main is simply an integer)
    the output:
    <JAVA-OBJECT-ARCHIVE VERSION="0.1">
    <CLASS ID="Node" NAME="SmartTicket.Server.Network.Node"/>
    <CLASS ID="Integer" NAME="java.lang.Integer"/>
    <OBJECT ID="Node0" CLASS="Node">
    <OBJECT PROPERTY="type" CLASS="Integer" VALUE="2"/>
    </OBJECT>
    </JAVA-OBJECT-ARCHIVE>
    which is close but definately no cigar: im missing group and id ("Fring pan" and "N1" respecively).
    Now it took me a while to get this far, I was just getting errors until I read that objects had to have a no args constructor, so I put one in.
    But i dont really understand this XML serialization and cant seem to find out much. I keep getting thrown around to differant things:
    SAX
    XMLEncoder
    JAXP
    X-Stream
    Archiver
    something to do with IBM that I wont download.......
    I mean is there a way to alter how the object is serialized?
    (like overriding writeObject(java.io.ObjectOutputStream out) when using .io.Serialization).
    what makes an object XMLSearializable?
    Im at a loss.
    Any links, pointing in the right direction greatly appretiated.
    Chris
    The constructors and variable of Node object (methods not shown);
        public static int HIDDEN = 1;
        public static int MAIN = 2;
        private String group;
        private final String idSt;
        private int type;
        private Vector leavingEdges;
        private Vector incomingEdges;
        public Node(String group, String idSt, int type) {
            this.group = group;
            this.idSt = idSt;
            this.type = type;
            this.leavingEdges = new Vector();
            this.incomingEdges = new Vector();
        public Node(String group,String name) {this(group,name,HIDDEN);}
        public Node(String st, int type) {this(st,st, type);}
        public Node(String name) {this(name,name,HIDDEN);}
        public Node() {this("test","test",HIDDEN);}

    Further investigation by me shows that I was way off the mark and should have been using XMLEncoder/XMLDecoder. This right?
    Well I got things half working, can't quite seem to get the hang of these PersistenceDelegate methods.
    How exactly should JavaBeans be constructed? I can't seem to find aclear definition anywhere.
    In my objects I dont have and I dont want to add get/set methods for each field. Yet even if I give the defaultPersistenceDelegate the field names of the main constructor I get erros when reading the file:
    unknown method Edge.new(Node0)
    where Edge is indeed my object but at no point have I ever said that its constructor takes 1 argument.
    I've looked through the code for defaultPersistenceDelegate and I can't see a reason why it would reduce the number of constructor parameters than those I gave it.
    Where am I going wrong?
    Also the whole Beans concpet always seesm geared towards GUI applications, am I looking at the wrong thing if i just want to store normal data as XML?
    Any pointers?
    Thanks
    Chris

  • Service error - ECC_EMPTIMSHEETCHGRC - XML Serialization Error

    I am not able to execute the service - EmployeeTimeSheetChangeRequestConfirmation_In (http://<host:port>/sap/bc/srt/xip/sap/ECC_EMPTIMSHEETCHGRC?sap-client=<number>&wsdl=1.1&mode=sap_wsdl) in the discovery system.
    I am getting the following error - XML Serialization Error. Object content does not correspond to Schema restrictions of type [http://sap.com/xi/EA-HR/SE/Global][/wsdl:definitions/wsdl:types/xsd:schema[2]/xsd:complexType[48]/xsd:simpleContent/xsd:extension/xsd:attribute[2]/xsd:simpleType].
    Procedure followed :
    WSADMIN -> execute the service.
    Pass the following values to create a new record for a employee.
    Action code (02),
    Work Agreement ID,
    External ID,
    item-> Category code,
    Price -> Amount,
    price -> base Quantinty
    Full Working day indicator,
    Employee time validity,
    Quantity,
    Amount,
    Employee Time ID,
    Employee Time item ID,
    Sending Cost Center,
    Activity Type,
    Receiving cost center,
    Receiver WBS element,
    Weekday indicator.
    Start date and end date
    Please specify, why I am not able to execute the same.
    I have already gone through the ES Workplace -> service details.
    Kindly help.
    - anto

    This was resolved through a ticket. Error caused due to incompatible values or not skipping the relevant nodes. (Error raised due to poor documentation. The mandatory values specified were not required. on not passing the said mandatory values, the service works fine ).

  • 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.
    }

  • XMLEncoder usage for Java to XML Serialization

    I have recently started using XMLEncoder and XMLDecoder to perform Java Bean to XML Serialization and Deserialization. It seems to break when multiple threads are using XMLEncoder, even if each Thread is using a separate instance of XMLEncoder. I was initially seeing NullPointer exception and after obtaining a fix for that IBM Support, we are seeing various other exceptions like this.
    java.lang.IllegalAccessException: Can not call newInstance() on the Class for java.lang.Class
    java.lang.Exception: discarding statement XMLEncoder0.writeObject(TestObject0);
    java.lang.Exception: discarding statement XMLEncoder0.writeObject(TestObject0);
         at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:352)
         at java.beans.XMLEncoder.writeObject(XMLEncoder.java:266)
         at test.XMLEncoderIssue.run(XMLEncoderIssue.java:59)
         at java.lang.Thread.run(Thread.java:570)
    Caused by: java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();
    java.lang.ArrayIndexOutOfBoundsException: 0
    at java.beans.ObjectHandler.dequeueResult(XMLDecoder.java:285)
    at java.beans.XMLDecoder.readObject(XMLDecoder.java:163)
    at test.XMLEncoderIssue.run(XMLEncoderIssue.java:75)
    at java.lang.Thread.run(Thread.java:570)
    What am i missing here?

    Just add an empty constructor in your class

  • XML serialization vs. normal serialization

    Hey all,
    Great to see the forums in use! :) One thing I've never been quite clear on -- when does it make sense to use Coherence's XML serialization vs normal object serialization? Any tips would be appreciated.
    Thanks,
    Matt

    To clarify, we have XmlSerializable, which uses XML as a wire format, and ExternalizableLite, which uses DataOutput instead of ObjectOutput, which is significantly less costly (but has less features, such as graph traversal). XmlBean, XmlDocument, etc. all implement both XmlSerializable and ExternalizableLite now. Coherence gives priority to ExternalizableLite because of its efficiency (size and speed) so anything implementing this interface will have its wire format be the ExternalizableLite result.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!

  • 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.

  • 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

  • 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.

  • Sample ruby XML serialization code ?

    Does anybody have some sample ruby code to interface with the ACS4 server ? We are specifically interested by the XML serialization code and the generation of an hmac signature.
    Any help or pointer would be greatly appreciated.
    Thanlks!
    Eljay

    Sorry
    Diffrent versions of the JVM. A save game from J2SE
    1.4.2 might not work when the user upgrades to
    J2SE 1.5.Oh, OK. Thanks for clarifying things.
    >
    It also might fail if you change the internal
    structure of your saved classes.
    (as of yet I've heard of any problems, but this is the
    reason Sun give for using XML instead of
    Serialization)Sounds like a tradeoff . . . increased flexibility at the expense of increased complexity.
    >
    You might want to look into Externalization as well.Hmm, this makes things a bit more complex.
    What I did for my games was take String equivalents for all
    information I needed for a saved game and put them all together
    separated by spaces. Sounds like a good idea. A revised version of this idea might work.

Maybe you are looking for

  • Creating a Report with Formula

    Hi All, I want to make a report which will show something like that- Vendor_Name_ Branch_Name No_of_times Down_time_duration Agrabad Branch 1 0 Day -12 Hr -0 Min Laldighirpar Branch 2 0 Day -0 Hr -1 Min Moulvi Bazar Branch, Dhaka 3 1 Day -1 Hr -0 Min

  • I havent had a signal for 12 hours

    My Iphone 4s has totally lost its signal and has been like that for 12 hours. I have tried switching it off and on, cleaned the sim card. and have also contacted my network provider to which they say its the phone and not the sim. Any ideas???

  • Install itunes without bonjour or apple mobile device support

    For my company having bonjour is not an option and is considered a security threat,even after uninstalling bonjour it still appears in the registry. Therefore it was nessesary to put on our company server the msi file for itunes. To install itunes WI

  • Why is iPhoto Library growing?

    The iPhoto library on my iMac has grown from about 6000 pictures to over 26,000!  It seems that many "face thumbnails" have been created although there also seems to be many duplicates. I have never used "Find faces." I have searched all drives and f

  • Creating Info Objects

    Hi, I have some datasources and each datasource has 100's of infoobjects. I wan create in mass but the tcode ctbw_metadata does not work for BI.7 datasources i guess. i also thought of using excel with abap program but for that i again have do manual