Got problem in loading xml

Hi All,
Because of your help I am doing small application and I am new in xml I gets small small problem and by the your help i cam solve it.
Now i have last problem when i solve it then my tool gets complete. I have attached small code of it and its working. The problem is when i fill one methods parameter information its comes in all methods. Which is wrong.
I want output like:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
    <name>the name of package</name>
    <className>The name of class</className>
    <methods>
           <name>the name of the method</name>
          <invokeKind/>
          <returnType>the return type of the method</returnType>
          <optionalParameters/>   
          <parameters>
                   <name>Param1</name>
                   <type>Void</type>
           </parameters>
     </methods>
     <methods>
            <name>the name of the method22</name>
           <returnType>the return type of the method22</returnType>
           <parameters/>
      </methods>
</interface>But output comes like
<?xml version="1.0" encoding="UTF-8"?><interface>
<name>the name of package</name>
<className>The name of class</className>
<methods>
<name>the name of the method</name>
<invokeKind/>
<returnType>the return type of the method</returnType>
<optionalParameters/>
<parameters>
<name>Param1</name>
<type>Void</type>
</parameters>
</methods>
<methods>
<name>the name of the method22</name>
<returnType>the return type of the method22</returnType>
<parameters>
<name>Param1</name>
<type>Void</type>
</parameters>
</methods>
</interface>
I have not given parameter in second method but given in first method but replicates in second thats y i am stucked,
Please help me.
Code is ::
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
public class TryXML
     public static void main(String args[])
          try
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder parser = factory.newDocumentBuilder();
            Document methoddoc = parser.parse(new File("methodinfo.xml"));
            Document packageDoc = parser.parse(new File("interface.xml"));          
            //***Package information           
            Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
            Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
            packagenameNode.setTextContent("the name of package");
            packageclassNode.setTextContent("The name of class");
            //***First method information
            Node nameNode = methoddoc.getElementsByTagName("name").item(0);
            Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
            nameNode.setTextContent("the name of the method");
            returnTypeNode.setTextContent("the return type of the method");
            //**Parameter Informtion of this method.
            Document parameterDoc = parser.parse(new File("parameter.xml"));
            Node paramnameNode = parameterDoc.getElementsByTagName("name").item(0);
            Node paramreturnTypeNode = parameterDoc.getElementsByTagName("type").item(0);
            paramnameNode.setTextContent("Param1");
            paramreturnTypeNode.setTextContent("Void");
          //***adding parameter information into method.
            Node methodaddnode = methoddoc.importNode(parameterDoc.getDocumentElement(), true);
            DocumentFragment docfrag = methoddoc.createDocumentFragment();
           //***Move the nodes into the fragment
           while (methodaddnode.hasChildNodes())
                docfrag.appendChild(methodaddnode.removeChild(methodaddnode.getFirstChild()));
           Node paramNode = methoddoc.createElement("parameters");
           methoddoc.getDocumentElement().appendChild(paramNode);
           paramNode.appendChild(docfrag);
           //***adding first methode's information into package.
           Node node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
           docfrag = packageDoc.createDocumentFragment();
          while (node.hasChildNodes())
              docfrag.appendChild(node.removeChild(node.getFirstChild()));
          Node methodnode = packageDoc.createElement("methods");
          packageDoc.getDocumentElement().appendChild(methodnode);
          methodnode.appendChild(docfrag);
          //***adding second methode's information into package.
          nameNode.setTextContent("the name of the method22");
            returnTypeNode.setTextContent("the return type of the method22");
            node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
            docfrag = packageDoc.createDocumentFragment();
          while (node.hasChildNodes())
              docfrag.appendChild(node.removeChild(node.getFirstChild()));
          Node methodnode2 = packageDoc.createElement("methods");
          packageDoc.getDocumentElement().appendChild(methodnode2);
          methodnode2.appendChild(docfrag);
          //**Display
            DOMSource source = new DOMSource(packageDoc);
            StreamResult result = new StreamResult(System.out);
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            System.out.println("This is the content of the XML document:\n");
            transformer.transform(source, result);
          catch (Exception e)
}regards
-bunty

my problem was, if i dont have parameters for second method then also parameters of first methods comes into 2nd method. I think its headache for me.
Parmeter.xml:
<parameter>
    <name></name>
    <type></type>
</parameter>Method.xml
<method>
    <name></name>
    <returnType></returnType>
     <parameters>
    </parameters>
