Load xml document from CLOB

I'm try to load xml document from CLOB in following way:
--- procedure loadXML.sql -----
CREATE OR REPLACE PROCEDURE loadXML
IS
CONTENT CLOB := ' ';
SOURCE bfile := BFILENAME('XMLFILES', 'N_95_A.xml');
begin
DBMS_LOB.OPEN(SOURCE, DBMS_LOB.LOB_READONLY);
DBMS_LOB.loadFromFile(CONTENT, SOURCE, DBMS_LOB.getLength(SOURCE));
DBMS_LOB.fileClose(SOURCE);
insert into OFERTY (OFDOCUMENT)
values (sys.XMLtype.createXML(CONTENT));
commit;
end;
and I get
SQL> @e:\myxml\loadXML
declare
ERROR at line 1:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '<'
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
ORA-06512: at line 8
What is wrong?

Have you tried simply outputting iusing the htp.p function? for example:
/* ... inside a PL/SQL region */
declare
   lclb_output clob;
begin
   select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
   htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
end;

Similar Messages

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • Error loading XML Document from /analytics/saw.dll/common/privileges.xml

    I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
    The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
    How can I fix this?

    Hi All,
    You can face this issue with other versions of OBIEE 11.*
    Problem cab be solved as follows:
    Go to http://localhost:7001/em  > coreapplication > Capacity Management > Scalibility >
    1. Lock and edit
    2 .increase number of presentation services to 2
    3. restart opmn component.
    Go to coreapplication > Availibility > processes
    1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
    2. Take down your primary instance.
    3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
    If you want to run primary instance of presentation services
    Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
    except catalog and catalog manager > Copy all other files to coreapplication_obips1
    restart opmn component > problem solved.!!!
    Regards,
    Akshay S.
    please like if you find it helpful

  • Display XML Document from CLOB Column on page

    Hi,
    I have been reading all the CLOB postings that I can find, but I still cannot get my page to do what I want.
    I have a very simjple table:
    MF_XML_DOCS (DOC_ID NUMBER, DOC_XML CLOB)
    I can populate this table OK but I am having problems getting the cotent back out. I want a simple page that takes an ID Number and displays the XML Document for that ID (select doc_xml from mf_xml_docs where doc_id = :P1_DOC_ID). Everything I try either truncates the text (or errors) at 4000 or 32767 characters or reads the XML tags as tags and does not display them. I want a simple display of the XML Document (and I don't mind if it is in an 'updateable' field or not):
    <Parent>
       <name>Dad</name>
       <Children>
          <Child>
             <name>Number 1 Son</name>
         </Child>
          <Child>
             <name>Number 2 Son</name>
         </Child>
       </children>
    </Parent>But when I do something that works for large (32767+) documents all I see is 'Dad Number 1 Son Number 2 Son'.
    Help!!
    many thanks,
    Martin

    Have you tried simply outputting iusing the htp.p function? for example:
    /* ... inside a PL/SQL region */
    declare
       lclb_output clob;
    begin
       select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
       htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
    end;

  • Loading XML Document from JFileChooser

    My initial version of this app I hardcoded the XML filename. Now, I would like to load an xml file via a JFileChooser. The problem I'm having is that I create the DOM Document in the constructor because of dependencies on the JTree. Well, I don't call showDialog until the "open" action is called which is further into the program. By then it's too late. Here is the code. I extracted some unecessary code for reading purposes.
    public class DomGui extends JPanel implements DomGuiConstants, ActionListener
        private JScrollPane treeView;
        private String xmlFilename;
        private Document document;
        private JFileChooser fileChooser;
        private ExtensionFilter fileFilter;
        private static JFrame frame;
        private static JTree jtree;
        public DomGui() throws Exception
            frame = new JFrame(DOM_VIEWER);
            fileChooser = new JFileChooser();
            fileFilter = new ExtensionFilter(XML_EXTENSION, XML_DESCRIPTION);
            // Create the Document
            //xmlFilename = "W:/RoseModel/ImplementationView/seng/ewcs/clwc/Simulation/Utilities/Xml/DomViewer/TVschedule.xml";
            try
                CreateDomDocument createDomDocument = new CreateDomDocument(xmlFilename);
                document = createDomDocument.getDocument();
            catch (FileNotFoundException fnfe)
                System.out.println(fnfe);
                System.exit(1);
            // Create a Tree Model
            DomTreeModel model = new DomTreeModel(document);
            // Create a renderer
            DomTreeCellRenderer  treeCellRenderer = new DomTreeCellRenderer();
            // Create the JTree
            jtree = new JTree(model);
            // Create an Editor
            DomTreeCellEditor treeCellEditor = new DomTreeCellEditor(jtree);
            // Build left-side view
            // an empty tree and put it a JScrollPane so users can see
            // its contents as it gets large
            treeView = new JScrollPane(jtree);
            treeView.getViewport().add(jtree);
            treeView.setPreferredSize(new Dimension( leftWidth, windowHeight ));
            // Create a JSplitPane to hold the left side JTree
            // and the right side JEditorPane
            // Build split-pane view
            splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
                                                       treeView,
                                                       htmlView );
            splitPane.setContinuousLayout( true );
            splitPane.setDividerLocation( leftWidth );
            splitPane.setPreferredSize(new Dimension
                                                        ( windowWidth + 10, windowHeight+10 ));
            // Add GUI components
            this.setLayout(new BorderLayout());
            this.add("Center", splitPane );
        public static void makeFrame()
            int FRAME_WIDTH = 670;
            int FRAME_HEIGHT = 600;
            // Set up the tree, the views, and display it all
            try
                final DomGui guiPanel = new DomGui();
                frame.getContentPane().add("Center", guiPanel );
            catch (Throwable throwable)
                throwable.printStackTrace();
                System.exit(1);
        public void actionPerformed(ActionEvent actionEvent)
            String actionCommand = actionEvent.getActionCommand();
            System.out.println("Action: " + actionCommand);
            if (actionCommand.equalsIgnoreCase("Quit"))
                System.exit(0);
            else if (actionCommand.equalsIgnoreCase("Open"))
                showDialog("Open XML File",
                                 "Open",
                                 "Open the file",
                                 'o',
                                 null);
        // end actionPerformed
        public File showDialog (String dialogTitle,
                                            String approveButtonText,
                                            String approveButtonToolTip,
                                            char approveButtonMnemonic,
                                            File file)
            fileChooser.setDialogTitle(dialogTitle);
            fileChooser.setApproveButtonText(approveButtonText);
            fileChooser.setApproveButtonToolTipText(approveButtonToolTip);
            fileChooser.setApproveButtonMnemonic(approveButtonMnemonic);
            fileChooser.setFileSelectionMode(fileChooser.FILES_ONLY);
            fileChooser.rescanCurrentDirectory();
            fileChooser.setSelectedFile(file);
            fileChooser.addChoosableFileFilter(fileFilter);
            fileChooser.setFileFilter(fileFilter);
            int result = fileChooser.showDialog(this, null);
            System.out.println("Result is: " +result);
            if (result == fileChooser.APPROVE_OPTION)
                System.out.println("I'm Here 1");
                System.out.println("File selected: " + fileChooser.getSelectedFile());
                xmlFilename = fileChooser.getSelectedFile().toString();
                return fileChooser.getSelectedFile();
            else
                System.out.println("I'm Here 2");
                return null;
        // end showDialog
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In your actionPerformed() method, shouldn't you do something with the File returned by showDialog()? For instance:
            else if (actionCommand.equalsIgnoreCase("Open"))
                xmlFilename = showDialog("Open XML File",
                                 "Open",
                                "Open the file",
                                'o',
                                 null).getName();
            }Because it seems that, for now at least, you're choosing a file and then just kinda throwing it away...

  • Load xml file into clob,

    I use the very normal way bfile to load xml file from logical directory, but when I print :that clob variable through sqlplus, a lot of reverse question marks comes out instead of xml.
    What is the problem? Please advice the solution.
    I guess a lot of people may encounter the same problem.
    Thanks for advice.

    Hi Richard,
    This happens when there is a mismatch between the character-set of the XML document and the SQLPLUS character-set.
    -shefali

  • Loading XML files from URL

    Hi.
    My PL/SQL procedure loading xml files from oracle logical directory ("c:\temp") and inserting values into columns of the table. I use XSU with procedure:
    create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    begin
    insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    end;
    For translate xml document to CLOB, I use :
    CREATE OR REPLACE function getdocument(
    p_directory in varchar2,
    p_filename in varchar2)
    return clob
    is
    l_bfile bfile;
    l_clob clob;
    begin
    l_bfile := bfilename(p_directory, p_filename);
    dbms_lob.open(l_bfile);
    dbms_lob.createtemporary(l_clob, true, dbms_lob.session);
    dbms_lob.loadfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile));
    dbms_lob.close(l_bfile);
    return l_clob;
    end getdocument;
    I didn't have problem with this procedures. But now i want load my xml files from another computer (i want use URL, not oracle logical directory).
    How can i do it, using standart PL/SQL methods?

    Since you are parsing the XML what prevents you from delaying your requests for the image URL's? You can just as well add the image URL's to some kind of collection and load them after you have processed all the text content.

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • Unable to find XML document from class path resource

    Hi,
    I am trying to learn spring and wrote my first class today. I added all the jar files to the lib folder and created all the classes. When I try to run the client program I get
    [INFO] XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [MorningGreeting.xml]
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [MorningGreeting.xml]; nested exception is java.io.FileNotFoundException: class path resource [MorningGreeting.xml] cannot be opened because it does not exist
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:180)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
         at com.training.spring.greetCustomers.EnterTraining.main(EnterTraining.java:22)
    Exception in thread "main"
    I have my client, interface, XML file all in the same package com.training.spring.greetCustomers. I could not understand what I am doing wrong?? Can you please help me.

    congratulations on deciding to learn spring. that's a smart thing to do.
    stop assuming that you did it correctly. the xml file is not in the classpath. when you get it there correctly, spring will find it.
    you have the source files and xml in that directory, but where do the .class files end up when you run them? does the xml config end up there, too?
    remember, the xml config should be in the directory where the root of the package hierarchy begins, not down where the .class files are.
    %

  • XML document in CLOB with reference to external DTD

    If you place the xml document in clob using dbms_lob and the document has reference to external (system) DTD then it gives an error 'Error opening external DTD'. Whats the work around. See example below...
    declare
    xmlstring CLOB;
    xmlstring1 CLOB;
    os_file BFILE := bfilename('BFILE_DIR','family.xml');
    > > > rowsp INTEGER; > > > errnum NUMBER; > > > errmsg VARCHAR2(2000);
    > > > time VARCHAR2(20); > > > begin
    > > > select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS')
    > > > into time from dual; > > > dbms_output.put_line(time);
    > > > dbms_lob.createtemporary(xmlstring, true, > > > dbms_lob.session);
    > > > dbms_lob.fileopen(os_file, > > dbms_lob.file_readonly);
    > > > dbms_lob.loadfromfile(xmlstring, os_file,
    > > > dbms_lob.getlength(os_file));
    > > > select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS')
    > > > into time from dual; > > > dbms_output.put_line(time);
    > > > xmlgen.resetOptions; > > > xmlgen.setRowTag('family');
    > > > --xmlgen.setIgnoreTagCase(xmlgen.IGNORE_CASE);
    > > > rowsp := xmlgen.insertXML('family',xmlString);
    > > > dbms_output.put_line(' Rows processed = '&#0124; &#0124; > > > TO_CHAR(rowsp));
    > > > dbms_lob.freetemporary(xmlstring);
    > > > dbms_lob.fileclose(os_file); > > > commit; > > > exception
    > > > when no_data_found then > > > rollback;
    > > > dbms_lob.freetemporary(xmlstring);
    > > > dbms_lob.fileclose(os_file); > > > errnum := abs(SQLCODE);
    > > > errmsg := SQLERRM;
    > > > dbms_output.put_line(errnum&#0124; &#0124;'----'&#0124; &#0124;errmsg); > > > when others then
    > > > rollback; > > > dbms_lob.freetemporary(xmlstring);
    > > > dbms_lob.fileclose(os_file); > > > errnum := abs(SQLCODE);
    > > > errmsg := SQLERRM;
    > > > dbms_output.put_line(errnum&#0124; &#0124;'----'&#0124; &#0124;errmsg); > > > end;

    Can be one of two problems.
    One
    Your database user does not have
    privileges to open a socket inside
    the database. This will prevent
    the XML parser running inside the DB
    from retrieving the DTD which it must
    do to properly parse the document.
    Two
    you are sitting behind a corporate
    firewall and need to properly set
    the Proxy Server host and port to
    properly retrieve the DTD.
    From looking at your code it would appear
    that your job can more easily be done by
    using the OracleXML putXML command line
    utility outside the database.
    You can specify the -D options to your
    JavaVM to set the System properties for
    the proxy server if need be like this:
    java -DproxySet=true -DproxyHost=yourproxyserver OracleXML putXML

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • Heap space error while creating XML document from Resultset

    I am getting Heap space error while creating XML document from Resultset.
    It was working fine from small result set object but when the size of resultset was more than 25,000, heap space error
    I am already using -Xms32m -Xmx1024m
    Is there a way to directly write to xml file from resultset instead of creating the whole document first and then writing it to file? Code examples please?
    here is my code:
    stmt = conn.prepareStatement(sql);
    result = stmt.executeQuery();
    result.setFetchSize(999);
    Document doc = JDBCUtil.toDocument(result, Application.BANK_ID, interfaceType, Application.VERSION);
    JDBCUtil.write(doc, fileName);
    public static Document toDocument(ResultSet rs, String bankId, String interfaceFileType, String version)
        throws ParserConfigurationException, SQLException {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element results = doc.createElement("sims");
            results.setAttribute("bank", bankId);
            results.setAttribute("record_type", "HEADER");
            results.setAttribute("file_type", interfaceFileType);
            results.setAttribute("version", version);
            doc.appendChild(results);
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            String columnName="";
            Object value;
            while (rs.next()) {
                Element row = doc.createElement("rec");
                results.appendChild(row);
                for (int i = 1; i <= colCount; i++) {
                    columnName = rsmd.getColumnLabel(i);
                    value = rs.getObject(i);
                    Element node = doc.createElement(columnName);
                    if(value != null)
                        node.appendChild(doc.createTextNode(value.toString()));
                    else
                        node.appendChild(doc.createTextNode(""));
                    row.appendChild(node);
            return doc;
    public static void write(Document document, String filename) {
            //long start = System.currentTimeMillis();
            // lets write to a file
            OutputFormat format = new OutputFormat(document); // Serialize DOM
            format.setIndent(2);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            try {
                FileWriter writer = new FileWriter(filename);
                BufferedWriter buf = new BufferedWriter(writer);
                XMLSerializer FileSerial = new XMLSerializer(writer, format);
                FileSerial.asDOMSerializer(); // As a DOM Serializer
                FileSerial.serialize(document);
                writer.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            //long end = System.currentTimeMillis();
            //System.err.println("W3C File write time :" + (end - start) + "  " + filename);
        }

    you can increase your heap size..... try setting this as your environment variable.....
    variable: JAVA_OPTS
    value: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • Load XML file from addon domain without cross-domain Policy file

    Hello.
    Assuming that there are two addon domains on the same server: /public_html/domain1.com       and      /public_html/domain2.com
    I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
    So the idea is to use php file in order to load XML and read it back to flash.
    I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
    Here are the AS3/PHP scripts:
    AS3 (.swf in www.domain1.com):
    // location of the xml that you would like to load, full http address
    var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
    // location of the php xml grabber file, in relation to the .swf
    var phpLoc:String = "loadXML.php";
    var xml:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
    loader.addEventListener(Event.COMPLETE, onXMLLoaded);
    loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
    loader.load(request);
    function onIOErrorHandler(e:IOErrorEvent):void {
        trace("There was an error with the xml file "+e);
    function onXMLLoaded(e:Event):void {
        trace("the rss feed has been loaded");
        xml = new XML(loader.data);
        // set to string, since it is passed back from php as an object
        xml = XML(xml.toString());
        xml_txt.text = xml;
    PHP (loadXML.php in www.domain1.com):
    <?php
    header("Content-type: text/xml");
    $location = "";
    if(isset($_GET["location"])) {
        $location = $_GET["location"];
        $location = urldecode($location);
    $xml_string = getData($location);
    // pass the url encoded vars back to Flash
    echo $xml_string;
    //cURLs a URL and returns it
    function getData($query) {
        // create curl resource
        $ch = curl_init();
        // cURL url
        curl_setopt($ch, CURLOPT_URL, $query);
        //Set some necessary params for using CURL
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       //Execute the curl function, and decode the returned JSON data
        $result = curl_exec($ch);
        return $result;
        // close curl resource to free up system resources
        curl_close($ch);
    ?>

    I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
    So I wrote my own script - this time I used file path instead of http address of the XML file.  It works fine in my case.
    Here it is:
    XML file on domain2.com:
    <?xml version="1.0" encoding="UTF-8"?>
    <gallery>
        <image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
        <image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
        <image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
    </gallery>
    swf  on domain1.com:
    var imagesXML:XML;
    var variables:URLVariables = new URLVariables();
    var varURL:URLRequest = new URLRequest("MyPHPfile.php");
    varURL.method = URLRequestMethod.POST;
    varURL.data = variables;
    var MyLoader:URLLoader = new URLLoader;
    MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
    MyLoader.addEventListener(Event.COMPLETE, XMLDone);
    MyLoader.load(varURL);
    function XMLDone(event:Event):void {
        var imported_XML:Object = event.target.data.imported_XML;
        imagesXML = new XML(imported_XML);
       MyTextfield_1.text = imagesXML;
       MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath");  // sample reference to attribute "thumbPath" of the first element
    php file on domain1.com:
    <?php
    $xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml');  // directory to XML file on the same server
    $imported_XML = $xml_file->asXML();
    print "imported_XML=" . $imported_XML;
    ?>
    Regards
    PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed.

  • Creating an XML document from a DTD in Java

    Hi All,
    I need help on the following requirement very badly. Pls help me.
    I have a requirement to implement with java and XML. I am quit new to XML.Can any of you pls help me.
    I have a DTD file. I need to generate XML document from it using java code. I have to use DTD as a template to generate my XML document.
    After going through WEB sites, I understtod that, we have to user Java API JAXB for my requirement. But I could not find JAXB.jar anywhere.
    I need to know the following inforamtion ....
    1. Is my understanding of using JAXB for my requirement is correct?
    2. Where can I get JAXB.jar?
    3. What are the steps to create XML document from a DTD in Java?
    If can give me a sample code for this would help me a lot.
    Pls pls reply me. Your help is greatly appreciated.
    Thanks in Advance.
    Regards,
    Gayathri.

    hi Gayathri,
    iam currently working in the same field.
    firs download jaxb from this link:
    http://java.sun.com/xml/downloads/jaxb.html
    first u need to marshall it.
    cheers
    shashi

Maybe you are looking for

  • Problem with TFRM table active indicator in pricing routine RV80HGEN

    Hi experts, I have created few custom routines in VOFM tcode, and trasported to Q system. In DEV in program RV61ANNN and in VOFM tcode, i can see the new includes and new routines. But when i check in Q system in VOFM  tcode the new routines are not

  • STILL dosen't install!!!!

    I tried 2 betas, java-based installer was just an empty grey box. I hoped they would lose that installer for the final. I download the demo, STILL nothing!!! C'mon guys lose the BS Java-based stuff. java is B.S.!!! It dosen't work on every box, so yo

  • Assistant NET8 and DBCA won't start after installation HELP

    HEllo, I've installed oracle 9.01 and later on 8.1.7 i cannot use the assistants net 8 and dbca after installation. Does anybody have the same problem. I think is has something to do with jre versions. I alse got the same problem when i installed db9

  • IMAQ Vision AVI create - file access denied error

    Hello: I am getting some really strange behavior with the IMAQ Vision AVI create function.  I am seeing the following error with the following file name or pretty much any other file name I try.  I did try to hard code the same file path name, and on

  • Delete E-Mail Account

    I am trying to delete an e-mail account.  I go to accounts and sync but the account I want to delete doesn't show in the list.  There is only my gmail account. When I select the email icon it goes to the account but I can only add an add an account.