8 Replies Latest reply on Jul 17, 2009 1:08 AM by letizia_sechi

    CS3 - Add xmlElement to footnote reference

    sudar1983_14 Level 2

      Hi All,

       

      InDesign/Javascript/Windows/CS3

       

      I am setting the process for Indesign XML, in this process footnote has giving more problems, footnote will not allow to add tags, i want to add the footnote reference number to '<fc>1</fc>' like this.

       

      How can i get the number from footnote?

       

      Regards,

      sudar

        • 1. Re: CS3 - Add xmlElement to footnote reference
          [Jongware] Most Valuable Participant

          Not everything visible in InDesign is "therefore" taggable and exportable as XML. If you need to add a tag for the footnote number, you will have to insert a duplicate number as 'real' text, so you can tag and export this instead. You can "hide" this number by setting its size to 0.1 pt and its fill color to "[None]". However, if you ever insert or remove a footnote, you have to rebuild this information.

           

          To get the 'number' from a footnote, you have to inspect the actual index of the footnote in your current story, as well as the active FootnoteNumberingStyle and FootnoteRestarting values.

          • 2. Re: CS3 - Add xmlElement to footnote reference
            blindcorpse

            Whoa, this is a shock -- one cannot provide XML tags for footnotes, and one can only tag footnote numbers by using static dummies?

             

            I came to this topic by noting the sentence

             

            You can’t tag a footnote.

             

            in the online manual for XML in CS4:

             

            http://help.adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6cf5a.html

             

            I rushed to this forum to see whether there was a related thread, and here I am.

             

            So, let me get this straight: If I compose and format a text in InDesign CS4, preparing styles so that they can be easily exported to XML, I will not be able to tag and then correctly export any footnotes? Is that correct?

             

            And, how about endnotes? (Presumably I could export footnotes to endnotes and then... ?)

             

            I look forward to your guidance, if not from above, at least from Adobe!

            • 3. Re: CS3 - Add xmlElement to footnote reference
              sudar1983_14 Level 2

              Hi blindcorpse,

               

              I have not tried in CS4.

               

              In CS4 will accept xmltags in footnotes, that is,

               

                   xmlElements.placeXML(footnote);

               

              Is it possible?

               

               

              Regards,

              sudar.

              • 4. Re: CS3 - Add xmlElement to footnote reference
                letizia_sechi

                Hi,

                 

                InDesign Cs3/Windows

                 

                I'm trying too to export footnotes in a XML file but I can't because footnote will not allow to add tags. I don't care much about footnote number but I absolutely need to export footnote content and its link to the paragraph. There is no way to make it because "footnote will not allow tags"?

                • 5. Re: CS3 - Add xmlElement to footnote reference
                  Martin Fischer Level 2

                  Hi,

                   

                  well you will have to convert footnotes to text to add tags to them.

                   

                  This is a task that I will have to do in about a few weeks.

                   

                  Use the following code as a first idea and as a skeleton.

                  Given: a tag named 'footnote', a tagged story with footnotes, and the cursor placed in text of the story.

                   

                  var myDoc = app.activeDocument;
                  var myStory = app.selection[0].parentStory;
                  var myNote = myStory.footnotes.firstItem();
                  var myTag = myDoc.xmlTags.item('footnote');
                  
                  // add xmlElement
                  var myXMLElement = myStory.texts.firstItem().associatedXMLElements[0].xmlElements.add({markupTag:myTag});
                  // markup insertionPoint after the footnote
                  myStory.insertionPoints.item(myNote.storyOffset.index+1).markup(myXMLElement);
                  // move text of the footnote into the markedup insertionPoint (leaving footnotenumber and space behind in the footnote)
                  myNote.characters.itemByRange(2,myNote.characters.count()-1).move(LocationOptions.AFTER, myStory.insertionPoints.item(myNote.storyOffset.index+2));
                  // remove footnote
                  myNote.remove();

                   

                  What does it do?

                  1. Add a xmlElement to the associatedXMLElement of the story (with markupTag 'footnote')

                  2. Markup the the insertionPoint after the footnote with this xmlElement.

                  3. Move the text of the footnote into the tagged insertionPoint after the footnote (but leave the number and the space at the beginning of the footnote where it is).

                  4. Remove the footnote.

                   

                  Repeat this while the count of footnotes of the story is not equal to 0.

                   

                  After having converted the footnotes to text (and marked them up with the footnote-tag) you will have to markup more elements of the footnotes like text applied with characterStyles or like paragraphs. Maybe you can do this immediately after the conversion of one footnote to text or you would better do this after the conversion of every footnote to text stepping thru the footnote-xmlElements.

                   

                  Martin

                  • 6. Re: CS3 - Add xmlElement to footnote reference
                    letizia_sechi Level 1

                    Martin, what about the script Footnote2Endnote? Have you ever used it? I'm not able to modify javascript, but do you think there's a way to transform again the endnote in a footnote keeping the tag applied?

                    • 7. Re: CS3 - Add xmlElement to footnote reference
                      Martin Fischer Level 2

                      Hi Letizia Sechi,

                       

                      Footnote2Endnote changes the position of the footnotes in the text.

                      After processing the footnotes are not found at their previous position in text, but at the end of the story.

                       

                      >  but do you think there's a way to transform again the endnote in a footnote keeping the tag applied?

                       

                      Yes I do.

                      But you will have to remember the position where the endnotes should be finally moved to.

                      You will leave the original position of the footnotes in between and move them back later.

                      You will have to know, whereto they have to be moved finally.

                       

                      But why convert footnotes to endnotes, moving the footnotes to the end of the story, and than moving them back to their original position instead of converting them to text at their original position without moving them back and forth?

                       

                      You can tag the endnotes and you can tag the converted footnotes (to text), too.

                       

                       

                      Martin

                      • 8. Re: CS3 - Add xmlElement to footnote reference
                        letizia_sechi Level 1

                        Of course you're right and that's the way your script act, isn't it? I'll try it and let you know. Thanks a lot!