</method>So my quetion is, I have put whole parameter.xml into method.xml's parameter node. In previous post u said refresh it. How can i refresh it ? not get this point .
Code is :
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class TryXML
     public static void main(String args[])
          try
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder parser = factory.newDocumentBuilder();
            Document methoddoc = parser.parse(new File("method.xml"));
            Document packageDoc = parser.parse(new File("interface.xml"));
            Document parmerterDoc=parser.parse(new File("parameter.xml"));
            //***Package information           
            Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
            Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
            packagenameNode.setTextContent("package1");
            packageclassNode.setTextContent("class1");
            //***First method information
            Node nameNode = methoddoc.getElementsByTagName("name").item(0);
            Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
            nameNode.setTextContent("method1");
            returnTypeNode.setTextContent("int");
            //**Parameter Informtion of this method.
            Node paramnameNode = parmerterDoc.getElementsByTagName("name").item(0);
            Node paramreturnTypeNode = parmerterDoc.getElementsByTagName("type").item(0);
            paramnameNode.setTextContent("Param1");
            paramreturnTypeNode.setTextContent("Void");
            NodeList list = parmerterDoc.getElementsByTagName("parameter");
            Element element = (Element)list.item(0);
            NodeList list1 = methoddoc.getElementsByTagName("parameters");
            Element element1 = (Element)list1.item(0);
            // Make a copy of the element subtree suitable for inserting into doc2
            Node dup = methoddoc.importNode(element, true);
            // Insert the copy into doc2
            element1.appendChild(dup);
            NodeList methodlist = methoddoc.getElementsByTagName("method");
            Element methodelement = (Element)methodlist.item(0);
            NodeList methodlist1 = packageDoc.getElementsByTagName("methods");
            Element methodelement1 = (Element)methodlist1.item(0);
            // Make a copy of the element subtree suitable for inserting into doc2
            Node methoddup = packageDoc.importNode(methodelement, true);
            // Insert the copy into doc2
            methodelement1.appendChild(methoddup);
//          ***Second method information
            nameNode = methoddoc.getElementsByTagName("name").item(0);
            returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
            nameNode.setTextContent("method2");
            returnTypeNode.setTextContent("short");
            //**Parameter Informtion of this method.
             methodlist = methoddoc.getElementsByTagName("method");
             methodelement = (Element)methodlist.item(0);
             methodlist1 = packageDoc.getElementsByTagName("methods");
             methodelement1 = (Element)methodlist1.item(0);
            // Make a copy of the element subtree suitable for inserting into doc2
             methoddup = packageDoc.importNode(methodelement, true);
            // Insert the copy into doc2
            methodelement1.appendChild(methoddup);
          //**Display
            DOMSource source = new DOMSource(packageDoc);
            StreamResult result = new StreamResult(System.out);
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            System.out.println("This is the content of the XML document:\n");
            transformer.transform(source, result);
          catch (Exception e)
               e.printStackTrace();
}Message was edited by:
bunty_barge

