0 Replies Latest reply on Dec 20, 2010 11:21 PM by Mac_06

    Map two tag with single style JS[CS4]??

    Mac_06 Level 2

      I've tried to come up with solution but still fail to get anything positive if I wanted to tag two tag(consecutive) to one style e.g. see sample code

       

      <Art>

      <Head1>This first heading</Head1>
      <p>This is <it>first</it> para</p>
      <Head2>This <b>second</b> heading</Head2>
      <body-text>This is body <sup><it>this text should be in italic superscript</it></sup> text para</body-text></Art>

       

      Sample script code:-

       

      var myDocument = app.documents.item(0);
          var myPage = myDocument.pages.item(0);


      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head1"), myDocument.paragraphStyles.item("Head1"));
      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head2"), myDocument.paragraphStyles.item("Head2"));
      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("p"), myDocument.paragraphStyles.item("Para"));
      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("body_text"), myDocument.paragraphStyles.item("Body"));

      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("sup"), myDocument.paragraphStyles.item("Sup"));
      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("it"), myDocument.paragraphStyles.item("Italic"));

      myDocument.xmlImportMaps.add(myDocument.xmlTags.item("b"), myDocument.paragraphStyles.item("Bold"));

       

      //What else could be here kindly suggest

      myDocument.mapXMLTagsToStyles();

       

      My requirement is to apply "SupItalic" style at bold character tags

       

       

      Mac