Using kxml2 to write xmls

hi everybody i wanna read and write xmls in movile application, somebody here told me to use kxml, i downloaded kxml2 but there is no documentation about how to write xml just how to read, any link you could provide me? pleaseeeeeee or another package to use..

I'm not sure that I understand the nature of your question. You are inserting data into a spreadsheet, which is composed entirely of cells, so you have to tell Excel into which cells you want to insert your data. If you don't care which cells they go into, why not just specify (0,0)? Is there any particular reason why you don't want to specify a range?
Kind Regards,
E. Sulzer
Applications Engineer
National Instruments

Similar Messages

  • Problems while using KXML2 to parse XML file

    I have been doing a lot of reading up on the APIs of XMLPull and KXML2.
    I seem to be facing a problem which can't be solved just by reading but rather the expertise of the more experienced programmers dealing with XML parsing in J2ME.
    I know how long it takes to process an entire XML document, I just would like to parse certain parts of the document. For e.g. instead of reading the whole document, say I just want to read the first 7 items and subsequently, the next 7 items when the user clicks on the next page?
    In other words, I wish to incorporate paging. Is it possible? Or if you have an alternative solution which will not make a user wait too long, please share it!
    Can anyone help me?

    Hi,
    I passed the full path with file name to SAXParser as follow:
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser sap = factory.newSAXParser();
    XMLReader parser = sap.getXMLReader();
    sap.parse( new File(importFile) );
    // Specify that we don't want validation. This is the SAX2
    // API for requesting parser features.
    parser.setFeature("http://xml.org/sax/features/validation", true);
    // Instantiate this class to provide handlers for the parser and
    // tell the parser about the handlers
    Import handler = new Import();
    parser.setContentHandler(handler);
    parser.setErrorHandler(handler);
    // Create an input source that describes the file to parse.
    // Then tell the parser to parse input from that source
    org.xml.sax.InputSource input = new InputSource(new FileReader(importFile));
    parser.parse(input);
    Where "importFile" is : /tmp/testFile.xml

  • Write XML in specific line

    How to write XML file in specific line or specific value ? i want write selectedLayers[0].opasity OR scale in XML file in specific line (btn2)
    XML file (0000.xml)
    <xml>
              <btn1>56</btn1>
              <btn2>666</btn2>
              <btn3>23</btn3>
    </xml>                                    
    Read file
    comp = app.project.activeItem
    var config = new File ("/g/0000.xml");
                            config.open("r");
                   var xmlString = config.read();
                    var myXML = new XML(xmlString);
    comp.selectedLayers[0].opacity.setValue(parseFloat(myXML.btn1))
                   config.close();
    and how write in specific line?
    config.open("w");
    xxx = btn1 = "245"
    config.write(xxx)

    i try this
    function SaveFile() {
    config.write("<xml>\n<btn1>"+opacity.value+"</btn1>\n</xml>")
    not what I wanted but its work... and if you want array parameter, use this:
    config.write("<xml>\n<btn1>"+position.value[0]+","+position.value[1]+"</btn1>\n</xml>")

  • Problem parsing xml in J2ME (using kxml2)

    Hello.
    May someone who knows how to use kxml help me please?
    I'll try to be straight forward. (Please excuse my imperfect English)
    My xml file look something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <sample_tag1 xmlns:mysample="http://www.sample001.com/sample01schema">
    <feature name=”tag1_feature”>
         <test name=”xxxxx” id=”200” message=”Hello.”></test>
    </feature>
    <catalog name="shelf">
         <booklist name="book1" label="b1"></booklist>
         <booklist name="book2" label="b2"></booklist>
         <booklist name="book3" label="b3"></booklist>
    </catalog>
    </sample_tag1>
    And here's my code
              //http request
                   try{
                   //I can guarantee that the URL is valid
    httpConnection = (HttpConnection) Connector.open(URL);
    }catch(IOException ioe){
    ioe.printStackTrace();
                   //Create the parser
    KXmlParser parser = new KXmlParser();
    try{
                        //I use this code section to test if the xml file is properly placed in the inputStream.
    char[] tempChar = new char[500];
    isr = new InputStreamReader(httpConnection.openInputStream());
    isr.read(tempChar);
    for(int i=0; i<tempChar.length;i++){
    System.out.print(tempChar);
    //set the xml input
    parser.setInput(isr);
    //skip the "<?xml version="1.0" encoding="utf-8"?>" tag
    parser.nextTag();
    parser.require(XmlPullParser.START_TAG, null, "sample_tag1");
                        System.out.println("name : " + parser.getName());
    System.out.println("namespace : " + parser.getNamespace());
    parser.nextTag(); // ***1
    I compiled the app and run, here's the result:
    name : sample_tag1
    namespace :
    org.xmlpull.v1.XmlPullParserException: attr value delimiter missing! (position:START_TAG <feature name='http://www.sample001.com/sample01schema'>@3:15 in java.io.InputStreamReader@e938beb1)
    at org.kxml2.io.KXmlParser.exception(+47)
    at org.kxml2.io.KXmlParser.error(+45)
    at org.kxml2.io.KXmlParser.parseStartTag(+285)
    at org.kxml2.io.KXmlParser.nextImpl(+314)
    at org.kxml2.io.KXmlParser.next(+23)
    at org.kxml2.io.KXmlParser.nextTag(+24)
    at MyMidlet$ReadXML.run(MyMidlet.java:235)
    But when I comment the last line (parser.nextTag(); // ***1), here's the result:
    name : sample_tag1
    namespace :
    My code is the clone of the one in this tutorial:
    http://www.developer.com/ws/article.php/3759471
    where he get the weather forecast from Yahoo Weather RSS
    What did I do wrong? I tried looking up google for "attr value delimiter missing!" but found no useful information.
    Thank you in advance. =)

    Please read this topic. I posted an answer about parsing xml using kxml2
    http://forums.sun.com/thread.jspa?threadID=5291592&start=0&tstart=0
    Regards,
    David

  • Write XML using XPath

    Hi,
    I have a problem. I need to WRITE a XML using XPath.
    Supose that XPath String : "/clients/client/name"
    Equivalent XML :
    <clients>
    <client>
    <name></name>
    </client>
    <clients>
    Please, helpme ...
    The XPath Strings are dinamic, there are lot of combinations.
    Is there an API (free ?) that support this ?
    Thankz

    Normally XPath is used for searching existing XML documents, not for creating new ones. So it's unlikely that anything exists to do what you ask. But not impossible, people do the strangest things. Have you searched Google?
    Of course you realize you can't use arbitrary XPath expressions here, for example what would you do with a predicate?

  • Write XML to the server... ? Problem !

    Hi,
    I need your help !
    I'm trying to reach the "Weather" example web service in WL 6.1.
    My aim is to write XML direct into a socket, over HTTP, and read the
    response...
    I have included the code I am using, but it is not successful for the
    moment.
    I keep getting a parse exception :
    HTTP/1.1 200 OK
    Date: Thu, 26 Jun 2003 07:57:33 GMT
    Server: WebLogic WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
    Content-Type: text/xml; charset=UTF-8
    Transfer-Encoding: Chunked
    Connection: Close
    04da
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Server
    </faultcode>
    <faultstring>
    org.xml.sax.SAXException
    </faultstring>
    <detail>
    Server side error:
    org.xml.sax.SAXException: Could not find envelope element
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:87)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.getInputMessage(Sta
    telessBeanAdapter.java:150)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.doPost(StatelessBea
    nAdapter.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    0000
    ============ code ===============
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class ClientSocket {
    public static void main(String args[]) throws Exception
    if (args.length != 5)
    throw new Exception("Nombre de parametres incorrect");
    String site = args[0];
    Socket sock = new Socket("localhost", 7001);
    PrintWriter out = new PrintWriter(sock.getOutputStream());
    out.println("POST /weather/weatheruri HTTP/1.1");
    out.println("Host: localhost");
    out.println("Content-Type: text/xml; charset=\"utf-8\"");
    out.println("Content-Length: nnnn");
    //out.println("SOAPAction: \"http://localhost:7001/weather/weatheruri\"");
    //out.println("SOAPAction: ");
    out.println("SOAPAction: \"Some-URI\"");
    out.println("");
    out.println("<?xml version='1.0' encoding='UTF-8'?>");
    out.println("<SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'>");
    out.println("<SOAP-ENV:Body>");
    out.println("<getTemp
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>");
    out.println("<message xsi:type='xsd:string'>");
    out.println("1212");
    out.println("</message>");
    out.println("</getTemp>");
    out.println("</SOAP-ENV:Body>");
    out.println("</SOAP-ENV:Envelope>");
    out.flush();
    BufferedReader in = new BufferedReader(new
    InputStreamReader(sock.getInputStream()));
    String str = null;
    while (((str = in.readLine()) != null))
    System.out.println(str);
    sock.close();

    Many thanks, Mike !!
    Mathew
    "Michael Wooten" <[email protected]> wrote in message
    news:[email protected]...
    >
    The attached Java source shows one example of how to use a Socket to senda SOAP
    message. Check it out, and see if it helps. It has some optimizations thataren't
    currently in the code you provided.
    Regards,
    Mike Wooten
    "W@p" <[email protected]> wrote:
    Hi,
    I need your help !
    I'm trying to reach the "Weather" example web service in WL 6.1.
    My aim is to write XML direct into a socket, over HTTP, and read the
    response...
    I have included the code I am using, but it is not successful for the
    moment.
    I keep getting a parse exception :
    HTTP/1.1 200 OK
    Date: Thu, 26 Jun 2003 07:57:33 GMT
    Server: WebLogic WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
    Transfer-Encoding: Chunked
    Connection: Close
    04da
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Server
    </faultcode>
    <faultstring>
    org.xml.sax.SAXException
    </faultstring>
    <detail>
    Server side error:
    org.xml.sax.SAXException: Could not find envelope element
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:87)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.getInputMessage(Sta
    telessBeanAdapter.java:150)
    at
    weblogic.soap.server.servlet.StatelessBeanAdapter.doPost(StatelessBea
    nAdapter.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    0000
    ============ code ===============
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class ClientSocket {
    public static void main(String args[]) throws Exception
    if (args.length != 5)
    throw new Exception("Nombre de parametres incorrect");
    String site = args[0];
    Socket sock = new Socket("localhost", 7001);
    PrintWriter out = new PrintWriter(sock.getOutputStream());
    out.println("POST /weather/weatheruri HTTP/1.1");
    out.println("Host: localhost");
    out.println("Content-Type: text/xml; charset=\"utf-8\"");
    out.println("Content-Length: nnnn");
    //out.println("SOAPAction:
    \"http://localhost:7001/weather/weatheruri\"");
    //out.println("SOAPAction: ");
    out.println("SOAPAction: \"Some-URI\"");
    out.println("");
    out.println("<?xml version='1.0' encoding='UTF-8'?>");
    out.println("<SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'>");
    out.println("<SOAP-ENV:Body>");
    out.println("<getTemp
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>");
    out.println("<message xsi:type='xsd:string'>");
    out.println("1212");
    out.println("</message>");
    out.println("</getTemp>");
    out.println("</SOAP-ENV:Body>");
    out.println("</SOAP-ENV:Envelope>");
    out.flush();
    BufferedReader in = new BufferedReader(new
    InputStreamReader(sock.getInputStream()));
    String str = null;
    while (((str = in.readLine()) != null))
    System.out.println(str);
    sock.close();

  • MICR font not displayed in PDF on SUSE Linux Server for Check Writer (XML)

    We are generating checks by running the Check Writer(XML) concurrent request and are not able to see MICR fonts on the Check. We downloaded the free version from IDAutomationSMICR.ttf and the fonts were registered under /usr/local/fonts/micr directory. I registered in APPS and uploaded the file IDAutomationSMICR.ttf. Am I missing any steps. The DBA's have registered the fonts under /usr/local/fonts/micr on SUSE Linux Server . The custom Checks are generated but no luck with the fonts. Please advise. Can I download MICR fonts other than IDAutomation site? Appreciate your response.
    Thanks,
    Hari

    I use version 11i, so the steps are probably different. Download a font file (gnuMICR for me). Extract it to a location of your choice on your operating system.
    Follow these steps to load the MICR font to the server. (Step 11 was missing in some of the metalink documents in late 2007. I think Jan. 2008 will be OK).
    1.     Log in as XML Publisher Administrator.
    2.     Navigate to Administration->Font Files->Create Font File.
    3.     Fields are Font Name and File. For Font Name choose any descriptive name. File will browse your PC to locate the font file.
    4.     Navigate to Font Mappings->Create Font Mapping Set.
    5.     Mapping name is the name you will give to a set of fonts. [MICR Font]
    6.     Mapping code is the internal name you will give to this set. [MICR]
    7.     Type: 'PDF Form' for PDF templates. 'FO to PDF' for all other template types.
    8.     Create Font Mapping (this allows you to add multiple fonts to a set).
    9.     Font Family is the exact same name you see in Word under Fonts. If you don't use the same name the font will not be picked up at runtime. [GnuMICR]
    10.     Style and weight must also match how you use the font in Windows. Normal and Normal are good defaults. [Normal, Normal]
    11.     DO NOT enter Language or Territory
    12.     Choose a value for Font Type. [Truetype]
    13.     Search for the Font you just created in step 3. [GnuMICR]
    14.     Navigate to Configuration -> FO Processing -> Font Mapping Set. Can also be done at data def and template level under Edit Configuration. Hierarchy is Site-> Data Def -> Template.
    15.     Select your new mapping set.
    16.     Make sure the font is not referenced under File->Properties->Custom in the RTF template file.
    17.     Select a temporary directory on your concurrent processing node (Configuration -> General). This needs to be a private area not shared by other processes, read writeable by the applmgr (owner of the $APPL_TOP file system). It should be fairly large 5 GB or 20x larger than any datafile being used. The fonts will be downloaded here the first time they are used.
    18.     Also at this site level select your font mapping set.
    19.     Upload a template that uses your special font and test using preview.

  • How to use download listener for xml files?

    Hi all,
    In my usecase I should write the xml contents to the file using Output Stream writer.
    As of now I am using the below lines of code in the download listener method.
    String s = myDoc.getContent().toString();
    w.write(s);
    myDoc is my xml document. I can see the file but there is no content.
    Kindly come out with your help in which I could achieve this.
    Thanks,
    Phani.

    Hi john,
    What all I am trying to ask is how could I write xml data to external file by clicking a button or a link etc.. which is in the JSF page.
    Now for that I created a button and dragged the <af:fileDownloadActionListener> into the button.
    I binded the listener with the backing bean method.
    public void sayHello(FacesContext context, OutputStream out) throws IOException
    OutputStreamWriter w = new OutputStreamWriter(out, "UTF-8");
    IDocument myDoc = new Document2004();
    myDoc.addEle("sai");
    w.write(myDoc.getContent().toString());
    w.flush();
    in the method you can see IDocument that is an interface which I have in the external JAR files that I am using to write data to MS Word.
    The myDoc which I created as an object of IDocument has lot of methods in which I am using addEle(String) which writes a string to word document.
    in the writer object writer I am getting the content of the myDoc inorder to convert that to string as it will be in xml format.
    When I am writing every thing I can download and save the document but unable to see the data that I have written that is "*sai*" instead a blank page is getting opened.
    When I do the same with Creating a file object in the local disc using File f = new File(path) rather than downloading it using the listener I can see the contents what I have written.
    This is what all I mean to ask. Kindly come up with your help
    Thanks,
    Phani.

  • Check writer XML not working.

    We are using the oracle provided Check writer XML program for HR Payroll check printing. Check writer XML program is getting error ed out when we attach MICR font set up to the Check writer XML Template in template definition, works fine if we remove the MICR font set up for the template. And MICR font set up is working fine for other custom programs we developed. Any suggestions?

    Ya i gone through the docs in the thread. the program works fine when we remove the MICR font setup for the template.
    configuration
    ==========
    RDBMS : 11.1.0.7.0
    Oracle Applications : 12.1.1
    Error is
    ========================
    HR_6859_HRPROC_OTHER_PROC_ERR
    APP-PAY-06859: An error has been detected by another process.
    Cause: During processing, the master or another slave process has detected an error, communicated by setting the Payroll status to 'Error'.
    Action: Examine the error log file and payroll messages to investigate the cause of the error.

  • How to write XML with attributes to a table in Oracle?

    I tried to find solutions over the internet. Some of the stuff I looked at:https://forums.oracle.com/thread/2182669 http://www.club-oracle.com/forums/how-to-insert-data-from-xml-to-table-t2845/
    In all these cases, the solution considers XML structure with only nodes and child nodes but not attributes. In fact, one of the solutions suggests transforming the XML into a canonical form with only nodes w/o attributes.
    This is a sample of xml structure I am working with:
    Sample XML
    <rep type="P" title="P List"> <as> <a id="3" /> <a id="4" /> </as> </rep>
    I am working with oracle client 11.2 and SQL developer
    My question is: how to write XML data into a table with attributes also as column values, beside the nodes?

    My question is: how to write XML data into a table with attributes also as column values, beside the nodes
    The question you should be asking is : "how do I access attributes in the XPath language?"
    and the answer to that is easily found in any XPath tutorial you may find over the Internet, it is not related to Oracle in particular.
    Short answer : you use an "attribute::" axis before the attribute name, or more commonly a "@", e.g. @type, @id etc.
    Using the method described in the first link, something like this will extract the root attributes :
    SELECT x.*
    FROM XMLTable(
           '/rep'
           passing <xmltype variable/column goes here>
           columns type  varchar2(1)  path '@type'
                 , title varchar2(30) path '@title'
    ) x ;
    For deeper levels, use additional XMLTable calls as described in the mentioned post.

  • Cluster and Read Write XML

    In my applications I allow users to save their settings. I used to do this in a Ini file. So I wrote a Vi that could write any cluster and it worked ok. When I discovered that in the newer versions of LabVIEW you could Read/Write From/To xml, I changed inmediatly because it have some advantages form me but I am having some trouble.
    Every time I want to save a cluster I have to use
    Flatten To XML -> Escape XML -> Write XML
    and to load
    Load From XML -> Unescape XML -> Unflatten from XML.
    I also do other important things each time I save or load settings. So it seems to be reasonable to put all this in just two subvi's. (One for loading, One for saving). The problem is that I want to use it with any cluster
    What I want with can be summarized as following:
    - SaveSettings.vi
    --Inputs:
    ---Filename
    ---AnyCluster
    ---Error In
    --Outputs
    ---Error Out
    -LoadSettings.vi
    Inputs:
    ---Filename
    ---AnyCluster
    ---Error In
    Outputs
    ---DataFromXML
    ---Error Out
    I have tried using variants or references and I was not able to make generic sub vi (sub vi that don't know what is in the cluster). I don't want to use a polymorphic vi because it will demand making one load/save pair per each type of settings.
    Thanks,
    Hernan

    If I am correct you still you need to wire the data type to the Variant To Data. How can you put in a subvi ALL that is needed to handle the read/write of the cluster? I don't want to put any Flatten To XML or Unflatten From XML outside.
    The solution I came out with INI files was passing a reference to a cluster control but it is real unconfortable because I have to itereate through all items.
    When a control has a "Anything" input, is there any way to wire that input to a control and remains "Anything"?
    Thanks
    Hernan

  • Segments in Check Writer XML data source

    Hi,
    Can anyone tell me what are the Segments 1-10 in the XML data source that I see for Check Writer (XML) when I use "Third Party Checks". I tried populating few fields in the Entry values for the corresponding element but that didn't work.
    We need an additional field to populate some reference number that needs to be printed on the check and we would like to use one of these segments since it eliminates the customization.
    - <EMPLOYEE_THIRD_PARTY_PAYMENTS>
    <ORG_PAYMENT_METHOD_ID>63</ORG_PAYMENT_METHOD_ID>
    <PERSONAL_PAYMENT_METHOD_ID>103704</PERSONAL_PAYMENT_METHOD_ID>
    <CHECK_DEPOSIT_NUMBER>166986</CHECK_DEPOSIT_NUMBER>
    <SEGMENT1 />
    <SEGMENT2 />
    <SEGMENT3 />
    <SEGMENT4 />
    <SEGMENT5 />
    <SEGMENT6 />
    <SEGMENT7 />
    <SEGMENT8 />
    <SEGMENT9 />
    <SEGMENT10 />
    <PRE_PAYMENT_ID>4077062</PRE_PAYMENT_ID>
    <VALUE>151</VALUE>
    <PREPAYMENT_ASSIGNMENT_ACTION>1363042534</PREPAYMENT_ASSIGNMENT_ACTION>
    <ORG_PAYMENT_METHOD_NAME>TP Bethesda</ORG_PAYMENT_METHOD_NAME>
    </EMPLOYEE_THIRD_PARTY_PAYMENTS>

    Ok..found it. Those are the bank details.

  • Can I use a C/C++ xml parser in my java program?

    Hi,
    How can I use a C/C++ xml parser in my java program?
    Elvis.

    You would still need to convert the XML data structure into a Java data structure to import it into Java.
    Don't assume you need C++ to do anything. I woudl write it in Java first, then profile the application to see where the bottle necks are and then optimise them
    Don't optimise code unless you have proof it needs to be optimised.
    If you want to improve the speed of reading XML, try XMLbooster

  • Please help; how to write XML document with JSP?

    I try to write XML document with JSP...
    But I got wrong results everytime.
    The result is not XML file displayed in the browser,
    but HTML file.
    I even tried to use HTML special code for <, >, "
    but still display as HTML file not XML file.
    How to do this?
    Thanks in advance. I put my codes below.
    Sincerely,
    Ted.
    ================
    Here is code for the JSP (called stk.jsp):
    <%@ page contentType="text/xml" %>
    <%@ page import="bean.Stock" %>
    <jsp:useBean id="portfolio" class="bean.Portfolio" />
    <% java.util.Iterator pfolio = portfolio.getPortfolio();
    Stock stock = null; %>
    <?xml version="1.0" encoding="UTF-8"?>
    <portfolio>
    <% while (pfolio.hasNext())
    stock = (Stock) pfolio.next(); %>
    <stock>
    <symbol>
    <%=stock.getSymbol() %>
    </symbol>
    <name><%=stock.getName() %> </name>
    <price><%=stock.getPrice() %> </price>
    </stock>
    <% } %>
    </portfolio>
    =================
    Here is the code for bean.Stock:
    package bean;
    public class Stock implements java.io.Serializable
    String symbol, name;
    float price;
    public Stock(String symbol, String name, float price)
    this.symbol = symbol;
    this.name = name;
    this.price = price;
    public String getSymbol()
    return symbol;
    public String getName()
    return name;
    public float getPrice()
    return price;
    ===============
    And here is bean.Portfolio:
    package bean;
    import java.util.Iterator;
    import java.util.Vector;
    public class Portfolio implements java.io.Serializable
    private Vector portfolio = new Vector();
    public Portfolio()
    portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
    portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
    portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
    public Iterator getPortfolio()
    return portfolio.iterator();
    }

    Hi
    I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
    Keep me posted.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • Which are function modules used to convert into XML format in SAP 4.6c Ver

    which are function modules used to convert into XML format in SAP 4.6c Ver

    Hi,
    check this program , I think this will help you
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
    data(256) TYPE x,
    END OF xml_line.
    data : itab like catsdb occurs 100 with header line.
    data : file_location type STRING.
    data : file_name like sy-datum.
    data : file_create type STRING.
    file_name = sy-datum .
    file_location = 'C:\xml\'.
    concatenate file_location file_name into file_create.
    concatenate file_create '.XML' into file_create.
    DATA: l_xml_table TYPE TABLE OF xml_line,
    l_xml_size TYPE i,
    l_rc TYPE i.
    select * from catsdb into table itab.
    append itab .
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER =
    I_FILENAME =
    I_APPL_KEEP = ' '
    I_XML_DOC_NAME =
    IMPORTING
    PE_BIN_FILESIZE = l_xml_size
    TABLES
    i_tab_sap_data = itab
    CHANGING
    I_TAB_CONVERTED_DATA = l_xml_table
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    bin_filesize = l_xml_size
    filename = file_create
    filetype = 'BIN'
    CHANGING
    data_tab = l_xml_table
    EXCEPTIONS
    OTHERS = 24.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    write : 'INTERNAL TABLE DATA IS SUCCESSFULLY DOWNLOADED TO LOCATION', file_create .
    Thanks.

Maybe you are looking for

  • Problem in mapping while using Do not Use SOAP Envelope

    Hi All, This is wrt my thread 'Removing and adding SOAP Envelope' I am currently working on SOAP-XI-Proxy Scenario. For some un avoiadable reason, I had to use the option 'DO not use SOAP Envelope' .So the SOAP Envelope came withen the payload and in

  • Connection error appears: "the internet connection has been closed because it cannot be analyzed", then if refreshed: "ssl_error_rx_record_too_long".

    This is only happening on one computer in the house (the other computer and laptop access internet just fine). I can not access any websites. In about:config nothing appears in the "security.enable" search Proxy is set to "no proxy" I am using avast

  • Import from excel

    Hi, I have a excel spread sheet. The sheet contains operating times of vehicles for the whole year. (which is planned at the beginning of the year) At the moment the administrator is using the application to update a comment field within the applicat

  • Query runs differently in 9i and 10g

    I have a query that implictly does an order by in 9i and does not do the implicit order by in 10g. Nope, I dont have a "group by" clause in the query. Looking at the explain plan, the 9i version does a "SORT UNIQUE" and the 10g version does a "HASH U

  • Transferring new library to iPhone w/out erasing phone

    I recently got a new laptop, downloaded iTunes on it and began adding new music to my library. I also have 2,000 music files saved on my old laptop's hard drive that are on my iPhone 4S. I was just curious if there was any way to sync my iPhone to my