1 Reply Latest reply on Apr 9, 2010 2:28 PM by reppert

    Indesign and xsl not cooperating

    reppert

      Got a new problem with importing xml with xsl into a table in indesign.

      The job works when I use oxygen to make a new xml file from the xml/xsl files.

      Problem is I want to bypass oxygen and have indesign do it on its own.

      XML:

       

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

      <Root>

          <Story>

       

              <TableSection xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table"

                  aid:trows="2" aid:tcols="6">

                  <SectionCode aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"

                      aid:ccolwidth="30.908648796453704">01</SectionCode>

                  <SectionName aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="5"

                      >FRAME</SectionName>

                  <Code aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="30.908648796453704"

                      >PD</Code>

                  <ItemNum aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="100.42931416650917"

                      >IN054B</ItemNum>

                  <Vendor aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="78.3">ALI ARC

                      (AN)</Vendor>

                  <Description aid:table="cell" aid:crows="1" aid:ccols="1"

                      aid:ccolwidth="167.39999999999998">AliArc 92/9400 Bumper &apos;97 &amp;

                      Up</Description>

                  <Price aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="71.56323531584569"

                      >$2,350.00</Price>

                  <Photo aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="90.39880172119148">

                      <Picture

                          href="file:///Y:/M/Maxim/Parts%20Catalog/Design/Indesign/TIRE%20CHAINS%20(NEW%20PARTS).jp g"

                      />

                  </Photo>

              </TableSection>

          </Story>

      </Root>

       

       

      XSL:

       

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

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

          xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" version="1.0">

          <xsl:output method="xml" omit-xml-declaration="no" indent="yes" encoding="US-ASCII"/>

          <xsl:decimal-format name="money" digit="D"/>

          <xsl:key name="SectionKey" match="Story" use="SectionName"/>

          <xsl:template match="/">

              <Root>

                  <Story>

                      <xsl:for-each

                          select="//Story[generate-id(.)=generate-id(key('SectionKey',SectionName))]">

                          <TableSection xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"

                              aid:table="table" aid:tcols="6">

                              <xsl:attribute name="aid:trows">

                                  <xsl:value-of select="TableRows"/>

                              </xsl:attribute>

                              <SectionCode aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"

                                  aid:ccolwidth="30.908648796453704">

                                  <xsl:value-of select="SectionCode"/>

                              </SectionCode>

                              <SectionName aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="5">

                                  <xsl:value-of select="SectionName"/>

                              </SectionName>

                              <xsl:for-each select="key('SectionKey',SectionName)">

                                  <Code aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="30.908648796453704">

                                      <xsl:value-of select="Code"/>

                                  </Code>

                                  <ItemNum aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="100.42931416650917">

                                      <xsl:value-of select="ItemNum"/>

                                  </ItemNum>

                                  <Vendor aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="78.3">

                                      <xsl:value-of select="Vendor"/>

                                  </Vendor>

                                  <Description aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="167.39999999999998">

                                      <xsl:value-of select="Description"/>

                                  </Description>

                                  <Price aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="71.56323531584569">

       

                                      <xsl:value-of select="format-number(Price,'$D,DDD,DD0.00','money')"

                                      />

                                  </Price>

                                  <Photo aid:table="cell" aid:crows="1" aid:ccols="1"

                                      aid:ccolwidth="90.39880172119148"> Picture </Photo>

                              </xsl:for-each>

                          </TableSection>

                      </xsl:for-each>

                  </Story>

              </Root>

          </xsl:template>

      </xsl:stylesheet>

       

       

      Last is the Oxygen xml file it makes that works in indesign, but cant get indesign to make on its own.

       

      Thanks for any help.

        • 1. Re: Indesign and xsl not cooperating
          reppert Level 1

          <?xml version="1.0" encoding="US-ASCII"?>

          <Root xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">

             <Story>

                <TableSection xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:tcols="6" aid:trows="4">

                   <SectionCode aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="30.908648796453704">01</SectionCode>

                   <SectionName aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="5">FRAME</SectionName>

                   <Code aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="30.908648796453704">PD</Code>

                   <ItemNum aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="100.42931416650917">IN054B</ItemNum>

                   <Vendor aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="78.3">ALI ARC (AN)</Vendor>

                   <Description aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="167.39999999999998">AliArc 92/9400 Bumper '97 &amp; Up</Description>

                   <Price aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="71.56323531584569">$2,350.00</Price>

                   <Photo aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="90.39880172119148"> Picture </Photo>

                   <Code aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="30.908648796453704">PD</Code>

                   <ItemNum aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="100.42931416650917">IN064F</ItemNum>

                   <Vendor aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="78.3">ALI ARC (AN)</Vendor>

                   <Description aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="167.39999999999998">AliArc 9900 Bumper</Description>

                   <Price aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="71.56323531584569">$2,261.95</Price>

                   <Photo aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="90.39880172119148"> Picture </Photo>

                   <Code aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="30.908648796453704">PD</Code>

                   <ItemNum aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="100.42931416650917">IN064T</ItemNum>

                   <Vendor aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="78.3">ALI ARC (AN)</Vendor>

                   <Description aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="167.39999999999998">AliArc 9900 Bumper Texas</Description>

                   <Price aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="71.56323531584569">$2,800.51</Price>

                   <Photo aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="90.39880172119148"> Picture </Photo>

                </TableSection>

          ETC.........

          forgot to paste