Read external XML stream into a field

Hello all -
I have been trying to get this working for a week now and still no luck. It seems like it's possible to find field values to external XML file, but Acrobat tries to parse the XML and be smart about it.
I have a custom form logic that needs to read an XML file from a URL and assign the stream to a form field that can later be accessed via FormField.rawValue.
The XML is rather basic - something like
1
2
3
4
I tried the xfa.connectionSet to no avail. I am now trying to bring in that value with SOAP, but have been reading that it might give prompts in Reader.
Can I simply read an external URL and assign the server response to a variable or a field ?
My apologies for the super-basic question!!
Thanks in advance!
Frank

I get the following error, probably means the file referenced is not available...
SQL Error: ORA-22806: not an object or REF
22806. 00000 - "not an object or REF"
*Cause:    An attempt was made to extract an attribute from an item that is
neither an object nor a REF.
*Action:   Use an object type or REF type item and retry the operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Read an XML file into an ABAP program and manipulate it.

    I would like to know if it is possible to do the following in an ABAP program:
    1) Read an XML file into an ABAP internal table
    2) Call an XSLT transformation on the source file and store the results in an ABAP table.
    Is this possible to do? I have used ABAP XSLT in PI, but never in an ABAP program. I see you can use the CALL TRANSFORMATION command, but I have never used it in an ABAP program.
    Kind Regards,
    Tony.

    Check out these blogs.
    XML DOM Processing in ABAP part I -  Convert an ABAP table into XML file using SAP DOM Approach.
    XML DOM Processing in ABAP part II - Convert an XML file into an ABAP table using SAP DOM Approach.

  • Read external XML

    I'm using adobe designer 7 . I want to read external XML file with javascript
    there is a method XMLData.parse(String param1, Boolean param2) but it takes as parameter only string.
    How can I get external XML file convert it to string and pass it to XMLData.parse(param1, param2)?

    You are right there are more than one line in it. But the line which I posted above is the line which parse the string cXMLDoc
    Consider the XML document as first introduced in the example following the XMLData.applyXPath
    method.
    var x = XMLData.parse( cXMLDoc, false );
    var y = x.family.name; // An XFAObject
    console.println(y.value); // Output to console is "Robat"
    Get information about dad.
    y = x.family.dad.id; // An XFAObject
    console.println(y.value); // Output to console is "m2"
    y = x.family.dad.name.value; // y = "Bob"
    x.family.dad.name.value = "Robert"; // Change name to "Robert"
    y = x.family.dad.name.value; // y = "Robert"
    y = x.family.dad.personal.income.value; // y = "75000"
    x.family.dad.personal.income.value = "80000"; // Give dad a raise

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Loading external XML data into XMLObject

    hey all,
    i've been working on a basic fl2 app that generates a list of
    posts from an external XML file located on my server
    (www.omedia.mobi/forum.xml) The swf file is also located there in
    the same directory .(crime.swf).
    The app runs fine in the emulator, both when i tried to load
    the data locally on my mac, and when i load it from the server. But
    when i put the swf file on my N70, it fails to load the data.
    I'm banging my head against a wall trying to get this sorted.
    has anyone had any similar experiences?
    any help would be apprieciated...
    many thanks
    Matt

    Matt–
    Dumb question, are you 100% sure that your phone is making
    any connection to the internet? Does your phone read a name/value
    variable from an external file?
    I just build a file to test this (It won't work
    online—it will only work on a phone.):
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.swf
    The FLA is also up:
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.fla
    Also, you can check out:
    http://www.adobe.com/devnet/devices/articles/flashlite11_rss.html
    quote:
    //Some of the code from the FLA:
    canLoad = _capLoadData;
    if (canLoad == 1) {
    urlPath = "
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.txt";
    loadVariables(urlPath, _root);
    } else {
    connection = "client does not support loading dynamic data";
    // where "connection" is the variable name of the text field
    If the connection is present, then I think I know what is
    wrong. Let me know.

  • XML Parser - Reading an XML document into the DocumentObject

    Hi guys,
    I have been trying to read an XML file and feed it into the XMLParser.
    I have read about the DOM API, and i can work with the DOM API in java
    scripts. How
    will i play with it in TOOL implementation of DOM API. Can anyone guide me
    in this
    process.
    Thanks for your help.
    Laks

    Sorry for this post, here ist the complete text.
    Is it possible to create a XML Parser (javax.xml.parsers.SaxParser or javax.xml.parsers.DocumentBuilder) which reads from a ByteChannel?
    Example:
    java.nio.channels.FileChannel fc = new ...;
    javax.xml.parsers.SaxParser parser = ...;
    org.xml.sax.HandlerBase hb = ...;
    parser.parse( fc, hb );

  • Mapping an XML structure into one field

    Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
    Regards,
    Abhishek.

    Hi,
    Chk this:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Re: Conversion of source XML structure to single string using PI 7.1
    Thanks
    Amit

  • Reading external xml files from a jar

    Hi,
    I am trying to read an xml file from a jar (which is not present inside the jar ) .
    I am passing the file name as a string (like C:/folder/filename) to the SAXBuilder but it throwing
    unknown protocol: c error.
    i tried using an url , tried using a relative path but to no use.
    Need help in this regard urgently.
    TIA,
    Regards,
    Harsha

    Hi,
    Actually, my application needs to read two xml files , parse it, perform some operation and write
    the result to an output file.
    The names of the two xml files i mentioned, are specified in a properties file as absolute paths. (I even tried converting them to URIs)
    The xml files are in the same directory as the jar ( i dont know if it should matter as i am giving the absolute path).
    The main class reads the names of the files and passes the names as strings to the SAXBuilder.
    This is where i am getting an exception.
    Going by what you said, is it not possible for a java class to read a fie outside of the jar ? Is there no way to do this ? And right now i am not sure of how to go about this or if there's any work around . Any help would be appreciated.
    Kindly reply at the earliest
    TIA,
    Harsha

  • Read external xml file

    hi,
    I want to load (some of the) content of an xml file into an
    array. (actionscript in FLEX)
    I found an example at the flex documentation (
    over
    here
    but when i try this examle:
    quote:
    <mx:Script>
    <![CDATA[
    var myXML:XML = new XML();
    var XML_URL:String = "http://www.example.com/Sample3.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    function xmlLoaded(evtObj:Event) {
    myXML = XML(myLoader.data);
    trace("Data loaded.");
    ]]>
    </mx:Script>
    i get two errors:
    - 1120: Acces of undifined property myLoader.
    - 1120: Acces of undifined property mxLoaded
    Can anyone tell me how i can solve this problem?

    You can't do all that stuff outside a function. The variables
    do not exist until they all have been created during the object
    instantiation.
    Declare the variables in the global scope, then do the value
    assignments in a function, say initApp(), that you call in the
    creationComplete event on the Application tag.
    Tracy

  • Examples of hwo to insert an XML file into a field which is of type CLOB

    I am trying to use the following command, but it does not work, due to a type issue, anyone have another example?
    INSERT INTO TEST VALUES (xmltype(bfilename('c:\', 'c:\test.xml') , nls_charset_id('AL32UTF8')));

    I get the following error, probably means the file referenced is not available...
    SQL Error: ORA-22806: not an object or REF
    22806. 00000 - "not an object or REF"
    *Cause:    An attempt was made to extract an attribute from an item that is
    neither an object nor a REF.
    *Action:   Use an object type or REF type item and retry the operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • XML import into floating fields issue

    Probably missing something obvious, but my searches are coming up blank.  Here's the workflow I'm shooting for:<br /><br />-Create form1 in LCD<br />-User fills out form and submits via email the XML data<br />-Create form2 in LCD that uses floating text fields to create a dynamic text document based on the info in form1<br />-Import XML data from form1 into form2<br />-Print form2<br /><br />Most of it works, but there is a subform on form1 that form2 doesn't import the data from.<br /><br />The XML winds up like this:<br /><variable1>Variable 1 Info</variable1><br /><variable2>Variable 2 Info</variable2><br /><subform><br /><variable3>Variable 3 Info</variable3><br /><variable4>Variable 4 Info</variable4><br /></subform><br /><br />In this example, form2 properly imports variable1 and variable2, but ignores variable3 and variable4.  Manually removing the <subform> tags yields the desired result.<br /><br />Something in the text field binding in form2, maybe?<br /><br />Thanks in advance,<br />SyddyS

    The answer appears to lie in the hierarchy and naming. All forms, pages, subforms, etc. have to be named exactly the same and have the same hierarchical flow for the floating text fields to bind properly to imported data. This kind of blows for my purposes, as "form2" had my text fields spread across multiple pages and multiple subforms. Naming all the subforms the same as the subform in "form1" made the first one work, but none of the subsequent.
    If anyone has any alternative thoughts, I'd appreciate it. My workaround is to put ALL of my text fields in form1 on the same level, and then call them out one by one in the scripting to make the ones I want visible or hidden. Wrapping them in a subform just causes too much trouble down the line. Ugly, but functional.
    Thanks,
    SyddyS

  • Read external xml - network problem

    Hi,
    I'm finalizing a project that needs to retrieve weather
    information to display.
    There's a main movie, that loads another movie (wich is
    local). This last one gets xml information, from an external site.
    Localy this works fine, but when I put in a website, the network
    security warning appears.
    I tried to publish with network access, and local. I also
    changed that in the main movie. Triel allowdomain and it seems that
    it can't work.
    Any suggestions?
    Thanks

    Hi,
    its a cross-domain policy problem. If its impossible to put a
    crossdomain.xml file on the external site server, you will have to
    do a workaround like having a php file on your server that get and
    pass the information for you (data can be crunched somewhere on
    your server or being directly transfered between your app <- php
    adapter <- service provider).

  • Read line and split into different fields

    I have a flat file with space (multiple spaces between different fields) as a delimiter. The problem is, file is coming from 3rd party and they don't want to change the separator as comma or tab delimited CSV file. I have to load data in ODS (BW 3x).
    Now I am thinking to load line by line and then split data into different objects in Transfer rules.
    The Records looks like:
    *009785499     BC               2988              244        772       200
    *000000033     AB                     0                  0            0           0
    *000004533    EE                     8                  3            2           4
    Now I want data to split like:
    Field1 = 009785499
    Field2 = BC
    Field3 = 2988
    Field4 = 244
    Field5 = 772
    Field6 = 200
    After 1st line load, go to 2nd line and split the data as above and so on. Could you help me with the code pleaseu2026?
    Is it a good design to load data? Any other idea?
    Thanks.

    Hi Mau,
    First capture the data into the internal table (say itab).
    Loop at itab.
      it_final-field1 = itab+1(9).
      it_final-field2 = itab+12(2).
      it_final-field1 = itab+16(4).
      it_final-field1 = itab+21(3).
      it_final-field1 = itab+25(3).
      it_final-field1 = itab+29(3).
      Append it_final.
    Endloop.
    &*********** Reward Point if helpful**********&

  • How to read an XML file into a java program?

    hi,
    i want to load the following very simple xml file in my java program.
    <root>
    <weblogic>
    <url value="t3://192.168.1.160:7001" />
    <context value="weblogic.jndi.WLInitialContextFactory" />
    </weblogic>
    </root>
    I am getting the error: " Line=1: cvc-elt.1: Cannot find the declaration of element 'root'."
    What might be the problem can anyone help me out.
    My java class code is:
    public class BIXMLReader {
    /** All output will use this encoding */
    static final String outputEncoding = "UTF-8";
    // Parses an XML file and returns a DOM document.
    // If validating is true, the contents is validated against the DTD
    // specified in the file.
    public static Document parseXmlFile(String filename, boolean validating) {
    try {
    // Create a builder factory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setIgnoringComments(false);
    factory.setIgnoringElementContentWhitespace(false);
    factory.setCoalescing(false);
    factory.setValidating(validating);
    // Create the builder and parse the file
    System.out.println("filename = " + filename);
    DocumentBuilder db = factory.newDocumentBuilder();
    // Set an ErrorHandler before parsing
    OutputStreamWriter errorWriter = new OutputStreamWriter(System.err, outputEncoding);
    db.setErrorHandler(new MyErrorHandler(new PrintWriter(errorWriter, true)));
    Document doc = db.parse(new File(filename));
    System.out.println(doc.toString());
    return doc;
    } catch (SAXException e) {
    System.out.println("A parsing error occurred; the xml input is not valid. " + e.getMessage());
    } catch (ParserConfigurationException e) {
    System.out.println("Parser configuration exception has occured");
    } catch (IOException e) {
    System.out.println("IO Exception has occured " + e.getMessage());
    return null;
    // Error handler to report errors and warnings
    private static class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintWriter out;
    MyErrorHandler(PrintWriter out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    // The following methods are standard SAX ErrorHandler methods.
    // See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    }

    ok thanks, i can get the elements, but why did it not validate it?
    I want to read the child nodes of "weblogic" not by their name but by their index. Because i dont want to confine the reader so i want to read all the child nodes of weblogic (looping over them). i m doing the following but its not returning me the correct result and giving me the wrong count of child nodes.
    Element elementNode = (Element)doc.getElementsByTagName("weblogic").item(0);
    NodeList nodeList = elementNode.getChildNodes();
    int length = nodeList.getLength();
    System.out.println("length = "+ length); // the length its giving is 5 but i shuld get only 2
    for(int i=0; i < length; i++) {
    Element elmChild = (Element) nodeList.item(i);
    System.out.println(elmChild.getAttribute("value"));
    what might be the problem?

  • Tree component and loading xml files into text field

    Hello and thank you for taking the time to read my issue....
    I am making a simple self help application.  I have a tree component that loads the different catagories and topics for my help app dynamically via an xml file...no issues there.
    I then want it so that when the user cliecks on the actual topic that the TextArea component will load the info from another xml file using the name of the topic as the name of the xml file to make it that much easier for anyone to maintain this program.
    So far the code i have is this.
    myTreeListener.change = function(eventObject)
        var theSelectedNode = eventObject.target.selectedNode;
        var theSelectedNodeLabel = theSelectedNode.attributes.label;
        topicTextArea.text +=
    I am a little fuzzy when it comes to loading the xml file in.  Should i be loading html instead of xml is my other question as well?
    Thanks in advance for your help
    FG

    Check out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
    Ben

Maybe you are looking for