0 Replies Latest reply on Apr 28, 2010 4:48 AM by wilmes_b

    How to create a xml element for Text with Java?

    wilmes_b

      Hi @ all,

       

      I want to tag a part of a text with Java.

      Like the InDesign function "Tag für Text" (maybe "tag for text" in english)

       

      tagged text.png

      Is there a way to tag text with Java?

      I tried to autoTag and to markup the text with an existing xml, but only got IdsExceptions.

       

      here the code where to tag the text:

       

      XMLElement newXML = parentXML.addXMLElement(VariableTypeUtils.createString("newXML"),OptArg.noVariableType());

      Text[] texts = para.findText(OptArg.noBoolean());

      for (Text text : texts)

      {

         //TODO tag text

      }

       

      Exception throwing code:

       

      text.autoTag();

      text.markup(newXML);

      newXML.markup(VariableTypeUtils.createObject(text));