6 Replies Latest reply on Jul 26, 2013 4:36 AM by Chad Chelius

    how to convert xslt to InDesign code

    kanaga kumar Level 1

      Dear Friends,

       

      I am newly in XSLT process, i have converted xml to xslt file but this xslt file is not support in indesign CS5. Please see below the xslt translated coding file for example:

       

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

      <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

      <title>Pravilnik br. 49 Gospodarske komisije kapljeni naftni plin)</title>

      <book-subtitle>Jedinstvene odn vozila.</book-subtitle>

      <para>Uključuje sav važeći tekst do:</para>

      <para>05 Serije izmjena – dan stupanja na snagu:</para>

       

      How to convert indesign support coded file. Kindly give example coded file based on above mentioned code file.

       

      Thanks for your help.

      kanaga kumar. k

        • 1. Re: how to convert xslt to InDesign code
          MW Design Level 4

          You use an XSLT to make changes to an XML file either before or during the XML import. It is the XML file that is used in ID.

           

          Mike

          • 2. Re: how to convert xslt to InDesign code
            kanaga kumar Level 1

            Dear Mike,

             

            Thanks for your reply, can you give me simple XSLT (ID support) coding for example.

             

            XSLT File:

             

            <?xml version='1.0'?>

            <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

            <xsl:template match="TI/P">

            <xsl:if test="ancestor::TITLE">

            <title><xsl:apply-templates/></title>

            </xsl:if>

            </xsl:template>

            <xsl:template match="STI/P">

            <xsl:if test="ancestor::TITLE">

            <book-subtitle><xsl:apply-templates/></book-subtitle>

            </xsl:if>

            </xsl:template>

            <xsl:template match="P">

            <xsl:if test="parent::CONTENTS">

            <p><xsl:apply-templates/></p>

            </xsl:if>

            </xsl:template>

             

            XML file:

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

            <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

            <title>Pravilnik br. 49 Gospodarske komisije kapljeni naftni plin)</title>

            <book-subtitle>Jedinstvene odn vozila.</book-subtitle>

            <para>Uključuje sav važeći tekst do:</para>

            <para>05 Serije izmjena – dan stupanja na snagu:</para>

             

             

            How to convert indesign support XSLT file, and kindly provide simple level xslt model for ID support coded.

             

            Thanks for your help,

            kanaga kumar. k

            • 3. Re: how to convert xslt to InDesign code
              Chad Chelius Adobe Community Professional

              Kanaga,

               

              I'm not quite sure what you are asking for here. It is true that the XSLT processor in InDesign is not as robust as it could be. In many of the InDesign XML projects that I work on, I simply apply the XSLT to the XML content externally using a program such as Oxygen, then import the transformed XML into InDesign. In my experience, I've found that only the simplest of XSLT transformations can be applied directly in InDesign. I hope that helps.

              • 4. Re: how to convert xslt to InDesign code
                kanaga kumar Level 1

                Dear Chad,

                 

                Thanks for guiding, but i have little bit confustion for XSLT--ID process.

                 

                How the XSLT File is linked to the Adobe Indesign Styling, could you suggest some example.

                 

                Thanks for your help

                kanaga kumar. k

                • 5. Re: how to convert xslt to InDesign code
                  MW Design Level 4

                  Without seeing more of your XML file, I cannot really tell what it is you are wanting to accomplish with the XSLT.

                   

                  Your XMl (and the XSLT) are what is called, "Ill formed." That is, neither are properly closed.

                   

                  Properly formed, your XML file would look something like:

                   

                  <dataroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                  <title>Pravilnik br. 49 Gospodarske komisije kapljeni naftni plin)</title>

                  <book-subtitle>Jedinstvene odn vozila.</book-subtitle>

                  <para>Ukljucuje sav važeci tekst do:</para>

                  <para>05 Serije izmjena – dan stupanja na snagu:</para>

                  </dataroot>

                   

                  And would import into ID like the screen shot:

                  capture-000455.png

                   

                  Take care, Mike

                  • 6. Re: how to convert xslt to InDesign code
                    Chad Chelius Adobe Community Professional

                    Kanaga,

                     

                    The XSLT itself is not actually linked to the InDesign Styles, the XML content is. If you go to the panel menu of the Structure pane or the Tags panel, you'll see "Map Tags to Styles" and "Map Styles to Tags". These two options provide a method to either style imported XML content (Map Tags to Styles) or a method to Tag Styled InDesign text (Map Styles to Tags). The XSLT is just transforming your data before it gets imported into InDesign or exported out of InDesign.