11 Replies Latest reply on Aug 1, 2016 6:57 AM by beverly

    Exporting problems using xmlt file

    lill-lise

      I'm trying to export data from FMP14 using a xmlt file but it doesn't work. The field content doesn't export only the field names. I got a tip that maybe the xmlt file had a wrong syntax or something like that. I'm really lost when it comes to this unfortunately. I first got a xsd file to use but that didn't work so I changed that to an xmlt file instead. But that doesn't seem to work either. Can somebody help me? :-) (Sorry if the language is bad but I'm writing from Sweden.)

        • 1. Re: Exporting problems using xmlt file
          wimdecorte

          with "xmlt" do you mean "xslt"?  A transformation stylesheet?

          In the sense that you export to XML from FM and apply an XSLT to generate another format?

           

          If so, what is the format that you need to end up with?  Since you mention an XSD I'm assuming that you need the output in a particular XML format?

          • 2. Re: Exporting problems using xmlt file
            beverly

            I agree with Wim. you need XSLT (extensible stylesheet language transformation)

             

            If the fields are populating that part of the XSLT is correct. However the path from the XML source elements is not quite right.

             

            perhaps there is a missing namespace section to the XSLT that is preventing the data from 'transforming'?

             

            Can you post the XSLT for review? and a link to the XSD is helpful, too.

            beverly

            1 of 1 people found this helpful
            • 3. Re: Exporting problems using xmlt file
              lill-lise

              Yes of course I mean xslt. And yes I want to create a xml file in a particular format.

               

              This is the xsd file I got and wanted to use. But since I can't export from FM using this I tried to transform this into an xslt instead. You see my verison of the xslt after this one.

               

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

              <xs:schema xmlns:tns="http://integration.sjv.se/forebyggandesmittskydd/hastavelsorginfo_2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://integration.sjv.se/forebyggandesmittskydd/hastavelsorginfo_2.0" elementFormDefault="qualified" version="2.0">

                  <xs:element name="hastdjurList">

                      <xs:complexType>

                          <xs:sequence>

                              <xs:element name="hastdjur" type="tns:hastdjur" minOccurs="1" maxOccurs="10000"/>

                          </xs:sequence>

                      </xs:complexType>

                  </xs:element>

                  <xs:complexType name="hastdjur">

                      <xs:sequence>

                          <xs:element name="ueln" type="xs:string">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets unika livsnummer (UELN eller registreringsnummer om UELN saknas)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="art" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Art (tillexempel häst, åsna, mula)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="kon" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Kön

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="farg" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Färg

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="fodelsedatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets födelsedatum

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="fodelseland" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets ursprungsland

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="uppehallsland" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets uppehållsland

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="namn" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets namn

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="chipnr" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Om hästdjuret har ett chip, åtminstone de 15 sista tecknen av chipnummret

                        </xs:documentation>

                              </xs:annotation>

                              <xs:complexType>

                                  <xs:sequence>

                                      <xs:element name="varde" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

                                  </xs:sequence>

                              </xs:complexType>

                          </xs:element>

                          <xs:element name="annanMarkning" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Om inte märkning finns, alternativ märkning (går också att ange märkning saknas)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passUtfardatDatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Datum för utfärdande av hästpass

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passUppdateratDatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Datum för eventuella förändringar i hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passDuplikat" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Serienummer (om tillämpbart), samt alla uppgifter om duplikat (hästpassets nummer, kan vara samma som UELN)

                        </xs:documentation>

                              </xs:annotation>

                              <xs:complexType>

                                  <xs:sequence>

                                      <xs:element name="varde" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

                                  </xs:sequence>

                              </xs:complexType>

                          </xs:element>

                          <xs:element name="ansokandePersonNamn" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Namn på person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonAdress" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Adress till person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonPostnr" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Postnummer på person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonPostort" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Postort till person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="registreratSomStatus" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Status som registrerat hästdjur eller hästdjur för avel och produktion

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="livsmedelsstatus" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets kända status som avsedd för slakt för livsmedelsproduktion eller inte

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="serienummer" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Passets serienummer

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="dodsdatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Meddelat datum för hästdjurets död eller annan förlust av hästdjuret

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="avelsorganisation" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Avelsorganisation

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                      </xs:sequence>

                  </xs:complexType>

              </xs:schema>

               

              This is my xslt:

               

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

              <!-- edited with XMLSpy v2016 rel. 2 sp1 (http://www.altova.com) by Lill-Lise Nyberg (SPHA) -->

              <xs:schema xmlns:tns="http://integration.sjv.se/forebyggandesmittskydd/hastavelsorginfo_2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://integration.sjv.se/forebyggandesmittskydd/hastavelsorginfo_2.0" elementFormDefault="qualified" version="2.0">

                  <xs:element name="hastdjurList">

                      <xs:complexType>

                          <xs:sequence>

                              <xs:element name="hastdjur" type="tns:hastdjur" minOccurs="1" maxOccurs="10000"/>

                          </xs:sequence>

                      </xs:complexType>

                  </xs:element>

                  <xs:complexType name="hastdjur">

                      <xs:sequence>

                          <xs:element name="ueln" type="xs:string">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets unika livsnummer (UELN eller registreringsnummer om UELN saknas)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="art" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Art (tillexempel häst, åsna, mula)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="kon" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Kön

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="farg" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Färg

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="fodelsedatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets födelsedatum

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="fodelseland" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets ursprungsland

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="uppehallsland" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets uppehållsland

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="namn" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets namn

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="chipnr" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Om hästdjuret har ett chip, åtminstone de 15 sista tecknen av chipnummret

                        </xs:documentation>

                              </xs:annotation>

                              <xs:complexType>

                                  <xs:sequence>

                                      <xs:element name="varde" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

                                  </xs:sequence>

                              </xs:complexType>

                          </xs:element>

                          <xs:element name="annanMarkning" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Om inte märkning finns, alternativ märkning (går också att ange märkning saknas)

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passUtfardatDatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Datum för utfärdande av hästpass

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passUppdateratDatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Datum för eventuella förändringar i hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="passDuplikat" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Serienummer (om tillämpbart), samt alla uppgifter om duplikat (hästpassets nummer, kan vara samma som UELN)

                        </xs:documentation>

                              </xs:annotation>

                              <xs:complexType>

                                  <xs:sequence>

                                      <xs:element name="varde" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

                                  </xs:sequence>

                              </xs:complexType>

                          </xs:element>

                          <xs:element name="ansokandePersonNamn" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Namn på person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonAdress" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Adress till person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonPostnr" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Postnummer på person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="ansokandePersonPostort" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Postort till person som ansökte om hästpasset

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="registreratSomStatus" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Status som registrerat hästdjur eller hästdjur för avel och produktion

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="livsmedelsstatus" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Hästdjurets kända status som avsedd för slakt för livsmedelsproduktion eller inte

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="serienummer" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Passets serienummer

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="dodsdatum" type="xs:date" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Meddelat datum för hästdjurets död eller annan förlust av hästdjuret

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                          <xs:element name="avelsorganisation" type="xs:string" minOccurs="0" maxOccurs="1">

                              <xs:annotation>

                                  <xs:documentation>

                          Avelsorganisation

                        </xs:documentation>

                              </xs:annotation>

                          </xs:element>

                      </xs:sequence>

                  </xs:complexType>

              </xs:schema>

               

              They look the same to me. Just have diffrent endings.

              I used Altova XMLSpy to do this.

               

              Really really greatful for any help I can get with this!

              • 4. Re: Exporting problems using xmlt file
                beverly

                You might study these "XML example files" from FileMaker to see what an XSLT looks like:

                 

                 

                you are working with an XSD and not a sample XML, so it's difficult to see what needs to change. If XMLSpy will produce a sample XML from the XSD, that would be beneficial.

                 

                beverly

                1 of 1 people found this helpful
                • 5. Re: Exporting problems using xmlt file
                  user19752

                  XSD is not XSLT, for example you have

                                  <xs:element name="hastdjur" type="tns:hastdjur" minOccurs="1" maxOccurs="10000"/>

                  in the XSD, so your XSLT need loop or match for 1 to max of 10000 that make "hastdjur" element. This may be records in FM data.

                   

                  You need defining map of FM field to xml element in XSLT.

                  • 6. Re: Exporting problems using xmlt file
                    lill-lise

                    The frustration is only getting bigger! I've been trying to understand some of all this but I really don't get it. :-(

                     

                    So, if I have an example XML-file on how we would like it to be. Is there any way I can easily (or a least understandable in any way) make/build an XSLT-file that I can use when exporting from FM?

                    • 7. Re: Exporting problems using xmlt file
                      beverly

                      I pointed you to the download for the examples that FileMaker uses for XML import and export. Did you get them? Start small and slowly

                       

                      beverly

                      1 of 1 people found this helpful
                      • 8. Re: Exporting problems using xmlt file
                        wimdecorte

                        lill-lise wrote:

                        make/build an XSLT-file that I can use when exporting from FM?

                         

                        The XSLT that you posted a little while ago showed that it was generated by XML Spy.  Tools like that have the ability to generate an XSLT by visually mapping between the source XML (FM's grammar) and the desired XML grammar.  That can really speed things up.

                         

                        But it still requires a basic knowledge of how XSLT works...  I this is way outside of your comfort zone then I suggest you find a consultant in your area to help you out.

                        • 9. Re: Exporting problems using xmlt file
                          beverly

                          true! I want to add that it is entirely possible to calculate the XML to be exported from FileMaker (no XSLT involved). It would need to match the schema that is defined by the XSD. But it would be most helpful to have an example of what that XML might look like. I don't know if XMLspy can give you a 'sample' XML document based on the XSD. That would certainly be a help!

                           

                          Wim is right, you may need someone 'locally' to assist you.

                          beverly

                          • 10. Re: Exporting problems using xmlt file
                            lill-lise

                            I actually made it. Probably not the right way but for now...

                            I wanted to create an xml-file looking in a certain way that the recipient wanted. When I tried to export from FM directly to xml it wasn't at all the same. Then I got a xsd file to help me but that one I couldn't use in FM only in Excel. So I tried to export to excel and use the xsd-file, but that didn't work either cos there were "list in list" in the mapping that excel couldn't handle. Sigh again...

                            I got the information that FM could only work with xslt-files so I tried to convert the xsd to an xslt. Realized that I didn't have enough knowledge...

                            So I downloaded a trialversion of XMLSpy2016 to se if that could help me. And in the end it actually did.

                            I saved an xml file from FM that I opened in XMLSpy, then I could use the xsd file in XMLSpy to change the xml file so it looked as I wanted. I had to save the xml using FMPDSORESULT even though the programme said I should use FMPXMLRESULT instead. So all this took a bit of trial and error. But now I actuallt have a xml-file that looks exactly like I want. :-)

                            The only problem now is that XMLSpy costs 690 euro to by and I only have trial verison, so now I have to find some other way. But I've learned A LOT. And I want to thank all of U that have tried to help me with this!

                            THANK YOU from all of my heart! Love to all of you!

                            • 11. Re: Exporting problems using xmlt file
                              beverly

                              Excellent! while FMPDSORESULT is 'available', it has been listed as deprecated for a long time. Mostly we use FMPXMLRESULT because it is the format that can be Imported as well as Exported (with FileMaker).

                               

                              Did XMLspy have a way to create the XSLT for you? if so, it can be used again & again!

                              beverly