Use parameter to define location of xml-file

Hi,
here is a question about importing data from a xml-file using the xfa.host.importdata
A tool we use generates a copy of a 'template'-pdf an put it into a unique folder. This unique folder will contain:
(1) a Batch-file
(2) a fillable, certified, reader-enabled pdf
(3) a xml-file containing data for the pdf
The batchfile will run a command 'start iexplore.exe file://C:/Doc.pdf?Address="C:/Doc.xml"
So, the Internet Explorer will be started, opens the local PDF and creates a parameter with the location of the xml-file.
So, now is my question how to make it work that in the DocReady-event the command xfa.host.importdata(); will be executed pointing to the xml-file. It should be like xfa.host.importdata("C:/Doc.xml");
If I put the command in the click-event of a button, it works fine, but I need help with setting up that command using the parameter.
Thank in advance!
Erik

You will not be able to automate using script the reading of a data file. This is deemed a security risk (as the user is not aware that this iis happening) and as such the user must pick the file.
There is another way though. There is an xml format supported by XFA forms called XML Data Package(XDP). This format keeps the data in teh same way as the xml file but allows a couple of goodies in it. Like the template that was used to create the file. If you open your PDF file and save the data out in that xdp format, then open the file in a text editor you will see a reference to the template that was used to load it. Now if you double click the xdp file then it will open the data file, find the reference to the template and merge the data and template together for you. This is not a security risk because the user casued teh data file to open. Note that this will not work on machines that have Designer on it because the XDP extension is registered with Designer and not Acrobat/Reader. If you change that association in Windows then it will work fine.
So my suggested solution is to make your data files xdp files and add the reference to the template that you want to use and have the user launch the xdp file and you shoudl be able to accomplish what you asked for.
Hope that helps
Paul

