XML File Generation Issues using DBMS_XMLGEN

Hi,
I am using DBMS_XMLGEN package in a stored procedure to generate an XML file on Oracle 10 G R2 .But, the problem is the format in which the file is generated.
CREATE OR REPLACE TYPE "state_info" as object (
"@product_type" Number
CREATE OR REPLACE TYPE prod_tab as TABLE OF "state_info";
CREATE OR REPLACE TYPE state_t as object (
"state_code" CHAR(2),
"state_info" prod_tab
CREATE OR REPLACE PROCEDURE get_xml_serviced_state (p_clob OUT clob)
IS
v_xmlctx DBMS_XMLGEN.ctxhandle;
v_str VARCHAR2 (1000);
BEGIN
v_str := 'SELECT state_t(a.st_cd,CAST(MULTISET(select veh_type_id from svcd_st where st_cd =a.st_cd)as prod_tab)) as "state_info"
from svcd_st a where a.st_cd in (select distinct st_cd from svcd_st) group by a.st_cd having count(*)>=1';
v_xmlctx := DBMS_XMLGEN.newcontext (v_str);
DBMS_XMLGEN.setrowsettag (v_xmlctx,'serviced_state');
DBMS_XMLGEN.setrowtag (v_xmlctx,NULL);
p_clob := DBMS_XMLGEN.getxml (v_xmlctx);
printclobout(p_clob);
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
RAISE;
END;
SHOW ERRORS
Output :
<serviced_state>
<state_info state_code="VA">
<state_info>
<state_info product_type="2"/>
<state_info product_type="5"/>
<state_info product_type="9"/>
</state_info>
</state_info>
<state_info state_code="AB">
<state_info>
<state_info product_type="2"/>
<state_info product_type="5"/>
<state_info product_type="9"/>
</state_info>
</state_info>
</serviced_state>
Required it in below format:
<serviced_state>
<state_info state_code="VA">
<state_info product_type="2"/>
<state_info product_type="5"/>
<state_info product_type="9"/>
</state_info>
<state_info state_code="AB">
<state_info product_type="2"/>
<state_info product_type="5"/>
<state_info product_type="9"/>
</state_info>
</serviced_state>
I just need to put in all the rows under one single tag.Appreciate your early responses.
Thanks.

Your wanted XML output is NOT VALID...(try it yourself on http://tools.decisionsoft.com/schemaValidate/)

Similar Messages

  • Datalink sequence method (XML file generation problem using Rdf)

    Hi All
    I want to Generate XML File using RDF , Here i used 4 datablocks and i lilnked each datablock with datalink like 1 to 2, 1to 3 and 1 to 4 respectively. while executing the report it choosing only one link like 1 to 2 and writting the data in the file for the same. its not touching 3rd and 4th datablocks I need to have data for all the blocks that are available.
    One more thing i want to close each blockonce the data is written in the file.But in this case the tags get open wites data goes to the other block write the data for this block come back to the first block and closes the block.
    eg: <Start>
    <First block>
    <Second block>
    <Third Block>
    </Third block>
    </second block>
    </First block>
    </Start>
    My requirment is
    <start>
    <First block>
    </First block>
    <Second block>
    </Second block>
    <Third Block>
    </Third block>
    </Start>

    You might want to look at the SQL/XML operators XMLAGG, XMLELEMENT, XMLFOREST, XMLATTRIBUTES. They provide you with fine grained control over the XML generated.

  • Error in XML file generation :240416

    Hi All,
    I am facing problem with XML file generation.
    Steps:
    1. Source-->Query Transform and maintained Nested Stucture
    2. Generated XML fomat from query transform
    3. Created XML format file
    4. Make XML format as target and given XML generate path
    source table-->Query(nested structure)-->XML Format
    when I validate the job no errors found.
    Note: XSD file is in Local mechine and XML file will be generated in SFTP.
    Prooblems:
    1. Getting below error
    The input XML refers to file which is not part of the definition of this XML Schema format. Check your schema and XML files,
    and check that the root element in the XML file corresponds to the root element in the XML Schema
    Validate your XML Schema using external schema validators (found at w3.org)
    Thanks,
    Deepa

    Hi,
    I think issue Because in your Query Transform output the Root element is Query and XML target is having some other root element. Make the Query trasform name similar to root element and try...

  • Reading an xml file in actionscript using flex3

    plzz tell me how to read an xml file in actionscript using flex3.......

    One possible option to parse an xml-file to a flex XML object:
    public function parseConXML(source:String):void
                    xmlLoader = new URLLoader();
                    xmlLoader.load(new URLRequest(source));
                      // Eventlistener: if URL loaded --> onLoadComplete function
                      xmlLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
                public function xmlLoadComplete(evt:Event):void{               
                    var xml:XML = new XML();
                     // ignore comments in XML-File
                    XML.ignoreComments = true;  
                       //ignore whitespaces in XML-File
                     XML.ignoreWhitespace = true;
                    // XML-Objekt erstellen
                    xml = new XML(evt.target.data);
                   //AFTERWARDS use your xml as your wish

  • Convert XML file into DTD using Java

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

  • How do I upload an XML file to salesforce using BULK API?

    Hi There,
    Please let me know how do we upload an XML file to salesforce using Bulk API?
    Thanks,
    ET

    Hi,
    I think that this is a more SalesForce.com question and think you will have more chance looking at SOAP API Developer's Guide for salesforce. Sending a SOAP request from the API Server is very straight forward and there are several tutorials and well documented about this.
    Cheers,
    Stefan

  • Can the "mode" tag in vhost.xml file be edited using getconfig() and setconfig()?

    can the "mode" tag in vhost.xml file be edited using getconfig() and setconfig()?

    You can create client and have following code in it: (But before that Admin Server is running on the machine which you want make edge server programatically)
    var admin_nc = new NetConnection();
    sendCommand.enabled = false;   // where sendCommand is button on stage with "sendCommand" as instance name
    admin_nc.onStatus = function(info) {
    if (info.code == "NetConnection.Connect.Success")
    sendCommand.enabled = true;
    sendBtn.addEventListener("click", callAdminAPI);
    function callAdminAPI() {
    admin_nc.call("setConfig2",new Result1(),"Proxy/Mode","remote","Adaptor:_defaultRoot_/VHost:_defaultVHost_");
    function Result1() {
          this.onResult = function(info) {
    if (info.code == "NetConnection.Call.Success" ) {
    admin_nc.call("startServer",new Result2(),"restart"); // you can might as well use restartVHost
    function Result2(){
    this.onResult = function(info) {
    if (info.code == "NetConnection.Call.Success" ) {
    trace("Server started successfully);
    admin_nc.connect("rtmp://<your Edge Server IP>:1111/admin","admin","admin");  //here admin/admin is userid/password of Admin of server

  • XML file opening error using CV03N in ECC6

    Experts, I am getting below error while opening an XML file in ECC6 using transaction CV03N. File was generated in 4.6C and system is upgraded to ECC6.
    " The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    A name contained an invalid character. Error processing resource 'file:///C:/temp/ABC.xml'. Line 1, Position 35 "

    Experts, I am getting below error while opening an XML file in ECC6 using transaction CV03N. File was generated in 4.6C and system is upgraded to ECC6.
    " The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    A name contained an invalid character. Error processing resource 'file:///C:/temp/ABC.xml'. Line 1, Position 35 "

  • Error while posting xml file to URL using URLConnection

    Hello everyone,
    I am facing an issue from long time related to URLConnection. If this would be resolved by your help then I would be very grateful to you.
    One application which posts xml file to URL hangs and after waiting for 5 mins it throws 504 error:
    java.io.IOException: Server returned HTTP response code: 504 for URL: http:hostname.
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:715)
    Same application is running fine without error on another environment from last 5 years. But on another env it is erroring out from the day 1.
    We have many workarounds in place none worked.
    I tried to use HttpClient from apache but that too hanged at URLConnection.getInputStream() method call.
    App is running on iPlanet web server 6.1 using JDK 1.4.0_03
    We still dont know why this program hangs at that particular line in only one env but many times it runs fine. That means 30% of the times it posts xml file without error but 70% times it errors out. So our program logic is to retry until post is successful.
    Once this issue is resolved we will remove the logic of trying again and agian.
    Please provide inputs.
    Thanks,
    Nitin

    The HTTP response 504 means that the server, acting as a gateway, has not received a response from an upstream server in the time it expected.
    I think this is problem is due to the remote server that receives the XML and takes too long to return a response to the local application that posted the XML.
    Try HttpClient and set the timeout variable of the HttpClient instance used.
    Here http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java?revision=480424&view=markup
    a Post XML sample.
    NB: HttpClient > setTimeout method is deprecated. See : http://jakarta.apache.org/commons/httpclient/apidocs/index.html for an alternative
    Hope That Helps

  • XML File Generation

    How we can generate XML file using Oracle PL/SQL!!
    We have oracle supplied packages for this!!! Which is preferable for printing table data into XML file!!!!
    DBMS_XMLDOM
    DBMS_XMLGEN
    DBMS_XMLPARSER
    DBMS_XMLQUERY
    DBMS_XMLSAVE
    DBMS_XMLSchema
    DBMS_XMLStore
    UTL_FILE
    Thanks

    There may be several alternative ways, but maybe the simplest way around is using object views and spool the data coming -
    CREATE TABLE warehouse_table (
    WarehouseID NUMBER,
    Area NUMBER,
    Docks NUMBER,
    DockType VARCHAR2(100),
    WaterAccess VARCHAR2(10),
    RailAccess VARCHAR2(10),
    Parking VARCHAR2(20),
    VClearance NUMBER );
    INSERT INTO warehouse_table
    VALUES(5, 103000,3,’Side Load’,'false’,'true’,'Lot’,15);
    CREATE VIEW warehouse_view OF XMLTYPE
    – XMLSCHEMA “http://www.oracle.com/xwarehouses.xsd”
    – ELEMENT “Warehouse”
    WITH OBJECT ID
    (extract(OBJECT_VALUE, ‘/Warehouse/Area/text()’).getnumberval())
    AS SELECT XMLELEMENT(”Warehouse”,
    XMLFOREST(WarehouseID as “Building”,
    area as “Area”,
    docks as “Docks”,
    docktype as “DockType”,
    wateraccess as “WaterAccess”,
    railaccess as “RailAccess”,
    parking as “Parking”,
    VClearance as “VClearance”))
    FROM warehouse_table;
    SELECT VALUE(e) FROM warehouse_view e;
    VALUE(E)
    <Warehouse><Building>5</Building><Area>103000</Area><Docks>3</Docks><DockType>Si..
    Best regards.

  • How to overwrite  the xml file by  flash using Php

    Hi
    i am creating getting data from the xml file ... and i am
    doing some Alteration in the xml file by flash after that flash
    producing the xml file i finished upto this process...
    nw i neeed to overwrite the xml file.... using Php.....
    can any one give me some idea ... to solve this issue
    ~~SK

    Flash Player cannot write XML files at all. but using
    php+flash we could do it .

  • 4010_850 EDI file Generation issue.

    Hi All,
    We are facing issue in converting 850 EDI XML to EDI file.
    We could generate a simple EDI based on mandatory elements. But when we try to provide DTM and AMT values , We are hitting below issues..
    I am missing some basic stuff. Please find the EDI XML i am trying to convert to EDI file.
    <?xml version = '1.0' encoding = 'UTF-8'?><Transaction-850 xmlns:ns1="urn:oracle:b2b:X12/V4010/850" Standard="X12" xmlns="urn:oracle:b2b:X12/V4010/850">
    <ns1:Segment-ST>
    <ns1:Element-143>850</ns1:Element-143>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-ST>
    <ns1:Segment-BEG>
    <ns1:Element-353>00</ns1:Element-353>
    <ns1:Element-92>NE</ns1:Element-92>
    <ns1:Element-324>12345678</ns1:Element-324>
    <ns1:Element-373>20140703</ns1:Element-373>
    </ns1:Segment-BEG>
    <ns1:Loop-PO1>
    <ns1:Segment-PO1>
    <ns1:Element-350>001</ns1:Element-350>
    <ns1:Element-330>1</ns1:Element-330>
    <ns1:Element-212>96</ns1:Element-212>
    <ns1:Element-639>AA</ns1:Element-639>
    <ns1:Element-235_1>VC</ns1:Element-235_1>
    <ns1:Element-234_1>571157</ns1:Element-234_1>
    <ns1:Element-235_2>CB</ns1:Element-235_2>
    <ns1:Element-234_2>00100</ns1:Element-234_2>
    </ns1:Segment-PO1>
    <ns1:Loop-PID>
    <ns1:Segment-PID>
    <ns1:Element-349>F</ns1:Element-349>
    <ns1:Element-352>Rockford product</ns1:Element-352>
    </ns1:Segment-PID>
    </ns1:Loop-PID>
    <ns1:Segment-DTM>
    <ns1:Element-374>038</ns1:Element-374>
    <ns1:Element-373>20140626</ns1:Element-373>
    </ns1:Segment-DTM>
    <ns1:Loop-AMT>
    <ns1:Segment-AMT>
    <ns1:Element-522>1</ns1:Element-522>
    <ns1:Element-782>1</ns1:Element-782>
    </ns1:Segment-AMT></ns1:Loop-AMT>
    </ns1:Loop-PO1>
    <ns1:Segment-SE>
    <ns1:Element-96>#SegmentCount#</ns1:Element-96>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-SE>
    </Transaction-850>
    Only DTM passed :
    =============
    Error :
    Extra Element was found in the data file as part of Segment DTM. Segment DTM is defined in the guideline at position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 5{br}{tab}Element Count: 1{br}{tab}Characters: 1014 through 1017
    Extra Element was found in the data file as part of Segment DTM. Segment DTM is defined in the guideline at position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 5{br}{tab}Element Count: 2{br}{tab}Characters: 1052 through 1060
    Element DTM01 (Date/Time Qualifier) is missing. This Element's standard option is 'Mandatory'. Segment DTM is defined in the guideline at position 210.{br}{br}This Element was expected in:{br}{tab}Segment Count: 5{br}{tab}Element Count: 1{br}{tab}Character: 1078
    DTM + AMT Passed :
    ===============
    Error : Extra Element was found in the data file as part of Segment DTM. Segment DTM is defined in the guideline at position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 5{br}{tab}Element Count: 1{br}{tab}Characters: 1014 through 1022 Extra Element was found in the data file as part of Segment DTM. Segment DTM is defined in the guideline at position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 5{br}{tab}Element Count: 2{br}{tab}Characters: 1057 through 1060 Element DTM01 (Date/Time Qualifier) is missing. This Element's standard option is 'Mandatory'. Segment DTM is defined in the guideline at position 210.{br}{br}This Element was expected in:{br}{tab}Segment Count: 5{br}{tab}Element Count: 1{br}{tab}Character: 1078 Unrecognized data was found in the data file as part of Loop PO1. The last known Segment was DTM at guideline position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 6{br}{tab}Characters: 1278 through 1286 Unrecognized data was found in the data file as part of Loop PO1. The last known Segment was DTM at guideline position 210.{br}{br}This error was detected at:{br}{tab}Segment Count: 7{br}{tab}Characters: 1295 through 1367
    Thanks in advance,
    Siddhardha
    Manager , Deloitte Consutling.

    Issue is solved with the files provided by oracle support. They used Document editor version
    Oracle Document Editor -> 7.0.5.4018 & X12 - 8.0.0.186
    Not sure what is wrong with our files.
    We used document editor 7.0.5.4043  & X12 - 8.0.0.186
    Below is the update i put in SR.
    ==================================
    My xsd contains below text.
    <xsd:appinfo>
    <UNMKey>Full|CodeList|-<Parent Node ID>.<Index>|Composite|-<Node ID>|Element|-<Node ID>|Loop|-<Node ID>|Segment|-<Node ID>|Transaction|-<Node ID>|ReplacementCharacter|_|InternalSeparator|-</UNMKey>
    </xsd:appinfo>
    ===================
    The file you provided have the below.
    <xsd:appinfo>
    <UNMKey>Full|Default|-<Node ID>|CodeList|-<Parent Node ID>.<Index>|ReplacementCharacter|_|InternalSeparator|-
    </UNMKey>
    </xsd:appinfo>
    Not sure if that is really causing the issue.
    ==========================================
    If anyone is interested here is the SR number (#3-9312618901)
    Thanks,
    Sid

  • Generate XML file from RFC using Web Services

    Hi,
      I am trying to save an RFC enabled Function Module output to an XML file using ABAP web services.
    I could able to create Web Service and release it using WSCONFIG/WSADMIN. I can actually get the output in XML file when i launch the web service home page. But I need this to be done in the ABAP program itself. So If i run the RFC I could able to create,release web service and capture the Generated XML file by SOAP runtime.
    Any FM available?
    Thanks,
    Ram Sanjeev

    which version of WAS you are on .
    if you are on WAS6.40 check the following weblog on how to consume webservice using the wsdl file.
    /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
    lower version of WAS use class cl_http_client.
    if this case you have to manually build the soap message.
    /people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap
    Regards
    Raja

  • Reading my Xml file in Unity using C#

    Hi, i have to read a xml file like this:
    <UIs>
    <UI>
    <Titolo>
    <Ita>
    Mitocondri
    </Ita>
    <English>
    Mitochondrion
    </English>
    </Titolo>
    <Corpo>
    <Ita>
    I mitocondri sono gli organelli che producono ATP all'interno della cellula,aggiungine di nuovi per aumentare la produzione di ATP
    </Ita>
    <English>
    Mitochondrion
    </English>
    </Corpo>
    <Price>
    120
    </Price>
    <MaxNumber>
    1
    </MaxNumber>
    </UI>
    <UIs>
    How can i make a simple xml reader in c# to read this structure?
    Thanks!

    Try this.  The code writes your sample XML and then reads it back
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Xml;
    using System.Xml.Serialization;
    using System.Xml.Schema;
    using System.IO;
    namespace ConsoleApplication1
    class Program
    const string FILENAME = @"c:\temp\Test.xml";
    static void Main(string[] args)
    UIs uIs = new UIs()
    uI = new UI()
    titolo = new Titolo()
    Ita = "Mitocondri",
    english = "Mitochondrion"
    corpo = new Corpo()
    ita = "I mitocondri sono gli organelli che producono ATP all'interno della cellula,aggiungine di nuovi per aumentare la produzione di ATP",
    english = "Mitochondrion"
    price = 120,
    maxNumber = 1
    XmlSerializer serializer = new XmlSerializer(typeof(UIs));
    StreamWriter writer = new StreamWriter(FILENAME);
    XmlSerializerNamespaces _ns = new XmlSerializerNamespaces();
    _ns.Add("", "");
    serializer.Serialize(writer, uIs, _ns);
    writer.Flush();
    writer.Close();
    writer.Dispose();
    XmlSerializer xs = new XmlSerializer(typeof(UIs));
    XmlTextReader reader = new XmlTextReader(FILENAME);
    UIs newUIs = (UIs)xs.Deserialize(reader);
    [XmlRoot("UIs")]
    public class UIs
    [XmlElement("UI")]
    public UI uI { get; set; }
    [Serializable, XmlRoot("UI")]
    public class UI
    [XmlElement("Titolo")]
    public Titolo titolo { get; set; }
    [XmlElement("Corpo")]
    public Corpo corpo { get; set; }
    [XmlElement("Price")]
    public int price { get; set; }
    [XmlElement("MaxNumber")]
    public int maxNumber { get; set; }
    [Serializable, XmlRoot("Titolo")]
    public class Titolo
    [XmlElement("Ita")]
    public string Ita { get; set; }
    [XmlElement("English")]
    public string english { get; set; }
    [Serializable, XmlRoot("Corpo")]
    public class Corpo
    [XmlElement("Ita")]
    public string ita { get; set; }
    [XmlElement("English")]
    public string english { get; set; }
    jdweng

  • XML file parse issue

    I have a requirement to print <attribute-override> and <column> in a spreadsheet.
    My xml file is as
    <?xml version="1.0" encoding="UTF-8"?>
    <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd">
      <entity class="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetricDetails">
        <table name="FLX_AC_ACCT_CREDIT_MATRIX_DTLS"/>
        <attributes>
          <embedded-id attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetricDetailsKey" name="key">
            <attribute-override name="accountId">
              <column name="ACCOUNT_ID"/>
            </attribute-override>
            <attribute-override name="accountType">
              <column name="ACCOUNT_TYPE"/>
            </attribute-override>
            <attribute-override name="effectiveDate">
              <column name="EFFECTIVE_DATE"/>
            </attribute-override>
            <attribute-override name="matrixIdvalue">
              <column name="MATRIX_ID_VALUE"/>
            </attribute-override>
            <attribute-override name="classification">
              <column name="Classification"/>
            </attribute-override>
          </embedded-id>
          <embedded attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetric" name="creditMetric">
            <attribute-override name="metricType">
              <column name="METRIC_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="metricValue">
              <column name="METRIC_VALUE" unique="false"/>
            </attribute-override>
          </embedded>
          <embedded attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.RiskScore" name="riskScore">
            <attribute-override name="scoreType">
              <column name="SCORE_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="otherScoreType">
              <column name="OTHER_SCORE_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="scoreCardExternalReferenceNo">
              <column name="SCORE_EXTR_REF_NO" unique="false"/>
            </attribute-override>
            <attribute-override name="ratingModel">
              <column name="RATING_MODEL" unique="false"/>
            </attribute-override>
            <attribute-override name="ratingStatus">
              <column name="RATING_STATUS" unique="false"/>
            </attribute-override>
            <attribute-override name="riskGrade">
              <column name="RISK_GRADE" unique="false"/>
            </attribute-override>
            <attribute-override name="scoreCardIndex">
              <column name="SCORE_CARD_INDEX" unique="false"/>
            </attribute-override>
            <attribute-override name="score">
              <column name="SCORE" unique="false"/>
            </attribute-override>
          </embedded>
        </attributes>
      </entity>
    </entity-mappings>
    I have managed to write the code as
    package xmlexcel;
    import org.apache.poi.hssf.usermodel.*;
    import java.util.ArrayList;
    import java.awt.List;
    import java.io.*;
    import java.util.ArrayList;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class XMLconvertExcel {
      private static File xmlDocument;
        private static NodeList e;
        int a;
      public void generateExcel(File xmlDocument) {
      try {
      HSSFWorkbook wb = new HSSFWorkbook();
      HSSFSheet spreadSheet = wb.createSheet("spreadSheet");
      spreadSheet.setColumnWidth((short)0,(short) (256*25));
      spreadSheet.setColumnWidth((short)1,(short) (256*25));
      spreadSheet.setColumnWidth((short)2,(short) (256*25));
      spreadSheet.setColumnWidth((short)3,(short) (256*25));
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document document = builder.parse(xmlDocument);
      NodeList nList = document.getElementsByTagName("attributes");
      document.getDocumentElement().normalize();
      //a=nodelist.getLength();
      //e = printStackTrace();
      //System.out.println("I am here " +e);
             System.out.println("Root element :" + document.getDocumentElement().getNodeName() + " nlist length  " +nList.getLength());
             System.out.println("Node Type :" + document.getDocumentElement().getNodeType());
      HSSFRow row = spreadSheet.createRow(0);
      HSSFCell cell = row.createCell((short)0);
      cell.setCellValue("Entity");
      cell = row.createCell((short)1);
      cell.setCellValue("Table");
      cell = row.createCell((short)2);
      cell.setCellValue("Attribute");
      cell = row.createCell((short)3);
      cell.setCellValue("Column");
      HSSFRow row1 = spreadSheet.createRow(1);
      HSSFRow row2 = spreadSheet.createRow(2);
      HSSFRow row3 = spreadSheet.createRow(3);
      for (int i = 0; i < nList.getLength(); i++) {
      Node nNode = nList.item(i);
                 System.out.println("\nCurrent Element :"    + nNode.getNodeName());
                 switch {
      case 0:
      //cell = row1.createCell((short)0);
      //cell.setCellValue("Attribute");
      //trying from http://architects.dzone.com/articles/parsing-xml-using-dom-sax-and
      cell = row1.createCell((short) 2);
                    cell.setCellValue(((Element) (nList.item(0)))
                       .getElementsByTagName("attribute-override").item(0)
                       .getFirstChild().getNodeValue());
      break;
      case 1:
      //cell = row1.createCell((short)1);
      //cell.setCellValue("Table");
      cell = row1.createCell((short) 3);
      cell.setCellValue(((Element) (nList.item(0)))
      .getElementsByTagName("column").item(0)
      .getFirstChild().getNodeValue());
      break;
      case 2:
      cell = row1.createCell((short)2);
      cell.setCellValue("Attribute");
      cell = row1.createCell((short) 2);
      cell.setCellValue(((Element) (nodelist.item(2)))
      .getElementsByTagName("attribute-override").item(0)
      .getFirstChild().getNodeValue());
      cell = row1.createCell((short)3);
      cell.setCellValue("Column");
      cell = row1.createCell((short) 3);
      cell.setCellValue(((Element) (nodelist.item(3)))
      .getElementsByTagName("column").item(0)
      .getFirstChild().getNodeValue());
      break;
      default:
      break;
      //wb.write(arg1.getOutputPayload().getOutputStream());
      //Outputting to Excel spreadsheet
      FileOutputStream output = new FileOutputStream(new File("C:\\java_training\\com\\XMLtoExcel\\ormaccount.xls"));
             wb.write(output);
             output.flush();
             output.close();
      } catch (IOException e) {
      System.out.println("IOException " + e.getMessage());
      } catch (ParserConfigurationException e) {
      System.out.println("ParserConfigurationException " +e.getMessage());
      }catch (SAXException e) {
      System.out.println("SAXException " +e.getMessage());
      private String printStackTrace() {
      // TODO Auto-generated method stub
      return null;
      * @param args
      public static void main(String[] args) {
      File xmlDocument = new File("C:\\java_training\\com\\XMLtoExcel\\AccountCreditMatrixDetails.orm.xml");
      XMLconvertExcel excel = new XMLconvertExcel();
      excel.generateExcel(xmlDocument);
    Both the tags are not getting printed in separate columns.
    I have looked at
    http://www.javaworld.com/article/2076189/enterprise-java/book-excerpt--converting-xml-to-spreadsheet--and-vice-versa.html
    http://scn.sap.com/thread/3224533
    http://www.tutorialspoint.com/java_xml/java_dom_parse_document.htm
    The above URL shows example of simple xml.
    Please can I get assistance.

    I too received this error as I tried to run my first Windows 8.1 deployment. Per another post I commented out this line
    <IEWelcomeMsg>false</IEWelcomeMsg>
    from the IE section of the unattend.xml. I was then able to run my deployment. I do not see this line in your posting though.
    I referenced this link even though it was for Windows 7.
    http://social.technet.microsoft.com/Forums/en-US/c41a2b69-a591-4cd3-86ab-6a0f8a73b858/getting-windows-could-not-parse-or-process-the-unattend-answer-file-for-pass-specialize-with?forum=mdt
    Hope this helps someone.
    JayTheTech
    To clarify, I edited the unattend.xml file from from Deployment Share, not C:\Windows\Panther.
    DS\control\task sequence ID\unattend.xml
    JayTheTech

Maybe you are looking for

  • Optimizing images | Learn Dreamweaver CS6 | Adobe TV

    In Dreamweaver CS6, Adobe has streamlined the integration between Photoshop and Dreamweaver. Learn how to take images directly from Photoshop to Dreamweaver. Then, see how to optimize the images and edit them in Photoshop using Adobe's round-trip edi

  • DesignPremium_CS5 error -4960

    I had a trial version of Photoshop CS5 and purchased the extended version. I keep getting all kinds of errors: DesignPremium_CS5 error -4960 Photoshop_12_1-LS1-3.exe file is all garbled letters Photoshop_12_1-LS1-3.7z says Safari can't open it I even

  • NI error -201133; Input and output on the NI9401

    Former user of Matlab, it is the first time I try to work with the DAQ and national instrument. My device is a NI9401. I want to record the position of 1 optical encoders. For this , the encoder is connected to counter in the 9401. Here is how I proc

  • VETS100A - Error - "Call contained error(s):ADS(2)

    Hi,            When I executed the standard VETS report using VETS 100A form, I got the error "Call contained error: ADS(2) Message No. FPRUNX003 When I executed it with VETS 100 form, it didn't display the job codes 00 and 01 Any help is much apprec

  • Cannot find librfccm.o

    I'm getting the cannot find librfccm.o error when i try to run a job that connects to sap i have copied the file into link_dir/bin made sure that the permissions are read execute and made sure the the libpath included the link_dir/bin directory. stil