4 Replies Latest reply on Jun 10, 2010 5:34 AM by Larry Tseng

    IDML Import Bug?

    Larry Tseng Level 1

      Hi All,


      Just wondering if anyone can reproduce what appears to be a CS4/CS5 IDML import bug.


      I typed


      11

      22

      33

      44

      55


      (first 3 digits in bold) then tagged "22" as an XML element before exporting an IDML file.


      When the IDML file is imported, I get


      11

      22

      33

      44

      55


      (all digits in boldface except for the trailing 2.)


      The problem seems to be on the import side of CS4/CS5 since the exported IDML looks okay to me:


      ...

      <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/NormalParagraphStyle">

           <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]" FontStyle="Bold">

                <Content>11</Content>

                <Br/>

           </CharacterStyleRange>

           <XMLElement Self="di2i7i6" MarkupTag="XMLTag/Story">

                <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]" FontStyle="Bold">

                     <Content>2</Content>

                     </CharacterStyleRange>

                     <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">

                     <Content>2</Content>

                </CharacterStyleRange>

           </XMLElement>

           <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">

                <Br/>

                <Content>33</Content>

                <Br/>

                <Content>44</Content>

                <Br/>

                <Content>55</Content>

                <Br/>

           </CharacterStyleRange>

      </ParagraphStyleRange>

      ...


      Comments anyone?


        • 1. Re: IDML Import Bug?
          Andreas Fink Level 1

          Hello Larry,

           

          i am the developer of the IDMLlib http://idmllib.com/ a Java library which is able to read/modify/create IDML.

           

          I have also noticed some strange behavior regarding the importing of IDML, where the order of elements affect the parsing of the IDML in CS4/CS5.

          My first thought was, i have created an invalid IDML, but the IDML Relax NG compact schema is very explicit, order doesn´t matter.

           

          The best example i have at hand, which is very easy to reproduce is the TabList. A valid tablist attached to ParagraphStyleRange for example looks like this:

          <TabList type="list">
              <ListItem type="record">
                  <Alignment type="enumeration">LeftAlign</Alignment>
                  <AlignmentCharacter type="string">,</AlignmentCharacter>
                  <Leader type="string"></Leader>
                  <Position type="unit">144</Position>
              </ListItem>
          </TabList>

           

          If you change this by moving the Position to the top, which is no problem regarding the schema which doesn´t enforce a strict order of the elements:

          element Alignment { enum_type, TabStopAlignment_EnumValue }&
          element AlignmentCharacter { string_type, xsd:string }&
          element Leader { string_type, xsd:string }&
          element Position { unit_type, xsd:double })

           

          So if you change this example to this, and reimport the IDML into CS4/CS5 INDD the <Position/> will not be parsed and you wont see a TabList

          <TabList type="list">
               <ListItem type="record">

                  <Position type="unit">144</Position>
                   <Alignment type="enumeration">LeftAlign</Alignment>
                   <AlignmentCharacter  type="string">,</AlignmentCharacter>
                   <Leader type="string"></Leader>
               </ListItem>
          </TabList>

           

          If you export this again as IDML the <Position/> if set to 0

           

          I circumvented this problem by forcing the creation of TabList Items with a constructor that will only allow to create TabListItems with all values present and therefore i can force the order of the created childs. But i think this will not be the only problem where parsing doesn´t do what it is supposed to do.

          There has been a posting from a guy complaining about different import results regarding the attribute order of IDML element:

          http://forums.adobe.com/thread/637711

           

          I will try to reproduce the behavior you decribed.

           

          Cheers, Andreas

          • 2. Re: IDML Import Bug?
            Larry Tseng Level 1

            Hello Andreas,

             

            I've not read the full IDML specification,

             

            http://www.adobe.com/devnet/indesign/pdfs/idml-specification.pdf

             

            but page 11 does say that "IDML requires that some elements and attributes appear in certain order, while scripting DOM can be viewed as random access" -- so perhaps this accounts for the import quirks that you know about regarding element (and attribute) ordering.

             

            In my case, InDesign seems to be flummoxed by the XML tag and fails to make the roundtrip to IDML (that it generated) and back without error.

             

            Thanks for looking into this.

             

            Regards,

             

            Larry

             

            • 3. Re: IDML Import Bug?
              Andreas Fink Level 1

              Hi Larry,

               

              your are absolutely right, and i should have known better, because i have read the specification several times, in the last year.

              At some point i switched to the schema as my reference for the assembly of elements, after i found some inconsistency in the specification.

               

              But that also means, we can´t use the schema to validate the correctness of IDML documents, because the schema doesn´t enforce the order of elements.

               

              I hope i find some time, to test your example, later today.

               

              Cheers

               

              Andreas

              • 4. Re: IDML Import Bug?
                Larry Tseng Level 1

                Hello Andreas,

                 

                >But that also means, we can´t use the schema to validate the

                >correctness of IDML documents

                 

                It sure sounds that way to me. So a "full validation" would have to include

                an IDML to InDesign roundtrip just so you can compare the two IDMLs.

                 

                And I'll bet you'll find an anomaly or two if you do this often enough on a

                wide variety of material.

                 

                Yes, cheers.

                 

                Larry