2 Replies Latest reply on Jan 14, 2010 1:33 PM by TurtleCruiser

    Importing XML Tags in a document

    undef11

      Hello,

       

      I've been trying to import XML Tags in a .indd i created, using the Java API but it does not seem to work (the tags content don't update when i export the document as PDF).  I did the same actions in the InDesign CS4 GUI and it worked like it's supposed to.

       

      I ran the InDesign server using that command: InDesignServer -iorfile c:\ior.txt -pluginpath Server\Corba

       

      I included the .indd file, XML tags file and the Java code I wrote.

       

      EDIT:

      Also, document.getModified() is FALSE, even after calling document.loadXMLTags(...).

      When I exports the tags, all I get is this:

       

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <Root colorindex="0"><Tag colorindex="35"/></Root>

       

      document.countTextFrames() returns 4, which is what is expected.  However document.countXMLTags() returns 2, i'm guessing it's because all my tags are named <Tag...> (+ the <Root> element).  Could that be the cause of my problems?

       

       

      any help will be appreciated, thanks

        • 1. Re: Importing XML Tags in a document
          undef11 Level 1

          I found the answer,  The function I was looking for is importXML.  Still wondering what loadXMLTags() is supposed to do.

          • 2. Re: Importing XML Tags in a document
            TurtleCruiser

            Import XML imports the entire XML file, including the tags and the content, into the document. In the UI, the result would be seen in the Structure View. You can then work with the imported tagged content.

             

            Load XML tags simply loads the tags into the tag list. In the UI, the result would be seen in the tags panel. (This command is also available from the tags panel.) No XML content is imported; only the tag list is populated. This is used when you just want the tags from a document, and you don't want the content. You can then tag new content using the same tags as the XML file.