4 Replies Latest reply on Apr 19, 2016 1:55 AM by karthiks94217840

    How to move Footnote out in Structure - xml structure

    karthiks94217840 Level 2

      Hi King,

       

      I searched in this forum related to XML footnote discussion. Still I need more clarification/discussion related to this process.

      I need maximum input and suggestion related to this topic to streamline our process.

       

      Our projects have around minimum 50 to 900 footnotes for each chapters, our client requirement is XML workflow.

       

      The problem here is all our footnotes have attributes, like [@type='FN']. Below my coding and screenshot also.

       

      I need to move Footnote out in Structure, need in xml structure and applied object style also. Its possible to script?

       

      var mydoc = app.activeDocument;  
      var rootElement = mydoc.xmlElements.item(0);  
      var linkElementList = rootElement.evaluateXPathExpression("//footnote[@type='FN']");  
      for(var lp=linkElementList.length-1; lp>=0; lp--){  
              var myElement = linkElementList[lp];  
                      var myTextframe = myElement.placeIntoInlineFrame(["21p9","5p"]);  
                     //you have create the object style in you active document the object style name is "MN";   
                      myTextframe.appliedObjectStyle= mydoc.objectStyles.item("MN");  
          }  
      alert("Proces Completed");
      
      

       

      Screen Shot 2016-04-18 at 3.54.30 PM.png

       

      Advance Thanks all

        • 1. Re: How to move Footnote out in Structure - xml structure
          b91823603 Level 3

          Hi,

           

          you could use,

           

          var txtFrame = pg.textFrames.add();

          txtFrame .placeXML(myElement);

          • 2. Re: How to move Footnote out in Structure - xml structure
            karthiks94217840 Level 2

            HI B,

             

            Thanks you for your response.

             

            I have marged your code with my code. That marge coding is below.

             

            ********************************************

            var mydoc = app.activeDocument;   

            var rootElement = mydoc.xmlElements.item(0);   

            var linkElementList = rootElement.evaluateXPathExpression("//footnote[@type='FN']");   

            for(var lp=linkElementList.length-1; lp>=0; lp--){   

                    var myElement = linkElementList[lp];   

                            var myTextframe = myElement.placeIntoInlineFrame(["21p9","5p"]);   

                            var txtFrame = mydoc.textFrames.add();

                            txtFrame.placeXML(myElement);

                           //you have create the object style in you active document the object style name is "MN";    

                            myTextframe.appliedObjectStyle= mydoc.objectStyles.item("MN");   

                }   

            alert("Proces Completed");

             

            ********************************************

            This code is right?

             

            @Result: undefined

             

            (Please suggest friend)

             

            Thanks

            • 3. Re: How to move Footnote out in Structure - xml structure
              b91823603 Level 3

              var mydoc = app.activeDocument;  

              var rootElement = mydoc.xmlElements.item(0);  

              var linkElementList = rootElement.evaluateXPathExpression("//footnote[@type='FN']");  

              for(var lp=linkElementList.length-1; lp>=0; lp--){  

                      var myElement = linkElementList[lp];                   

                              var myTextframe = mydoc.textFrames.add();       //If you want give geometricbounds for textFrame

                              myTextframe.placeXML(myElement);

                             //you have create the object style in you active document the object style name is "MN";   

                              myTextframe.appliedObjectStyle= mydoc.objectStyles.item("MN");  

                  }  

              alert("Proces Completed");

              • 4. Re: How to move Footnote out in Structure - xml structure
                karthiks94217840 Level 2

                Hi B,

                 

                Thanks you so mach for help. U are super

                 

                Thanks