Similar Messages

  • Specifying Schema Location in XML file and not in the Java code

    I have a repository of schema xsd files. When I receive my xml file, I need to validate it against the specified schema. The xml file would declare the schema location, using the following syntax:
    <CERD:CERD xsi:schemaLocation = "..\CERD.xsd" xmlns:CERD = "CERD.xsd" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
    Is it really necessary to define the schema location again in the JAVA code? Why set the schemaLocation in the xml file at all then?
    Does anybody have any examples where the schema location is not set in the JAVA code? I am using Java 1.6, and at this point in time I only need to validate. Any help would be appreciated.

    Thank you very much for your quick reply. I have made some progress but I am still stumped.
    In my code I am doing this:
    SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = factory.newSchema();
    Validator validator = schema.newValidator();
    validator.validate(XML_SOURCE);
    I find this works if my schema does not have a target namespace. I have downloaded the following simple example from the internet that uses a target namespace and it fails:
    library1.xsd:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://example.org/prod"
    xmlns:prod="http://example.org/prod">
    <xsd:element name="product" type="prod:ProductType"/>
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="number" type="xsd:integer"/>
    <xsd:element name="size" type="prod:SizeType"/>
    </xsd:sequence>
    <xsd:attribute name="effDate" type="xsd:date"/>
    </xsd:complexType>
    <xsd:simpleType name="SizeType">
    <xsd:restriction base="xsd:integer">
    <xsd:minInclusive value="2"/>
    <xsd:maxInclusive value="18"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    <prod:product xmlns:prod="http://example.org/prod"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="library1.xsd"
    effDate="2001-04-02">
    <number>557</number>
    <size>10</size>
    </prod:product>
    I get the following SAXParseException when I validate:
    [line 4, col 36|
    cvc-elt.1: Cannot find the declaration of element 'prod:product'.
    Am I doing something wrong with the namespace declaration?
    Edited by: alfredamorrissey on Oct 31, 2007 6:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • User Defined Extension functions XML file

    Hi,
    Can we define exception In custom XSLT function XML file.
    Like i have following Custom XSLT function XML-
    <?xml version="1.0" encoding="UTF-8"?>
    <extension-functions>
    <functions xmlns:uppercase="http://www.oracle.com/XSL/Transform/java/oracle.Uppercase">
    <function name="uppercase:GetName" as="string">
    <param name="fname" as="string"/>
    <param name="lname" as="string"/>
    </function>
    </functions>
    </extension-functions>
    So in case i need to throw an exception in my java function GetName so how can i define that in XML?
    Please give some suggestion?
    Thanks.

    Hi,
    Thanks for your reply. When I created extensions.xml (as advised by you) and tried specifying it as User Defined Extension Functions Config file, I get the following error:
    Invalid User Extension Functions Config File
    Invalid value 'object' for attribute:'as' line 5 column 52
    i.e. the following line:
    <function name="extensions:getMSPDate" as="object">
    Any pointers on what will be the correct value for attribute 'as' for element 'function'?
    Also, what is the default namespace being used in the extensions.xml?
    Is there a link for more documentation on the format for extensions.xml?

  • Using jnet/jgantt with a generated XML file

    Hello,
    We want to display a gantt in a BSP page. For that we decided to use the JGantt object (from the graphics bsp extension, using the graphics:net tag).
    From the documentation and examples I saw that to the information is displayed from an XML file in the MIME repository. I wanted to know if it's possible to instead give the XML string as a parameter to the graphics:net object somehow (since it's generated during runtime so I don't have a physical file in the repository). If not, maybe it's possible to create the XML file on the server and receive the URL (it should be a different URL each time because the data might be different).
    I couldn't find any documentation for the properties of the graphics:net tag - maybe the answer is in there (I saw there's an attribute called use_local_mime_repository - what does it mean?).
    Also, if you have other suggestions for showing a gantt it might also be helpful.
    Thanks in advance.

    Hello Udi,
    If you need to pass the whole XML file to an abap variable, you can do it with the help of Ajax.
    You can get back all the contents of a page into a javascript variable and then you will have to assign to a hidden field.
    Then on a button click or any other event you can assign this value to the abap variable and use it where ever needed.
    For learning Ajax in BSP you can refer my blog
    /people/shashank.kapoor/blog/2009/03/09/ajax-in-bsp
    I hope this helps.
    Regards,
    Shashank

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Using Spry.Data.XMLDataSet. Can xml file name be set to change on calendar date?

    I have a website that uses Spry Data XML DataSet to list common pests for the current month. http://www.shspestcontrol.com/
    Each month's list of pests is in a separate xml file (e.g. pests-august.xml)
    Rather than manually updating the file name each month, can it be setup to automatically change the name
    For instance on January 1st, file name changes to pests-january.xml, Feb 1st changes to pests-february.xml. etc.
    <script type="text/javascript">
    <!--
    var dsPests1 = new Spry.Data.XMLDataSet("xml_files/pests-august.xml", "gallery/pests/pest");
    //-->
    </script>
    Any advice if this can be done and if so how to go about doing it would be much appreciated
    Thanks, Toni

    <script>
    var dsPests1 = new Spry.Data.XMLDataSet("pests-september.xml", "gallery/pests/pest");
    function setPestsFile(){
        var months = new Array(13);
            months[0]  = "january";
            months[1]  = "february";
            months[2]  = "march";
            months[3]  = "april";
            months[4]  = "may";
            months[5]  = "june";
            months[6]  = "july";
            months[7]  = "august";
            months[8]  = "september";
            months[9]  = "october";
            months[10] = "november";
            months[11] = "december";
        var now = new Date();
        var monthnumber = now.getMonth();
        var monthname = months[monthnumber];
        dsPests1.setURL("pests-"+monthname+".xml");
        dsPests1.loadData();
    window.onload = setPestsFile();
    </script>

  • Using live HTTP header get This XML file does not appear to have any style information associated with it. The document tree is shown below

    Im using ReloadEvery 3.6.3 & Live HTTP Headers 0.16 plugin's for playin mobsters on myspace. After capturing the the script, editing & placing in the address bar I recieve a message: Failed Security. This XML file does not appear to have any style information associated with it. The document tree is shown below. There was nothing on the Tree. I know the script was edited correct cause it works on the other PC's. Operating system is win7 & Firefox is current. Thx.
    == The first time

    yea I got the same error for playing files on filestube and its just not that, ever since 2 days ago when I updated firefox everything have just started to ..uck up all the time, high cpu memory load without any addons and it wont terminate for another 20secs after I close it... I think I'll just reinstall with an older version, everything worked just fine then

  • Add node at particular location in XML file

    I'd like to add an item to a particular location in an XML file.  Location of parent node is given by string variable "itemtoaddto" and the XML file is given by "myXML":
    function TraverseXMLfile(itemtoaddto,myXML): void {
        var AttributeList:XMLList = myXML.attributes() + myXML.*.attributes() + myXML.*.*.attributes();
         for each (var labelname:XML in AttributeList) {
          if(labelname == itemtoaddto){
            trace (labelname + "match found!!!!!");
            myXML.*.labelname.appendChild(<SON name="Will" bday="01/15" />);
    In the above code, the parent item is being found in fact it's printing the "match found!!!!!" message.  However, the line
           myXML.*.labelname.appendChild(<SON name="Will" bday="01/15" />);
    is giving the following error:
         TypeError: Error #1086: The appendChild method only works on lists containing one item.
    Can someone help please? thanks.

    var myXML:XML = <product>
                                <subAssembly label="Sub1">&#8232;           
                                    <part label="Part1_1"/>&#8232;           
                                    <part label="Part1_2"/>&#8232;           
                                    <part label="Part1_3"/>&#8232;           
                                    <part label="Part1_4"/>&#8232;       
                                </subAssembly>&#8232;       
                                <subAssembly label="Sub2">&#8232;           
                                    <part label="Part2_1">&#8232;               
                                        <feature label="Feature2_1_1"/>&#8232;               
                                        <feature label="Feature2_1_2"/>&#8232;           
                                    </part>&#8232;           
                                    <part label="Part2_2">&#8232;               
                                        <feature label="Feature2_2_1"/>&#8232;               
                                        <feature label="Feature2_2_2"/>&#8232;           
                                    </part>&#8232;       
                                </subAssembly>&#8232;       
                                <subAssembly label="Sub3"> &#8232;           
                                    <part label="Part3_1">&#8232;               
                                        <feature label="Feature3_1_1"/>&#8232;               
                                        <feature label="Feature3_1_2"/>&#8232;           
                                    </part>&#8232;       
                                </subAssembly>&#8232;
                            </product>;
    myXML.subAssembly.(@label == "Sub1")[0].insertChildAfter(myXML.subAssembly.(@label == "Sub1")[0].part[myXML.subAssembly.(@label == "Sub1").part.length() - 1], <part label="Part1_5"/>);
    trace(myXML);
    This traces:
    <product>       
      <subAssembly label="Sub1">          
        <part label="Part1_1"/>      
        <part label="Part1_2"/>
        <part label="Part1_3"/> 
        <part label="Part1_4"/>
        <part label="Part1_5"/>
      </subAssembly>
      <subAssembly label="Sub2">
        <part label="Part2_1">        
          <feature label="Feature2_1_1"/>      
          <feature label="Feature2_1_2"/>    
        </part>  
        <part label="Part2_2">      
          <feature label="Feature2_2_1"/>      
          <feature label="Feature2_2_2"/>   
        </part>
      </subAssembly>
      <subAssembly label="Sub3">
        <part label="Part3_1">       
          <feature label="Feature3_1_1"/>     
          <feature label="Feature3_1_2"/>
        </part>
      </subAssembly>
    </product>

  • Using Query to fetch data from xml file

    Hi guys ,
    Just want to know , how to fetch data from an XML file in adobe flex? i have a database generated xml file.

    you can use httpService.

  • Defining location for iTunes files

    How do I define where my iTunes files are stored?
    I do not mean the music - I know how to do that.
    I mean the files such as iTunes Library.itl
    and especially the (hidden??) folder called iPod_Control.
    FYI: On my laptop, the "My music" folder is on a network drive (at work) which means that I cannot use iTunes when my laptop is at home! All my music is elsewhere on the C drive, but the iTunes control files are not local.

    hi Ghost in the Machine!
    just checking on some things before proceeding
    [My Documents]\My Music\iTunes\iTunes Library.itl
    where [My Documents] is normally c:\My Documents, but in my case is somewhere on a company network file server.
    I suspect that the above path is hard coded into the iTunes software and cannot be changed.
    are you getting a "the folder "itunes" cannot be found or created" message when you aren't connected to the work network?
    do Security Policies on the network allow you to make registry changes to the PC?
    (if so, we may be able to fix this for you.)
    looking back at the earlier post ... the ipod_control folder should only be showing up on your ipod. if it's showing up on a network drive, it's a sign that there's a Windows drive letter confusion going on:
    Windows confuses iPod with network drive and may keep iPod from mounting or songs may seem to disappear
    love, b

  • RejectedMessageHandlers property, can we use it 2 times in bpel.xml file

    hi'
    I have a XML file to read, if the file is incorrect then I am calling another BPEL process to catch the error by the below code
    inside the bpel.xml file
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BPELSuitcase>
    <BPELProcess id="TestFileRead" src="TestFileRead.bpel">
    <partnerLinkBindings>
    <partnerLinkBinding name="ReadFile">
    <property name="wsdlLocation">ReadFile.wsdl</property>
    </partnerLinkBinding>
    </partnerLinkBindings>
    <activationAgents>
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="ReadFile">
    <property name="portType">Read_ptt</property>
    *<property name="rejectedMessageHandlers">bpel://default|GetRejectedMessageBPEL|initiate|payload</property>*
    *<property name="rejectedMessageHandlers">file:///abc/test/fail</property>*
    </activationAgent>
    </activationAgents>
    </BPELProcess>
    </BPELSuitcase>
    Now what I want to do is, I also want to move the rejected file to different directory something like this,
    *<property name="rejectedMessageHandlers">file:///abc/test/fail</property>*
    however If I put both the property inside the bpel.xml file then only one is working which is the later one i.e. it simply ignores the first one. My requirement is, I also want to move the rejected file to different directory, please tell me how this can be achieved, where I want to move the error file to other directory and pass the error details to other BPEL process.
    thanks
    Yatan

    If that is the case...
    do what you are doing in second BPEL in first BPEL catch block and use the property to move the file to folder.
    Ohhhh... Sorry.... It will not go to catch right....
    Regards
    PavanKumar.M
    Edited by: pavan4s on Sep 2, 2010 12:25 AM

  • HO w to use SAX parser to create an XML file on the fly

    Hi All,
    Currently I am using the DOM parser to create an XML file from a text file. But as the DOM takes much memory and inefficient, I need to convert the DOM translator to SAX translator. Can I do that ?? If YES then how to go about that and if NO then what may be the workaround for that.
    Please help me out
    Thanx in advance
    kaushik

    Incidentally, look at this thread:
    http://forum.java.sun.com/thread.jsp?forum=34&thread=252415
    It has an example of how to transform an XML file via XSLT. If you change this to use the zero-argument form of newTransformer, it will apply the "identity transformation" to your input, thus outputting your XML in valid form. Now you just need to figure out how to provide SAX input to this, and the JAXP download includes an example of that.

  • How different Web Services can use a class which parses an XML file

    I am using RAD6.1 for developing and deploying web services.As I am using 15 web Services which uses a common class which is used to parse an XML file.As this XML file should be parsed only once and should be used by all the web services.I have made this common class as Singleton but it works as singleton for only one webservice and for other web service again it is parsing the xml file.I want to parse this xml file only once and used by all the web services.In my case tis file is parsed 15 times for 15 web services, but it should be parse donly once and used by all 15 services.Please give me the solution.
    Thanks and Regards
    Sayeeduzzaman

    Hello,
    the 15 Webservices should have a static attribute which contains the xml:
    private static String xml;
    then initialise the xml like this:
    if (xml == null)
    xml = parseIt();
    else
    //do nothing, XML already initialised!
    }

  • Location of XMl file of a Concurrent Request

    Hi All,
    I have developed a report in XML Publisher. The report runs successfully in DEV. Now this has been migrated to higher instances. The data is not correctly appearing in the report. I want to debug this .
    I understand that when we click on Diagnostics and View XML on the concurrent request ,we see the ..XML file with all the tags generated. Up until this point its working fine.
    My problem comes, while viewing the XML. The XML file with tags stops after few records saying that there is an Invalid character.
    My question here is , "DOES ANY ONE KNOW WHERE DOES THIS XML FILE WITH THE RUNTIME TAGS STORE IN THE APPLICATION"?. Please help me
    Thanks for taking time to read and help me
    Thanks
    Sandeep

    Hi All,
    I have developed a report in XML Publisher. The report runs successfully in DEV. Now this has been migrated to higher instances. The data is not correctly appearing in the report. I want to debug this .
    I understand that when we click on Diagnostics and View XML on the concurrent request ,we see the ..XML file with all the tags generated. Up until this point its working fine.
    My problem comes, while viewing the XML. The XML file with tags stops after few records saying that there is an Invalid character.
    My question here is , "DOES ANY ONE KNOW WHERE DOES THIS XML FILE WITH THE RUNTIME TAGS STORE IN THE APPLICATION"?. Please help me
    Thanks for taking time to read and help me
    Thanks
    Sandeep

  • Location of XML files

    I am looking into using the XML SQL utility to generate XML documents. Is it possible for the XML documents to be output to any location?

    Using the oracle.xml.parser.v2.XMLDocument.print() method is a good place to start. From here you can output the file to any file on your network (with permissions set correctly):
    doc.print(new java.io.FileOutputStream(new File("H:/testing.xml")));

Maybe you are looking for

  • Photoshop cs4 - changes seen only in small layers panel window

    Hello.  I am operating from a mac, using Photoshop, CS4.  When I make any kind of change or alteration to my image, the change shows up only in the layers panel small display window, not on the actual image.  I have the correct layer selected etc.

  • Issue in pricing routine

    Hi, I have an issue while writing code in the pricing routine. while calculating KBETR if the value is 1.035 it is rounding off to 1.04. Since KBETR has only two decimals it is rounding-off but client wants 1.035 only. Please help me. Regards, Anvesh

  • Ip address to fully qualified domain name

    Dear friends, I am unable to get the correct fully qualified domain name from IP address. Please help. I have already spent more than a day searching for the solution on these forums and on google. So now only option remaining is help from you friend

  • HELP dynamically call objects

    I'll try to explain this as best as possible... I have created an applet that has 30 check boxes. I have a button above the check box that reads sort alphabetically. When I click the button I would like the check boxes to sort themselves alphabetical

  • Playing one track after another.

    I have a good deal of classical music and different movements of many works are different tracks. So I have, say, Sonata in A flat, track 1, track 2, etc. I play the first track and then, instead of going to the next track, the ipod skips to a random