7 Replies Latest reply on Mar 25, 2016 11:49 AM by MW Design

    xml import runs hours - never get finished

    enzephalon

      Hello

       

      I try to import XML file with XSLT-transformation. It works for a XML-file with around 200 nodes.

      But if I try to import XML-file with around 3000 nodes, the application runs endlessly (more then 8 hours till I killed InDesign) at "Bearbeitung nach Import" (in english I think it's "processing after import"). I've made a screenshot indesign_lags_import_xml.jpg

      I use MacBookPro with 16GB of RAM and 2,5GHz i7 - that has to be enough for this!

       

      This is one node (and the beginning) from my XML-file:

      <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
      <kategorie>
      <artikel><ARTIKELNR>214565</ARTIKELNR><BEZEICHNUNG><![CDATA[(DOLCH) - I & II DigiCD]]></BEZEICHNUNG><TEXT><![CDATA[mysteriöser & avantgardistischer blackmetal für fans von URFAUST ]]></TEXT><VK1BRUTTO>12,99 €</VK1BRUTTO></artikel>
      
      
      

      And this is my XSLT-file:

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
      <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
      
      
      <xsl:template match="/kategorie">
          <Produkte>
           <Tabelle aid:table="table" aid:tcols="3" aid:trows="{count(artikel) + count(artikel/TEXT[text()])}" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/"> 
              
               <xsl:for-each select="artikel">
                  
                   <cell aid:table="cell" aid:ccolwidth="25.30" aid:pstyle="abs_Produkt_Artikelnummer" aid:cstyle="zei_Produkt_Artikelnummer" aid5:cellstyle="zel_Produkt_Artikelnummer" >
                       <xsl:value-of select="normalize-space(ARTIKELNR)"/>
                   </cell>
                   <cell aid:table="cell" aid:ccolwidth="136.76" aid:pstyle="abs_Produkt_Bezeichnung" aid:cstyle="zei_Produkt_Bezeichnung" aid5:cellstyle="zel_Produkt_Bezeichnung">
                       <xsl:value-of select="BEZEICHNUNG"/>
                   </cell>
                   <cell aid:table="cell" aid:ccolwidth="21.55" aid:pstyle="abs_Produkt_VKBrutto" aid:cstyle="zei_Produkt_VKBrutto" aid5:cellstyle="zel_Produkt_VKBrutto">
                       <xsl:value-of select="substring(VK1BRUTTO, 0, string-length(VK1BRUTTO)-1)"/>
                   </cell>
                   <xsl:if test="TEXT/text()">
                       <cell aid:table="cell" aid:ccolwidth="25.30" aid:cstyle="zei_Produkt" aid5:cellstyle="zel_Produkt"></cell>
                       <cell aid:table="cell" aid:ccolwidth="158.31" aid:ccols="2" aid:pstyle="abs_Produkt_Beschreibung" aid:cstyle="zei_Produkt_Beschreibung" aid5:cellstyle="zel_Produkt_Beschreibung">
                           <xsl:value-of select="TEXT"/>
                            <xsl:if test="FREIFELD2/text()">
                            Lieferbare Größen: <xsl:value-of select="FREIFELD2"/>
                            </xsl:if>
                       </cell>
                   </xsl:if>
      
      
               </xsl:for-each>
      
      
           </Tabelle>
        </Produkte>
      </xsl:template>
      
      
      </xsl:stylesheet>
      
      
      

       

      Now I'm in trouble, cause the import must be done today! Can anybody help me with this issue, please?

       

      best regards

      Johannes

        • 1. Re: xml import runs hours - never get finished
          Prithivi_Prepress Level 1

          Check that is there any text gone to overset when you import the XML file, add few additional pages. And check for longest word in content.

          • 2. Re: xml import runs hours - never get finished
            enzephalon Level 1

            A little update.

            My Import works for max 250-300 nodes. If I try to import 800 or 3000 nodes, the import will freeze at "processing after import" and thats it :-( .

            But I do not like to cut my XML into pieces - not to 12 files - if I have 3000 nodes (12 * 250 = 3000). This can't be the solution.

             

            Hey Adobe, what should I do?

             

            best regards

            Johannes

            • 3. Re: xml import runs hours - never get finished
              MW Design Level 4

              I didn't try a super large file, but I did replicate your little sample to 1350 nodes and it imported in about 8 minutes or so.

               

              Capture-000225.png

               

              But there are some issues with your sample and xslt. One, the Euro is not supported using the ISO encoding you are using. Use UTF-16. So I altered the xslt for that. Also, the price element will simply drop off the Euro anyway with the substring. So I also removed that and used the proper means of using it.

               

              Capture-000226.png

               

              Oh, I also widen the number and the price cells a bit. It imported fine.

               

              Capture-000228.png

               

              If you still need help, give a shout in the thread. I just got out of the hospital and so if I don't get back to the thread, send me a PM--I have notifications for threads shut off, but the PM will hit my email.

               

              Mike

              • 4. Re: xml import runs hours - never get finished
                enzephalon Level 1

                Hey Mike

                 

                Thanks for your reply.

                After some adjustments, I was able to import a XML-file with 806 nodes. Took 15 minutes or so.

                Happy about that, I now try to import the 3000-nodes file. This import stands still like described above.

                 

                My new XLST is

                <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
                
                
                <xsl:template match="/kategorie">
                    <CDs>
                    <Tabelle aid:table="table" aid:tcols="3" aid:trows="{count(artikel) + count(artikel/TEXT[text()])}" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                       
                        <xsl:for-each select="artikel">
                           
                            <cell aid:table="cell" aid:ccolwidth="25.30" aid:pstyle="abs_Produkt_Artikelnummer" aid5:cellstyle="zel_Produkt_Artikelnummer" >
                                <xsl:value-of select="normalize-space(ARTIKELNR)"/>
                            </cell>
                            <cell aid:table="cell" aid:ccolwidth="136.76" aid:pstyle="abs_Produkt_Bezeichnung" aid5:cellstyle="zel_Produkt_Bezeichnung">
                                <xsl:value-of select="BEZEICHNUNG"/>
                            </cell>
                            <cell aid:table="cell" aid:ccolwidth="21.55" aid:pstyle="abs_Produkt_VKBrutto" aid5:cellstyle="zel_Produkt_VKBrutto">
                                <xsl:value-of select="VK1BRUTTO"/>
                            </cell>
                            <xsl:if test="TEXT/text()">
                                <cell aid:table="cell" aid:ccolwidth="25.30" aid5:cellstyle="zel_Produkt"></cell>
                                <cell aid:table="cell" aid:ccolwidth="158.31" aid:ccols="2" aid:pstyle="abs_Produkt_Beschreibung" aid5:cellstyle="zel_Produkt_Beschreibung">
                                    <xsl:value-of select="TEXT"/>
                                      <xsl:if test="FREIFELD2/text()">
                                      Lieferbare Größen: <xsl:value-of select="FREIFELD2"/>
                                      </xsl:if>
                                </cell>
                            </xsl:if>
                
                        </xsl:for-each>
                
                    </Tabelle>
                  </CDs>
                </xsl:template>
                </xsl:stylesheet>
                

                 

                Whyever UTF-16 doesn't work for me, UTF-8 works fine.

                But why the import stucks - I don't know...

                 

                best regards

                Johannes

                • 5. Re: xml import runs hours - never get finished
                  MW Design Level 4

                  Hi Johannes,

                   

                  Hopefully it works. Let us know.

                  • 6. Re: xml import runs hours - never get finished
                    enzephalon Level 1

                    Hello

                     

                    I had to cut my XML file into 3 pieces with 1000 nodes each. These I was able to import.

                    In case of larger files (1500 nodes) the import freezes.

                    Importing, reloading - these are unbelievable slow, taking 30 or more minutes - on a performance machine! Whats wrong with InDesign? Such easy xml-transformation can be done by php in seconds!

                    I did a "benchmark" with other computer: Core2Dueo 3GHz Windows7 64bit InDesign CS5. Imported the whole 3000 nodes xml file - the import was running 3 hours!

                     

                    best regards

                    Johannes

                    • 7. Re: xml import runs hours - never get finished
                      MW Design Level 4

                      So do the transformation in PHP. I use a dedicated XML editor to do such things. With the transformed xml being loaded it takes ID 10 minutes or a little less. It should be faster, but it isn't. Xml hasn't been updated for a long, long time that I know of.