5 Replies Latest reply on Mar 18, 2010 12:49 PM by Steve L Walker

    Execute Script to read XML variable

    Aditya S. Level 1

      How is it possible to read from XML variable? I tried using

       

      patExecContext.getProcessDataDocumentValue

      patExecContext.getProcessDataValue

       

      and it didn't work. Can someone please help

       

      Aditya

        • 1. Re: Execute Script to read XML variable
          Scott Brodersen Adobe Employee

          maybe try getProcessDataStringValue?

          • 2. Re: Execute Script to read XML variable
            Aditya S. Level 1

            It removes the XML tags.

             

            XML Value

             

            <form1>
                <Details>
                    <review_from type="VARCHAR">06292009</review_from>
                    <review_to type="VARCHAR">06282010</review_to>
                    <site_name type="VARCHAR">General Electric Office, Schenectady</site_name>
                    <site_street type="VARCHAR">1 River Road</site_street>
                  </Details>
            </form1>

             

            Resultant Value

             

                    06292009
                    06282010
                    General Electric Office, Schenectady
                    1 River Road

            Aditya

            • 3. Re: Execute Script to read XML variable
              Steve L Walker Level 5

              Try 'getProcessDataValue'.

               

              I did a little test with two process variables

               

              1) xmlData - variable type 'xml'

              2) xmlStr - variable type 'string'

               

              and two services

               

              1) Set Value

               

              /process_data/@xmlStr <> serialize(/process_data/xmlData)

               

              2) Custom Script

               

              String xmlStr = patExecContext.getProcessDataValue("/process_data/xmlStr");

              patExecContext.setProcessDataValue("/process_data/xmlData",xmlStr);

               

              where the value of xmlStr was

               

              <form1>

                  <Details>

                      <review_from type="VARCHAR">06292009</review_from>

                      <review_to type="VARCHAR">06282010</review_to>

                      <site_name type="VARCHAR">General Electric Office, Schenectady</site_name>

                      <site_street type="VARCHAR">1 River Road</site_street>

                  </Details>

              </form1>

               

              and the resulting value of xmlData was

               

              <form1>

                  <Details>

                      <review_from type="VARCHAR">06292009</review_from>

                      <review_to type="VARCHAR">06282010</review_to>

                      <site_name type="VARCHAR">General Electric Office, Schenectady</site_name>

                      <site_street type="VARCHAR">1 River Road</site_street>

                  </Details>

              </form1>

               

              Steve

              • 4. Re: Execute Script to read XML variable
                Aditya S. Level 1

                Are the two services different ways of doing the same thing? Or, you assign the xmldata to xmlstr using setValue and then assign the string value back to xmldata.

                 

                Aditya

                • 5. Re: Execute Script to read XML variable
                  Steve L Walker Level 5

                  I wanted to go through the exercise of passing XML and an XML string through patExecContext.