9 Replies Latest reply on Apr 27, 2016 4:54 AM by ggt667

    XML Import NOT Working FMP11 - Help!!

    MikeGilbertson

      Title

      XML Import NOT Working FMP11 - Help!!

      Post

           First...I am not a programmer. That said, I need to import Customer orders received via non-FMP XML. It's just not working and I can't find any documentation to help. What am I doing wrong?

           My XSL;

           <?xml version='1.0' encoding='UTF-8' ?>
           <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/ XSL/Transform'>
                 <xsl:output version='1.0' encoding='UTF-8' indent='no' method='xml' />
                 <xsl:template match='/'>
           <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
           <ERRORCODE>0</ERRORCODE>
           <PRODUCT BUILD="01-25-2011" NAME="FileMaker" VERSION="ProAdvanced 11.0v3"/>
           <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="PartSimple Orders.fp7" RECORDS="2" TIMEFORMAT="h:mm:ss a"/>
           <METADATA>
           <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Backorderable" TYPE="TEXT"/>
           <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="BrandName" TYPE="TEXT"/>
           </METADATA>
              <RESULTSET FOUND="">
                   <xsl:for-each select="/VendorOrderItems">
               <ROW>
                   <COL><DATA><xsl:value-of select="/Backorderable"/></DATA></COL>
                   <COL><DATA><xsl:value-of select="/BrandName"/></DATA></COL>
               </ROW>
                   </xsl:for-each>
           </RESULTSET></FMPXMLRESULT>
                 </xsl:template>
           </xsl:stylesheet>

           CUSTOMER XML

            

      <VendorOrders>
      <Transmission>
      <TransmissionID>9890</TransmissionID>
      <SenderID>PARTSIMPLE</SenderID>
      <ReceiverID>RAPIDTECH</ReceiverID>
      <DateCreated>2013-04-16 17:52:03</DateCreated>
      </Transmission>
      <VendorOrder>
      <CustomerOrderNumber>100009927</CustomerOrderNumber>
      <VendorOrderState>N</VendorOrderState>
      <Region>USA</Region>
      <Currency>USD</Currency>
      <RequestedCarrier/>
      <RequestedShipService>1</RequestedShipService>
      <ShippingAcctNumber>11111</ShippingAcctNumber>
      <MustShipComplete>N</MustShipComplete>
      <ClientProgram>
      <ClientProgramBrand>PartSimple.com</ClientProgramBrand>
      <ClientProgramPhone>1-888-399-2787</ClientProgramPhone>
      <ClientProgramEmail>help@PartSimple.com</ClientProgramEmail>
      <ReturnMessage>Returns Message: All claims for product that is damaged in shipping or missing contents must be made within 5 days of receipt of goods. Returns must be authorized by going to PartSimple.com to obtain a Return Authorization Number. All returned products must be received by the warehouse within 30 days of original shipment</ReturnMessage>
      </ClientProgram>
      <ShipToAddress>
      <ShipToName>Shafi A</ShipToName>
      <ShipToCompany/>
      <ShipToAddressLine1>216 NORTH MAIN</ShipToAddressLine1>
      <ShipToAddressLine2/>
      <ShipToCity>JEWETT</ShipToCity>
      <ShipToProvince>TX</ShipToProvince>
      <ShipToCountry>USA</ShipToCountry>
      <ShipToPostalCode>75846</ShipToPostalCode>
      <ShipToPhoneNumber>90362644111</ShipToPhoneNumber>
      </ShipToAddress>
      <VendorOrderItems>
      <VendorOrderItem>
      <CustomerOrderLineNumber>1</CustomerOrderLineNumber>
      <VendorOrderItemState>N</VendorOrderItemState>
      <OrderedVendorSKU>2061000</OrderedVendorSKU>
      <BrandName>ADAPTEC</BrandName>
      <ItemNumber>2061000</ItemNumber>
      <ItemCondition>N</ItemCondition>
      <Substitutable>Y</Substitutable>
      <Backorderable>Y</Backorderable>
      <Description>Adaptec 39320A-R RAID Ultra320 SCSI PCI-X 2CH 64bit 1-Pack 2061000</Description>
      <Quantity>1</Quantity>
      <UnitCost>40.00</UnitCost>
      <MustShipComplete>Y</MustShipComplete>
      </VendorOrderItem>
      </VendorOrderItems>
      </VendorOrder>
      </VendorOrders>

            

        • 1. Re: XML Import NOT Working FMP11 - Help!!
          MikhailEdoshin

               Try to change these::

          <xsl:for-each select="//VendorOrderItem"> <-- two slashes and Item, not Items
          
          <xsl:value-of select="BackOrderable" /> <-- no slash
          
          <xsl:value-of select="BrandName" /> <-- no slash
          • 2. Re: XML Import NOT Working FMP11 - Help!!
            MikeGilbertson

                 Thank you for your quick assistance. I'm pulling my hair out over here.  Below are the changes I made per your recommendation...

                    <RESULTSET FOUND="">
                         <xsl:for-each select="//VendorOrderItem">
                     <ROW>
                         <COL><DATA><xsl:value-of select="Backorderable"/></DATA></COL>
                         <COL><DATA><xsl:value-of select="BrandName"/></DATA></COL>
                     </ROW>
                         </xsl:for-each>
                 </RESULTSET></FMPXMLRESULT>

                 I don't get any error message when it runs. It does add a record to the database....but it doesn't put the values in the XML file for those elements.

                 Any other ideas?

                  

            • 3. Re: XML Import NOT Working FMP11 - Help!!
              MikhailEdoshin

                   Hmm. Please test again and make sure you're using correct XSLT. I've just checked the XSLT with this XML and it worked. Here's the XSLT I've checked:

                    

                   <?xml version='1.0' encoding='UTF-8' ?>
                   <xsl:stylesheet version='1.0'
                       xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
                     <xsl:output version='1.0' encoding='UTF-8' indent='no' method='xml' />
                     <xsl:template match='/'>
                       <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
                         <ERRORCODE>0</ERRORCODE>
                         <PRODUCT BUILD="01-25-2011" NAME="FileMaker"
                             VERSION="ProAdvanced 11.0v3"/>
                         <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT=""
                             NAME="PartSimple Orders.fp7" RECORDS="2" TIMEFORMAT="h:mm:ss a"/>
                         <METADATA>
                           <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Backorderable"
                           TYPE="TEXT"/>
                           <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="BrandName" TYPE="TEXT"/>
                         </METADATA>
                         <RESULTSET FOUND="">
                           <xsl:for-each select="//VendorOrderItem">
                             <ROW>
                               <COL>
                                 <DATA>
                                   <xsl:value-of select="Backorderable"/>
                                 </DATA>
                               </COL>
                               <COL>
                                 <DATA>
                                   <xsl:value-of select="BrandName"/>
                                 </DATA>
                               </COL>
                             </ROW>
                           </xsl:for-each>
                         </RESULTSET>
                       </FMPXMLRESULT>
                     </xsl:template>
                   </xsl:stylesheet>
                    
                   Try to import the records manually and when FileMaker shows the field mapping window, try to flip between records using the arrows below (if they work, that is).
              • 4. Re: XML Import NOT Working FMP11 - Help!!
                MikeGilbertson

                     I have duplicated your XSLT here (below). However, I'm still getting a blank record on importing the XML

                     I tried  clicking the arror in the field mapping window. It starts with "Field Names" and I see Backorerable pointing to Backorderable in the Target. When I click the right arrow I was expecting to see data....and I see blank fields in Record 1 of 1.  Btw...here the original XML I received from the Customer...

                     <?xml version="1.0" encoding="UTF-8"?>  <VendorOrders>    <Transmission>      <TransmissionID>9890</TransmissionID>      <SenderID>PARTSIMPLE</SenderID>      <ReceiverID>RAPIDTECH</ReceiverID>      <DateCreated>2013-04-16 17:52:03</DateCreated>    </Transmission>    <VendorOrder>        <CustomerOrderNumber>100009927</CustomerOrderNumber>        <VendorOrderState>N</VendorOrderState>        <Region>USA</Region>        <Currency>USD</Currency>        <RequestedCarrier></RequestedCarrier>        <RequestedShipService>1</RequestedShipService>        <ShippingAcctNumber>11111</ShippingAcctNumber>        <MustShipComplete>N</MustShipComplete>    <ClientProgram>        <ClientProgramBrand>PartSimple.com</ClientProgramBrand>        <ClientProgramPhone>1-888-399-2787</ClientProgramPhone>        <ClientProgramEmail>help@PartSimple.com</ClientProgramEmail>        <ReturnMessage>Returns Message: All claims for product that is damaged in shipping or missing contents must be made within 5 days of receipt of goods. Returns must be authorized by going to PartSimple.com to obtain a Return Authorization Number. All returned products must be received by the warehouse within 30 days of original shipment</ReturnMessage>  </ClientProgram>    <ShipToAddress>      <ShipToName>Shafi A</ShipToName>      <ShipToCompany></ShipToCompany>      <ShipToAddressLine1>216 NORTH MAIN</ShipToAddressLine1>      <ShipToAddressLine2></ShipToAddressLine2>      <ShipToCity>JEWETT</ShipToCity>      <ShipToProvince>TX</ShipToProvince>      <ShipToCountry>USA</ShipToCountry>      <ShipToPostalCode>75846</ShipToPostalCode>      <ShipToPhoneNumber>90362644111</ShipToPhoneNumber>    </ShipToAddress><VendorOrderItems>      <VendorOrderItem>        <CustomerOrderLineNumber>1</CustomerOrderLineNumber>        <VendorOrderItemState>N</VendorOrderItemState>        <OrderedVendorSKU>2061000</OrderedVendorSKU>        <BrandName>ADAPTEC</BrandName>        <ItemNumber>2061000</ItemNumber>        <ItemCondition>N</ItemCondition>        <Substitutable>Y</Substitutable>        <Backorderable>Y</Backorderable>        <Description>Adaptec 39320A-R RAID Ultra320 SCSI PCI-X 2CH 64bit 1-Pack 2061000</Description>        <Quantity>1</Quantity>        <UnitCost>40.00</UnitCost>        <MustShipComplete>Y</MustShipComplete>      </VendorOrderItem></VendorOrderItems></VendorOrder></VendorOrders>
                      

                     I'm running Windows 7 if that makes any difference.

                     My XSLT...

                     <?xml version='1.0' encoding='UTF-8' ?>
                     <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/ XSL/Transform'>
                           <xsl:output version='1.0' encoding='UTF-8' indent='no' method='xml' />
                           <xsl:template match='/'>
                     <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
                     <ERRORCODE>0</ERRORCODE>
                           <PRODUCT BUILD="01-25-2011" NAME="FileMaker"
                               VERSION="ProAdvanced 11.0v3"/>
                     <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="PartSimple Orders.fp7" RECORDS="2" TIMEFORMAT="h:mm:ss a"/>
                           <METADATA>
                             <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Backorderable"
                             TYPE="TEXT"/>
                             <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="BrandName" TYPE="TEXT"/>
                           </METADATA>
                           <RESULTSET FOUND="">
                             <xsl:for-each select="//VendorOrderItem">
                               <ROW>
                                 <COL>
                                   <DATA>
                                     <xsl:value-of select="Backorderable"/>
                                   </DATA>
                                 </COL>
                                 <COL>
                                   <DATA>
                                     <xsl:value-of select="BrandName"/>
                                   </DATA>
                                 </COL>
                               </ROW>
                             </xsl:for-each>
                           </RESULTSET>
                     </FMPXMLRESULT>
                           </xsl:template>
                     </xsl:stylesheet>

                • 5. Re: XML Import NOT Working FMP11 - Help!!
                  MikhailEdoshin

                       Hmm. What I can tell from here is that the XML is OK and the XSLT is OK too. I'm attaching a screenshot of how it looks on my machine: everything is as expected. This is Windows 7 and FileMaker 11 too. I'm really kind of lost here :) Are you sure you're importing the right file? Maybe there is another similar file that has same "VendorOrderItem" elements but no data in these two fields or no such fields at all? If the file is OK, then I can only suspect something wrong with the installation.

                  • 6. Re: XML Import NOT Working FMP11 - Help!!
                    MikeGilbertson

                         Thank you for your continued help....you have been great.

                         Wow....does that screen shot look good. That's exactly what I am looking for.

                         This is a strange problem. I've looked at the files and text 'til my eyes crossed.... Tonight I'm going to do a full audit of every file and every line of text again. Then I'm goign to reboot the system and start this whole process over on an new drive and new folders just to isolate it...and see what happens then. Wish me luck.

                         I will get back to you with the resuts of my effort.   Thanks again Mikhail...!

                          

                          

                    • 7. Re: XML Import NOT Working FMP11 - Help!!
                      MikeGilbertson

                           Top left is the XML I received from the Customer (PartSimple_201301416_175710_rapidtechorders.xml). Top right is the SXLT. Bottom left is the dumbed down PartSimple Orders.fp7.  Notice the blank records being added when I try import the XML. I am tring to import the XML file by selecing File >Import Records>File and selct the PartSimple XML order file as the XMD Data Source and click the Use XSL style sheet check box then select File and specify the orders.xslt.   I then click Continue. The next window is the Import Field Mapping. In the Source Fields it has two lines that read Backorderable and BrandName. On the Target Field side it reads the same. When I click >> Field Names it changes to Record 1 of 1. At that point the Source Fields are blank and the Target Fields remain Backorder and Brandname.  Am I doing something fundamentaly wrong?

                            

                      • 8. Re: XML Import NOT Working FMP11 - Help!!
                        MikhailEdoshin

                             No, I cannot find anything wrong in your description. Could you please zip and mail the files to mikhail.edoshin - at - gmail.com? 

                        • 9. Re: XML Import NOT Working FMP11 - Help!!
                          ggt667

                          xsltproc /tmp/1.xslt /tmp/1.xml | tidy -i -xml -wrap 0 | nc termbin.com 9999

                          Gave me this: http://termbin.com/gn32

                          ( Life span of single paste is one month. ) Please feel free to repost elsewhere