4 Replies Latest reply on Aug 20, 2013 9:27 AM by MW Design

    Assign paragraph-styles to xml-tags correctly. How to?

    daiaiai

      Hi,


      I want to assign xml-tags to existing paragraph styles in InDesign CS6 on a Mac 10.6.8. The xml itself is organized like this:


      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <katalog>

      <artikel id="32434">

      <img href="/bilder/32434.tiff" />

      <artikeltextgruppe>

      <artikelmarke>DieselGabana</artikelmarke>

      <artikelheadline>Jeans ist super</artikelheadline>

      <artikeltext>Superjeans knallt rein.</artikeltext><artikelnummer>70238</artikelnummer>

      <artikelmaterial>100% Jeans</artikelmaterial>

      <artikelgroesse>Uni</artikelgroesse>

      <artikelfarbe>Uni</artikelfarbe>

      </artikeltextgruppe>

      </artikel>

      </katalog>


      By selecting the option "Assign formats per name to the tags" (translated from German) I wanted to generate the desired look. But if I start this all I get is the whole textblock of <artikeltextgruppe> assigned to 1 formatstyle. And besides that the whole content of <artikeltextgruppe> looks like one single paragraph without any structure (no linebreaks) The content though is correctly structured because I can highlight the value of e.g. <artikelmarke>separately by doubleclicking this tag in the structure-view.


      a) What can I do to assign the formats correctly AND to have correct linebreaks?

      b) If I drag my node <img href="/bilder/32434.tiff" /> iin the layout I get a message displayed to search again for the correct reference location. And that happens independently on using relative or absolute references (Although I need to use relative ones) What can I do here?

       

      thanks so much

        • 2. Re: Assign paragraph-styles to xml-tags correctly. How to?
          MW Design Level 4

          First, I would probably do a search and replace to remove the group element using a text editor (the <artikeltextgruppe> and </artikeltextgruppe> elements). They really are not needed.

           

          Second, I usually create my styles with the same names as the elements themselves. Then, after the XML is imported, I use the "map tags to styles" command from the Structure pane.

           

          I copied and pasted the single artikel element to create 4 records, added a varition of an image to each element record. Once the paragraph styles were mapped, your XML looked like this in a two column format (to get all 4 records on a page)...

           

          capture-000506.png

          By default, ID will create a single line to a single line in the XML. So if you desire elements to be on their own line, the XML needs to be formatted that way. If you need different styling within a paragraph, you need to create character styles and alter the elements within an XML group and or paragraph and add the code in the XML accordingly or post process once inside of ID.

           

          I always need to take the XML I am given and reformat, move elements with the tree, change links to images, remove tabs and or spaces where I do not want them, tag for character styles, etc., to get close to how I want the initial format to be.

           

          Mike

          • 3. Re: Assign paragraph-styles to xml-tags correctly. How to?
            daiaiai Level 1

            Hi Mike,

             

            thanks so much for your answer. Indeed I have a question yet:

             

            Would it be possible for you to add me the packed indd-file right here somehow? Because what you did here is  pretty much exactly the way I want things to be and I don't really get it done by myself although I use "map tags to styles" and do use the exact same format/tag-names. And by using your file I could check what I did wrong in my process.

             

            Thanks so much already

            Florian

            • 4. Re: Assign paragraph-styles to xml-tags correctly. How to?
              MW Design Level 4

              Hi Florian,

               

              I'll ZIP up the sample file and upload it to my server. Then I will send you a link via the Private message system. It'll take me a few minutes as I am uploading a large client file right now.

               

              Take care, Mike