8 Replies Latest reply: May 16, 2014 3:31 AM by Sid.philander RSS

    DM Studio: Rewriting to an XML file

    Sid.philander

      Hello everybody,

       

      I only have a general question.  Is it possible to rewrite to an xml file which was used for extraction in DM Studio? by using a DAL script?  To put it plainly:  I use getdata from a certain xpath and then i rewrite a new value to the xml file and not the field in DM Studio.

       

      Thank you.

        • 1. Re: DM Studio: Rewriting to an XML file
          user9976634

          I'm not sure I understand what your ultimate goal is, but No, I don't think there are any rules or DAL functions that would let you change your extract XML once it is loaded.

          • 2. Re: DM Studio: Rewriting to an XML file
            Sid.philander

            Let me explain it like this.  Imagine i have an extracted list and i have certain text for random elements that i wish to write to a field, but instead of doing it manually for every field, I would like to run one DAL script.  You said no, so I need to write back to specific fields using a loop.  when i use setfield or any of the other functions to write to a given field, It makes it difficult to automate.

             

            Does that make more sense? Thank you for your effort!

            • 3. Re: DM Studio: Rewriting to an XML file
              user9976634

              Apologies, but I still don't understand your goal.  DAL can certainly be used to get data and assign data to fields - even if you want to get multiple elements to append together into a single line of data to assign to a single field. DAL can't however be used to modify the XML extract in memory.

              • 4. Re: DM Studio: Rewriting to an XML file
                Sid.philander

                Ok i understand that, Ill try and find another method.  I would like to use DAL to return to several fields on different forms and formlists.  I don't know if that is possible, so i thought it might be better to write back to the XML, but you said it's not possible so i won't look into that method anymore.  Thank you!!

                • 5. Re: DM Studio: Rewriting to an XML file
                  user9976634

                  Apologies again, but you keep confusing me with some of your statements. You say "I would like to use DAL to return to several fields on different forms and formslist."  DAL can certainly update fields on different forms. All you have to do is specify the appropriate forms in the SetField() function.

                  The parameters to SetFld can be found in the help and are:  SetFld (data, FieldName, SectionName, FormName, GroupName)

                   

                  So, if you want to set fields on different forms, you just use the appropriate parameters. .

                   

                  This will set the same name field on two different forms (assuming the field exists of course).

                   

                  SetFld("MyData", "MyField", "*", "MyFormA");

                  SetFld("MyData", "MyField", "*", "MyFormB");

                   

                  If you have multiple Forms Lists in a given transaction document and the form, then you can further specify that last parameter to name the group that contains the form that contains the field.

                  • 6. Re: DM Studio: Rewriting to an XML file
                    Sid.philander

                    Hello,

                     

                    Thanks i do understand that.  I have given up, because it seems like there is no method for me with regards to this.  I thank you for your effort nonetheless.  I want to ask you another favour please, I have a new problem.  I want to generate multiple PDF's from one run... either from mulitple xml's or multiprocessing.  Which way would be better and how do i start if i want to make this work - with regards to reading the documentation.  It's overwhelming to think about all the documentation. 

                     

                    Thank you very much!

                    • 7. Re: DM Studio: Rewriting to an XML file
                      user9976634

                      I'm sorry you had to give up when I'm not sure anyone exactly understood what you were trying to accomplish.

                       

                      As for the print question, there are several possible variations on this, but you can start with this INI option.

                       

                      < Print >
                          CallbackFunc             = MultiFilePrint

                       

                      This should give you a separate file per transaction printed.

                      • 8. Re: DM Studio: Rewriting to an XML file
                        Sid.philander

                        Hello,

                         

                        No i gave up, because i understood what you were saying.  It can't be done, the way i planned it in my mind.  I will do the MultiFilePrint and get back to you, when it is accomplished.