3 Replies Latest reply on Apr 1, 2013 2:40 PM by regina63

    Mapping XML tags to paragraph styles that contain nested styles

    Adobebowl

      I am importing XML into InDesign (CS5.5) and the tag mapping to styles is working fine until I get to a paragraph style that contains a nested style.

       

      I have a sentence that starts with a number:

       

      1the dog runs fast.

       

      In InDesing properly styled looks like this:

       

           1  The dog runs fast.

       

      (tab)1(tab)The dog runs fast.

       

      The number is styled with a character style (Number) and the whole sentence is styled with a paragraph style (Sentence). In order to get the tabs in between the number, I have a nested style within the paragraph style (Sentence). This triggers the tabs when it hits the character style (Number) like this:

       

      Number up to 2 Tab Characters

       

      In XML, it looks like this

       

      <sentencetag><numbertag>1</numbertag>The dog runs fast.</sentencetag>

       

      Sentencetag is mapped to Sentence paragrph style and Numbertag is mapped to Number character style, but the nested style for the tabs are not displaying. I just get this in IND.

       

       

      1the dog runs fast.

       

      Everything works beautifully until I hit the nested styles, which I do need to get to work somehow. Any help would be much appreciated.

       

      Thanks in advance!

        • 1. Re: Mapping XML tags to paragraph styles that contain nested styles
          Jeffrey_Smith Most Valuable Participant

          A nested style does not create tabs and place within text. It can use pre-existing tabs as markers to then apply a nested character style.

          • 2. Re: Mapping XML tags to paragraph styles that contain nested styles
            Adobebowl Level 1

            Okay, yes, so the tabs are within the paragraph style, and not the nested style. Sorry to be incorrect about that. But the tabs are still not showing up.

            • 3. Re: Mapping XML tags to paragraph styles that contain nested styles
              regina63

              It sounds like your tab characters are actually disappearing from content in the XML. Jeff was responding to the fact that they need to be there, and you state that you originally had them in your document, but they are not showing up once imported through the XML.

               

              The tabs may be disappearing in the XML document due to the "TAB" character in your text editor not being a tab, or at least not properly-formed XML TAB equivalent, OR because you are not "importing whitespace elements" when you import your XML.

               

              Importing whitespace elements can wreak havoc on other things in your XML structure and styled layout within the Indesign document, so I would put the XML quivalent of TAB everywhere a tab should be in your XML, and make sure NOT to import whitespace (when importing XML using "Merge Content", select not to import whitespace items from the import options).

               

              I believe the XML friendly character code for a TAB character is "&#9;" or "&#09;" but have not tested this. Don't include quotes when adding the character code, just the ampersand, semicolon, and everything in-between.

               

              Also, sounds like your tags are mapping ok for you, so your XML should look something like:

              <sentencetag>&#9;<numbertag>1</numbertag>&#9;The dog runs fast</sentencetag>.

               

              It should't matter where you put the TAB character equivalent in relation to your nested tag.