3 Replies Latest reply on Apr 23, 2014 1:31 AM by Kai Rübsamen

    Find untag contents in XML workflow

    BEGINNER_X Level 3

      Hi All,

       

      Is it possible to find the untag contents in the xml workflow??

       

      untag.png

      (i.e.,) I need to alert the paragraph start with "Feria vendaepudae........" having untag contents.

       

      Kindly help to find the solution.

       

      Regards

      Siraj

        • 1. Re: Find untag contents in XML workflow
          Kai Rübsamen Adobe Community Professional

          Hi Siraj,

           

          I did not work with xml, but I found a property 'associatedXMLElements' and create the following example:

          One textframe, a list with 5 paragraphs. The list is part of a xml-file and all paragraphs without the first and last paragraph are tagged.

           

           

          var tFrame = app.selection[0];
          var frameParas = tFrame.paragraphs;
          
          for ( var i = 0; i < frameParas.length; i ++ ) {
              var curPara = frameParas[i];
              if ( curPara.associatedXMLElements.length == 1 ) {
                  curPara.select();
                  alert( "Found" );
              } // end if
          } // end for
          

           

          The length of the 'associatedXMLElements' tagged paras is 2, while the length of the untagged paras is 1.

           

          hth

          –Kai

          1 person found this helpful
          • 2. Re: Find untag contents in XML workflow
            BEGINNER_X Level 3

            Hi Kai,

             

            Thank you for your helpful coding...

             

            But I run the same coding in the long file, it fails to produce the result.

             

            I also, just now started the xml workflow.

             

            Any other better solution is appreciable.

             

            Thanks in advance

            Siraj

            • 3. Re: Find untag contents in XML workflow
              Kai Rübsamen Adobe Community Professional

              Hm! If I have a look here with a filter "xml", there are not much attributes about xml, so I would think, we are on the right way?!

               

              http://yearbookmachine.github.io/esdocs/#/InDesign/Paragraph

               

              Maybe it is not a good idea, to hard code the length-value. What does the length-value tell you, if you control 'curPara' in the databrowser? Testfile??