7 Replies Latest reply on May 23, 2017 5:42 PM by hoa90519171

    how to give space between words after tag (only followed by letter or number)

    Sen.Soft

      We need to insert space between the words with color and without color.

       

      Example :

       

      wordword - Input

       

      word word - Output (with wordspce between words).

       

      <xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>, the flames broke - Space need not give here

       

      <xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>, the flames broke - (output - same as input)

       

      <xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref>the flames broke - Space need to give. (Input)

       

      <xref role="pink" ref="actrade-9780198119593-miscMatter-1-note-2">then, however</xref> the flames broke (Output)

       

      Conditions

       

      1. Space need to insert only the word followed by any letter or number [a-z] or [0-9].

       

      2. Not in the  word, word (word followed by comma, dot, or any punctuation).

       

      We try to update this by coding but it will give word space on entire document, but we required only word followed by any letter or number [a-z] or [0-9].

       

      var myRuleSet=new Array(new idList1)

      with(doc)

      {

                      var elements = xmlElements;

                      __processRuleSet(elements.item(0), myRuleSet);

      }

       

      function idList1()

      {

           this.name = "idList1";

           this.xpath = "//xref[@role='green']";        

           this.apply = function(myElement, myRuleProcessor)

                         {          

                with(myElement)

                              {

      //myElement.insertTextAsContent(" ",XMLElementPosition.BEFORE_ELEMENT);