Similar Messages

  • Problem with load XML data

    Hi.
    I have a problem this load XML data. For example: file name:
    01-05-2008.xml => in this file all data have date=01.05.2008.
    Once i load period 01.05.2008 to 10.05.2008 my app load 10 files.
    Sometimes some row this greater date stay earlier then row this
    smaller date. I don't know why this happend. Bellow part of code.
    Please help.
    P.S. sorry for my very bad english.

    Hi Lekser,
    ntsii is totally right.
    Calling httpservice send is a async operation, which means
    you don´t know when the result event of such operation will
    return.
    You can also sort your grid after a xml data file was loaded.
    At least it would guarantee that the entries appear in the
    right order.
    best regards,
    kcell

  • Problem to load XML SQL Utility into other user

    Hi,
    I need help to load XML Utility into other user than
    "scott"tiger".
    I loaded both xmlparser.jar and oraclexmlsql.jar into
    "scott/tiger", it works and creating functions and testing work
    fine. But when change USER_PASSWORD to another user, it gave me
    some errors like
    creating : org/xml/sax/helpers/AttributeListImpl
    Error while creating class org/xml/sax/helpers/AttributeListImpl
    ORA-29506: invalid query derived from USING clause
    ORA-00942: table or view does not exist
    Error while accessing MD5 table
    ORA-00942: table or view does not exist
    Do I need create any table or view for my another oracle account?
    Or did I missed any thing. From the installation instruction, I
    cano not find any about creating table or view before I load the
    two jar files.
    Thanks
    Yuping
    null

    Hi Yuping,
    Great to hear that! Thx for posting the solution to the
    problem! Let us know if you have any problems with the utility
    or if u need any enhancements!
    Thx
    Murali
    Yuping Zhu (guest) wrote:
    : Hi,Murali,
    : The problem is fixed now. When load xmlparser into the user, it
    : creates two tables automatically, my mistake is I did not grant
    : "create table" privilege to the user. After I granted the
    : privilege to it, it works fine.
    : Thanks!
    : Yuping
    : Murali K (guest) wrote:
    : : Hi,
    : : I will check this out with the Java folks and let u know
    : : Thx
    : : Murali K
    : : Yuping Zhu (guest) wrote:
    : : : Hi, Murali
    : : : I'm using Oracle8i on Solaris 2.6. When I load xmlparser
    : using
    : : : loadjava -resolve -verbose -user $USER_PASSWORD
    xmlparser.jar
    : : : I get error message and I catch part of erros
    : : : PS, I can load it into scott/tiger.
    : : : Thanks!
    : : : Yuping
    : : : loading : org/w3c/dom/html/HTMLLegendElement
    : : : Error while loading org/w3c/dom/html/HTMLLegendElement
    : : : ORA-04068: existing state of packages has been
    discarded
    : : : ORA-04063: package body "IOEXML.LOADLOBS" has errors
    : : : ORA-06508: PL/SQL: could not find program unit being called
    : : : ORA-06512: at line 1
    : : : creating : org/w3c/dom/html/HTMLLegendElement
    : : : Error while creating class
    org/w3c/dom/html/HTMLLegendElement
    : : : ORA-29506: invalid query derived from USING clause
    : : : ORA-00942: table or view does not exist
    : : : Error while accessing MD5 table
    : : : ORA-00942: table or view does not exist
    : : : loading : org/w3c/dom/html/HTMLImageElement
    : : : Error while loading org/w3c/dom/html/HTMLImageElement
    : : : ORA-04068: existing state of packages has been
    discarded
    : : : ORA-04063: package body "IOEXML.LOADLOBS" has errors
    : : : ORA-06508: PL/SQL: could not find program unit being called
    : : : ORA-06512: at line 1
    : : : creating : org/w3c/dom/html/HTMLImageElement
    : : : Error while creating class
    org/w3c/dom/html/HTMLImageElement
    : : : ORA-29506: invalid query derived from USING clause
    : : : ORA-00942: table or view does not exist
    : : : Error while accessing MD5 table
    : : : ORA-00942: table or view does not exist
    : : : loading : oracle/xml/parser/v2/XSLException
    : : : Error while loading oracle/xml/parser/v2/XSLException
    : : : ORA-04068: existing state of packages has been
    discarded
    : : : ORA-04063: package body "IOEXML.LOADLOBS" has errors
    : : : ORA-06508: PL/SQL: could not find program unit being called
    : : : ORA-06512: at line 1
    : : : Murali K (guest) wrote:
    : : : : Hi Yuping,
    : : : : I tried the same on a 8i database and it seems to be
    : : working
    : : : : fine. (loading into two schemas). In fact I just created
    : the
    : : : : other user and it doesnt have any tables or anything in
    it.
    : : : : You do not need to create anything (table/view) extra
    for
    : : : these
    : : : : to work.
    : : : : Which database (Oracle8 or 8i) are u using?
    : : : : Thanks
    : : : : Murali
    : : : : Yuping Zhu (guest) wrote:
    : : : : : Hi,
    : : : : : I need help to load XML Utility into other user than
    : : : : : "scott"tiger".
    : : : : : I loaded both xmlparser.jar and oraclexmlsql.jar into
    : : : : : "scott/tiger", it works and creating functions and
    : testing
    : : : work
    : : : : : fine. But when change USER_PASSWORD to another user,
    it
    : : gave
    : : : me
    : : : : : some errors like
    : : : : : creating : org/xml/sax/helpers/AttributeListImpl
    : : : : : Error while creating class
    : : : : org/xml/sax/helpers/AttributeListImpl
    : : : : : ORA-29506: invalid query derived from USING clause
    : : : : : ORA-00942: table or view does not exist
    : : : : : Error while accessing MD5 table
    : : : : : ORA-00942: table or view does not exist
    : : : : : Do I need create any table or view for my another
    oracle
    : : : : account?
    : : : : : Or did I missed any thing. From the installation
    : : instruction,
    : : : I
    : : : : : cano not find any about creating table or view before
    I
    : : load
    : : : : the
    : : : : : two jar files.
    : : : : : Thanks
    : : : : : Yuping
    null

  • PROBLEM IN LOADING XML SECOND TIME

    HI,
    Actually i m loading xml 1st time when the page is loading,then again 2nd time when i m trying to load 2nd xml based on dropdown value then it is loading xml but it is appending the 2nd xml with the 1st xml.i m also unloading xml at first then loading 2nd xml but it is cming like that.the code is for loading and unloading is........
    for loading i m calling---------------load_xml(xml)
    for unloading i m calling------------- unload_xml()
    function unload_xml():void
    trace("in unload")
    this.removeChild( flashmo_item_group );
    function push_array(e:Event):void
    flashmo_xml = XML(e.target.data);
    total = flashmo_xml.item.length();
    for( i = 0; i < total; i++ )
      flashmo_item_list.push( { content: flashmo_xml.item[i].content.toString() } );
    load_css();
    function load_xml(xml_file:String):void
    var xml_loader:URLLoader = new URLLoader();
    xml_loader.load( new URLRequest( xml_file ) );
    xml_loader.addEventListener(Event.COMPLETE, push_array);
    xml_loader.addEventListener(IOErrorEvent.IO_ERROR, io_error);
    function load_css():void
    css_loader.load( new URLRequest(css_file) );
    css_loader.addEventListener(Event.COMPLETE, css_complete);
    css_loader.addEventListener(IOErrorEvent.IO_ERROR, io_error);
    function css_complete(e:Event):void
    var css_format:TextFormat = new TextFormat();
    flashmo_style.parseCSS(css_loader.data);
    create_item_list();
    flashmo_loading.visible = false;
    function io_error(e:IOErrorEvent):void
    flashmo_loading.xml_info.text += "\n\n" + e;
    function create_item_list():void
    for( i = 0; i < total; i++ )
      var flashmo_item = new MovieClip();
      flashmo_item.addChild( create_item_desc( flashmo_item_list[i].content ) );
      flashmo_item.addChildAt( create_item_bg( flashmo_item.height, i ), 0 );
      flashmo_item.y = item_height;
      item_height += flashmo_item.height + item_spacing;
      flashmo_item_group.addChild( flashmo_item );
    this.addChild( flashmo_item_group );
    flashmo_item_group.mask = flashmo_mask;
    flashmo_sb.scrolling("flashmo_item_group", "flashmo_mask", 0.40); // ScrollBar Added
    function create_item_bg( h:Number, item_no:Number )
    var fm_rect:Shape = new Shape();
    fm_rect.graphics.beginFill(0xFFFFFF, 1); // ITEM BACKGROUND COLOR
    fm_rect.graphics.drawRoundRect(0, 0, item_width, h + item_padding * 2, 0);
    fm_rect.graphics.endFill();
    return fm_rect;
    function create_item_desc( item_desc:String )
    var fm_text = new TextField();
    fm_text.x = item_padding;
    fm_text.y = item_padding;
    fm_text.width = item_width - item_padding * 2;
    fm_text.styleSheet = flashmo_style;
    fm_text.htmlText = item_desc;
    fm_text.multiline = true;
    fm_text.wordWrap = true;
    fm_text.selectable = true;
    fm_text.autoSize = TextFieldAutoSize.LEFT;
    return fm_text;
    flashmo_sb.alpha=1;
    so plz give me idea to resolve this problem.

    function push_array(e:Event):void
        flashmo_item_list = [];
    flashmo_xml = XML(e.target.data);
    total = flashmo_xml.item.length();
    for( i = 0; i < total; i++ )
      flashmo_item_list.push( { content: flashmo_xml.item[i].content.toString() } );
    load_css();
    that will reset your array.

  • Problem to load XML

    dear,
    i have problem to load a xml file from flash.
    see in below:
    when i put this : xmlpath.load(_root.xmlFile==undefined?"datas.xml":_root.xmlFile);  it works perfect in flash but not in the browser.
    kindly help me on this...
    i will appreciate your help
    regards,
    MELAS076

    I solved the URL But i have some issues between 2 flashs and 2 xml files which they are loading and navigate together....
    let me explain my problem is:
    - i have 2 flashs (main + index) and 2 xmls(data + datas) but they are not in the same path.
    in the main.swf : we have pictures of product which is load datas from data.xml and it is loading MC when clicked on one of picture.
    is in the root path.
    in the index.swf: we have all details and pictures of product which is loaded from datas.xml clicked by main.swf
    is in the root path/products/name1/ and we have root path/products/name2/.
    and each product has datas.xml in their folder with index.swf
    so how can i let the index.swf load its datas.xml when i clicked from main.swf?
    My main.swf code:
    stop();
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    links = [];
    description = [];
    thumbnails = [];
    a =[];
    total = xmlNode.firstChild.childNodes.length;
    for (i=0; i<total; i++) {
    links[i] = xmlNode.firstChild.childNodes[i].attributes.datas;
    description[i] = xmlNode.firstChild.childNodes[i].attributes.label;
    thumbnails[i] = xmlNode.firstChild.childNodes[i].attributes.thumbs;
    a[i] = xmlNode.firstChild.childNodes[i].attributes.folder;
    thumbnails_fn(i);
    //trace(xmlNode.firstChild.childNodes[1].attributes.thumbs);
    initPreloading();
    //firstImage();
    } else {
    content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("data.xml");
    p = 0;
    function thumbnails_fn(k) {
    this.thumbnail_mc.createEmptyMovieClip("t"+k, this.thumbnail_mc.getNextHighestDepth());
    tlistener = new Object();
    tlistener.onLoadInit = function(target_mc) {
    target_mc._x = (eval("this.thumbnail_mc.t"+k)._width+20)*k;
    target_mc.pictureValue = k;
    aa = xmlData.firstChild.firstChild.childNodes[k].attributes.datas;
    target_mc.onRelease = function() {
    LOADmc.loadMovie(aa);
    //trace();
    p = this.pictureValue;
    //nextImage();
    target_mc.onRollOver = function() {
    this._alpha = 90;
    //thumbNailScroller();
    target_mc.onRollOut = function() {
    this._alpha = 100;
    image_mcl = new MovieClipLoader();
    image_mcl.addListener(tlistener);
    image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
    LOADmc._x=(alignmc.width-LOADmc._width)/2;
    LOADmc._y=(alignmc.height-LOADmc._height)/2;
    my data.xml:
    <?xml version="1.0"?>
    <data>
      <category title="OUR PRODUCTS">
        <item id="1" folder="Products/Multihost" thumbs="Products/Multihost/thumbs/1.jpg" label="Multihost" datas="Products/Multihost/index.swf"/>
        <item id="2" folder="Products/VOIP" thumbs="Products/VOIP/thumbs/image1.jpg" label="VO IP" datas="Products/VOIP/index.swf"/>
      </category>
    </data>
    my index.swf in each product/name :
    var xmlfiles:XML = new XML();
    xmlfiles.ignoreWhite = true;
    xmlfiles.load("../../data.xml");
    xmlfiles.onLoad=function(success) {
        if (success) {
    //        total = xmlfiles.firstChild.firstChild.childNodes.length;
    //for (i=0; i<total; i++) {
            var ba = xmlNodes.firstChild.firstChild.childNodes[k].attributes.folder;
    var xmlOb:XML = new XML();
    xmlOb.ignoreWhite = true;
    xmlOb.onLoad = function() {
        var aux:main = new main(xmlOb);
        trace(ba+"/datas.xml");
    xmlOb.load(a+"/datas.xml");
    //xmlOb.load(_root.xmlFile==undefined?"datas.xml":_root.xmlFile);
    //xmlOb.load("products/multihost/datas.xml");
    my datas.xml for prduct name 1:
    <?xml version="1.0" encoding="utf-8"?>
    <product>
      <gallery>
        <button id="1" title="Multihost 20" subtitle="MH20" thumb="Products/Multihost/thumbs/2.jpg" ProductTitle="MH20">
          <picture thumb="Products/Multihost/thumbs/1.jpg" image="Products/Multihost/images/1.jpg"/>
          <picture thumb="Products/Multihost/thumbs/2.jpg" image="Products/Multihost/images/2.jpg"/>
          <picture thumb="Products/Multihost/thumbs/3.jpg" image="Products/Multihost/images/3.jpg"/>
          <picture thumb="Products/Multihost/thumbs/5.jpg" image="Products/Multihost/images/5.jpg"/>
          <description linkname="MH Overview.pdf"><![CDATA[Marwan salem tests]]></description>
        </button>
      </gallery>
      <mainTitle MainTitle="Multihost"/>
    </product>
    my datas.xml for prduct name 2:
    <?xml version="1.0" encoding="utf-8"?>
    <product>
      <gallery>
    <button id="0" title="VO IP 20" subtitle="VO IP 20" thumb="Products/VO IP/thumbs/image1.jpg" ProductTitle="VO IP 20"><picture thumb="Products/VO IP/thumbs/image1.jpg" image="Products/VO IP/images/image1.jpg"/><description linkname="Multi-Host Flyer.pdf"><![CDATA[MArwan VO IP 20]]></description></button></gallery>
      <mainTitle MainTitle="VO IP"/>
    </product>
    thanks for your help.
    best regards,
    MELAS076
    Message was edited by: melas076

  • Problem with loading XML file from directory.

    Hello everyone.
    *1)* I have directory defined by DBA. I have read, write privileges. I can read file from this directory using UTL_FILE, I can create file in this directory using UTL_FILE. I tried many times and it does not seem to be any problems.
    *2)* I have very simple XML table (with just one column of xmltype). I can insert into this column using:
    insert into temp_xml values (
    Xmltype ('<something></something>')
    *3)* When executing
    insert into temp_xml values (
    Xmltype (
    bfilename('XML_LOCATION', 'sample.xml'),
    nls_charset_id('AL16UTF8')
    I'm receiving an error:
    Error report:
    SQL Error: ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 1
    22288. 00000 - "file or LOB operation %s failed\n%s"
    *Cause:    The operation attempted on the file or LOB failed.
    *Action:   See the next error message in the error stack for more detailed
    information. Also, verify that the file or LOB exists and that
    the necessary privileges are set for the specified operation. If
    the error still persists, report the error to the DBA.
    *4)* Previously I was receiving more descriptive errors like permission denied, file not exists etc. This time there is no clear description apart from "file or LOB operation %s failed\n%s". I'm sure I can access this file in this directory (I used UTL_FILE to dbms_output the content).
    Any help would be greatly appreciated.
    Regards
    Marcin Jankowski

    Hi Marcin,
    Welcome to the forums.
    One very important thing with Oracle XML : please always give your database version, all four digits (e.g. 10.2.0.4).
    Does the directory resides on the same machine as the database? Which OS?
    Does any of the following work ?
    DECLARE
       v_lob   CLOB;
       v_file  BFILE;
    BEGIN
       v_file := BFILENAME('XML_LOCATION','sample.xml');
       DBMS_LOB.createtemporary(v_lob, true);
       DBMS_LOB.fileopen(v_file);
       DBMS_LOB.loadfromfile(v_lob, v_file, DBMS_LOB.getlength(v_file));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
       DBMS_LOB.fileclose(v_file);
       DBMS_LOB.freetemporary(v_lob);
    END;
    DECLARE
       v_lob   CLOB;
    BEGIN
       v_lob := DBMS_XSLPROCESSOR.read2clob('XML_LOCATION', 'sample.xml', nls_charset_id('AL16UTF8'));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
    END;
    /

  • A problem with loading xml from external URl in flex

    So I have a server running (localhost) and I wrote an  application to request information from another website and return data  (xml). The application worked fine when I was using the flash builder  and just testing it on my machine (not using the localhost), when I  started using the server with the same exact code, it requested the  crossdomain.xml file to assure that I can request information from that  site, so I added the file and the file is right, the script gets it  (according to firebug), however, it is not getting the xml information  it should get, it just gets stuck with (waiting information from  blah.com) at the bottom.
    Is there a way to solve the problem?
    (I turned my firewall off and it didn't work either)

    Yeah I did test the URL and everything is going fine, the information is not returned to the flex application that's all.
    I am testing with FireBug and it is telling me that the request is in fact sent to the site but I don't think anything (either than the crossdomain function) is returned.
    Thanks for the help, I am really not sure what is going on.

  • Problem in Loading XML File

    I created one menu Item using XML file .My doubt is where we will put that XML file in our project

    Dear,
    I think loading form from srf file in the UI is done using SDK UI. First we load the srf in a string veriable. I have worked it out using c#. and then we use SBO_Application.LoadBatchActions method to load and show the form
    string strXml = "";
    String path = @"C:\Program Files\SAP\SAP Business One\frmTest.srf";
    using (System.IO.StreamReader sr = System.IO.File.OpenText(path))
                            strXml += sr.ReadLine();
    SBO_Application.LoadBatchActions( ref strXml);

  • [SOLVED Thanks ]// problem with loading XML in projectors and Firefox

    Hi !
    I've been working and testing my movie in flash only. when I
    start the file in IE it works but when I try to load the file in
    firefox or make a standalone exe player it won´t read the
    XMLfile. I've tried to allow all access and set the root in the
    tilestructor to a trusted location in the flashplayers settings.
    /Micke

    HI Micke,
    What is the code you are using to load the XML file ?
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. -
    http://www.flashjester.com
    There is a very fine line between "hobby" and
    "mental illness."

  • Problem when loading xml file using sql loader

    I am trying to load data into table test_xml (xmldata XMLType)
    i have an xml file and i want whole file to be loaded into a single column
    when i use the following control file and executed from command prompt as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct=true;:
    LOAD DATA
    INFILE *
    TRUNCATE INTO TABLE test_xml
    xmltype(xmldata)
    FIELDS
    ext_fname filler char(100),
    xmldata LOBFILE (ext_fname) TERMINATED BY EOF
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    the file is being loaded into table perfectly.
    unfortunatley i cant hardcode file name as file name will be changed dynamically.
    so i removed the block
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    from control file and tried to execute by giving file path from command line as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml direct=true;
    but strangely it's trying to load each line of xml file into table instead of whole file
    Please find the log of the program with error
    Loading of XML through SQL*Loader Starts
    SQL*Loader-502: unable to open data file '<?xml version="1.0"?>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Root>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>Forms</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>PLL</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    please help me how can i load full xml into single column using command line without hardcoding in control file
    Edited by: 907010 on Jan 10, 2012 2:24 AM

    but strangely it's trying to load each line of xml file into table instead of whole fileNothing strange, the data parameter specifies the file containing the data to load.
    If you use the XML filename here, the control file will try to interpret each line of the XML as being separate file paths.
    The traditional approach to this is to have the filename stored in another file, say filelist.txt and use, for example :
    echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;

  • Problem ragarding load xml(embedded) file

    oGlobalMain is the object of global class where every object is created and function is defined
    SBO_Application is declared as Public WithEvents SBO_Application As SAPbouiCOM.Application
    #Region "Load as XML"
    Public Sub LoadAsXml(ByVal FileName As String, Optional ByVal FileType As ResourceType = ResourceType.Content)
    Dim oXmlDoc As Xml.XmlDocument
    Dim oXmlStream As System.IO.Stream
    oXmlDoc = New Xml.XmlDocument
    Try
    If FileType = ResourceType.Content Then
    oXmlDoc.Load(FileName)
    Else
    oXmlStream = System.Reflection.Assembly.LoadFrom(System.Windows.Forms.Application.ExecutablePath).GetManifestResourceStream(GetType(modStartUp).Namespace & "." & FileName)
    oXmlDoc.Load(oXmlStream)
    End If
    oGlobalMain.SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
    Catch ex As Exception
    oGlobalMain.SBO_Application.MessageBox(ex.Message)
    End Try
    End Sub
    #End Region
    please send me some suggestion, I would be grateful to you.
    Thanks in advance
    regards
    Nandini

    Hi..
    use this code
    Form load()
    use
    Me.CreateForm()
    Sub CreateForm()
            Try
                SAPXML("AAAAAAA.xml")
                OM_Form = app.Forms.Item("FormID--Yours")
                Catch ex As Exception
                OM_Form = app.Forms.Item("FormID--Yours")
                OM_Form.Select()
                Exit Sub
            End Try
        End Sub
    Sub SAPXML(ByVal path As String)
            Try
                Dim xmldoc As New MSXML2.DOMDocument
                Dim Streaming As System.IO.Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Your Folder." + path)
                Dim StreamRead As New System.IO.StreamReader(Streaming, True)
                xmldoc.loadXML(StreamRead.ReadToEnd)
                StreamRead.Close()
                app.LoadBatchActions(xmldoc.xml)
            Catch ex As Exception
                app.MessageBox(ex.Message)
            End Try
        End Sub
    Regards,
    Siva

  • Loading xml data to a oracle database problem in style sheet

    Hi,
    I Have one small Problem While loading xml data to a oracle database.
    In the XML i have the Columns and Data Like this.
    <Data>
    <TRAN>
    <Type_Trs>A</Type_Trs>
    <T1>2</T1>
    <T2>3</T2>
    </TRAN>
    <TRAN>
    <Type_Trs>B</Type_Trs>
    <T1>2</T1>
    <T2>3</T2>
    </TRAN>
    </Data>
    I have TRAN Table having Field Like this.
    TRAN(Type_Trs,T1,F)
    Note:- The XML Column T2 is Not matching with TRAN Table Column F
    I want to fetch T2 data into F column.
    When I am fetching the xml data into oracle table only
    one row is fetching.
    Can You help me
    To load the the all the record of XML data into the Oracle Table
    What will be my XLS Style Sheet File Please
    suggest me.
    Regards
    MBR
    Thnks in Advance

    Hi MBR
    You would be better posting your question to the general XML forums:
    http://forums.oracle.com/forums/category.jspa?categoryID=51
    This is purely for XML/BI Publisher where we get the data back out of the db :o)
    Tim

  • Problem loading XML in firefox

    I have stumbled across a problem when loading XML via an
    external address in Firefox.
    If you specify a valid port like '
    http://www.mydomain.com:80/test.xml'
    in the path for XML.load(), then it will not work when viewing the
    Flash in Firefox ,but It works correctly in IE and also in both
    browsers when viewing the page locally (rather than from a server).
    please help me to solve this problem
    Thanks,
    shanthi.

    HI Micke,
    What is the code you are using to load the XML file ?
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. -
    http://www.flashjester.com
    There is a very fine line between "hobby" and
    "mental illness."

  • Load XML file causes delay

    Hi,
    We have created a Adobe Air application, only we stumble across a delay in handling data. We are loading a XML file (1,8 mb) and process it to flash objects like inputfields etc.
    Only on my normal Windows 7 pc it takes 5 sec to load only on a windows server 2013 R2 server its up to 15 sec to process the data. (see screenshot)
    Is there someone who has same problem with loading XML data en process it as flash objects?
    With best regards,
    René

    this is an excerpt from a book i wrote (Flash Game Development: In a Social, Mobile and 3D World)
    Loops
    There are two significantly different loop types in ActionScript. One type that executes from start to end before any other code executes and before anything updates on stage and one type that does neither of those things.
    do-loops, for-loops and while-loops
    Loop types that execute from start to end before anything updates on stage include do-loops, for-loops and while loops. They cannot be used to animate objects because no matter what code you use to execute the loop and no matter what you do to (try and) slow it down, it will still execute from start to finish before anything changes on stage. They are appropriately used for rapid execution of code.
    There is never a situation when you should intentionally slow these loops. However, there are situations when you might want to break these loops into more than one chunk so the stage can update between each chunk.
    Chunks
    For example, if you have a for-loop that takes 10 seconds to execute, your game will appear to freeze for 10 seconds after this loop starts. Nothing will update on stage and nothing will respond to user input. Either you should warn your user before starting that loop or you should break that loop into several smaller chunks that allow visual updates to the user so they do not think your game is broken.
    For example, this for-loop that adds odd numbers (and shows the first m odd numbers sum to m*m) freezes my Flash Player for about 9 seconds.
    var i:Number;
    var n:Number=3000000000;
    var s:Number=0;
    var startI:Number=1;
    var endI:Number=n
    var startTime:int=getTimer();
    for (i=startI; i<endI; i+=2) {
          s+=i;
    // 9 seconds
    trace((getTimer()-startTime)/1000,s,n*n/4,s-n*n/4);
    The following technique shows how to break this (and any other for-loop) into chunks that allow the Flash Player to update every second.
    var i:Number;
    var n:Number=3000000000;
    var s:Number=0;
    var startTime:int=getTimer();
    // This is the number chunks into which the previous for-loop will broken. If the // previous for-loop took about 9 seconds, using 10 chunks means there will be updates // about every 0.9 seconds.
    var chunks:int=10;
    var startI:Number=1;
    var endI:Number=n/chunks;
    var t:Timer=new Timer(100,1);
    t.addEventListener(TimerEvent.TIMER,f);
    f();
    function f(e:Event=null):void {
          for (i=startI; i<endI; i+=2) {
                s+=i;
          trace("stage update",startI,endI,s);
          if (endI<n) {
                t.reset();
                t.start();
          } else {
                trace((getTimer()-startTime)/1000,s,n*n/4,s-n*n/4);
          startI+=n/chunks;
          endI+=n/chunks;

  • Flash CC Air iOS: Problems with loading text from an external xml located on a server.

    So I have this code allowing me to load text from an xml located on a server. Everything works fine on the Air for Android. The app even works in the ios emulator, but once I export my app to my ios device with ios 7, I don't see any text. The app is developed with Air sdk 3.9. What could be the reason? Do I need any special permissions like on Android? Does ios even allow to load xml from an external server?
    Any clues?

    It was my bad. I linked to a php file to avoid any connection lags, which was absolutely fine on the android, but didn't seem to work on the ios 7. So all I did is change the php extension to xml and it worked without any problems.

Maybe you are looking for