4 Replies Latest reply on Apr 30, 2009 12:19 AM by kumargobi

    How to Find comment inside tag?

    kumargobi

      In indesign cs3 how to find and match comment inside xml tags using javascript?

       

      reply pls

        • 1. Re: How to Find comment inside tag?
          sudar1983_14 Level 2

          Hi Kumar,

           

          xmlElement.XMLComments

           

          suppose if you have xmlElement.

           

          Regards,

          sudar

          • 2. Re: How to Find comment inside tag?
            kumargobi Level 1

            Hi Sudar,

             

            First Thanks for your reply.

             

            I am trying this code. but it's not working.

             

                 if(myElement.xmlElements.XMLComments.markupTag.name == "ce:index")   

            {
                        alert("Hi");
                      }

            • 3. Re: How to Find comment inside tag?
              sudar1983_14 Level 2

              Hi Kumar,

               

              Can you please explain how you want script?

               

              We have to explain nth element ie

               

              myElement.xmlElements[0].XMLComments[0].value, because markupTag.name is not object.

               

              Read indesign objects, then you know how to get comments

               

              Regards,

              sudar

              • 4. Re: How to Find comment inside tag?
                kumargobi Level 1

                Actually I want to add index topics and page numbers in indesign cs3. But the index topics tags content are in comment inside.

                 

                I am trying below codes and also xml rule.

                 

                function Step1()
                {
                     this.name = "Step1";
                       this.xpath = "//comment()";
                     this.apply = function(myElement, myRuleProcessor)
                     {
                         with(myElement)
                         {
                    try
                    {
                      if(myElement.xmlElements.XMLComments.markupTag.name == "ce:index"){
                       alert("Hi");
                          }         }
                    catch(e){}
                           }              
                    return true;  }     }

                 

                1. First I get the index term from the xml tag in the comment.

                2. To store this any one of the variable.

                3. And add ths content to index topics and also it's the page number.

                 

                Regards,

                Kumar.