3 Replies Latest reply on Mar 12, 2015 5:56 PM by tanvis58867412

    Issues while importing XML using javascript

    tanvis58867412

      Hello! I am importing an xml file in Indesign using javascript.  I have been able to map most of the tags to their proper styles.  The issue that need to be resolved are:

      1.  How to apply bullet paragraph style to tags? 

           When I apply the style called "bullet" to <ul> tag, then Indesign script goes in a loop. It just goes on placing empty textframes forever...

       

      2.  I can import table structures.  But when the text in a cell is longer than the place available, it shows an empty cell there along with a red dot marking error.  How to provide for 'autoflow' of text within      the table cells?

       

      Any help will be greatly appreciated.  I have spent a lot of time searching the web for the same, but have found nothing...

       

      Thanks in advance,

        • 1. Re: Issues while importing XML using javascript
          MW Design Level 4

          I don't use javascript with XML, so take this for what it's worth. You may have better results asking in the scripting forum for #2. It's tied to the default table settings (I think). there is a max on row height if I recall as well.

           

          As for number one, I always have styles in the document to map to elements. Whether character styles or paragraph styles. So from what I read what you are wanting to do, create the style for bulleted paragraphs and map the appropriate element to that style.

           

          Mike

          • 2. Re: Issues while importing XML using javascript
            tanvis58867412 Level 1

            Thanks for your prompt response..

            As for number one, I always have styles in the document to map to elements. Whether character styles or paragraph styles. So from what I read what you are wanting to do, create the style for bulleted paragraphs and map the appropriate element to that style.

            As you have mentioned, I have created character and paragraph styles.  As for mapping tags to styles using javascript, when a bulleted list is encountered, the script goes in a loop(keeps placing empty textframes), may be while applying bullet paragraph style to that tag. 

             

            In the same way the script goes in a loop, if there is a long whitespace in the text...

            • 3. Re: Issues while importing XML using javascript
              tanvis58867412 Level 1

              Solved one problem...  In the indesign file that I use as template, and in which I had defined the Bullet Paragraph style, there was a mistake.  In Paragraph style - Basic Character Formats - "No Break" checkbox was checked.  Once Iremoved that, script no longer goes in a loop.