Jump to content

XML Import Error


sebastianzimmer

This topic is 6446 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Everyone,

I was just writing a little Database for a book archiv. I want to import all the info on a book from the isbn-database at

http//isbndb.com

I am using the import script to send out a query but I always get the following error message:

XML-Parsingerror

Attibute 'publisher_id' is not declared for element 'PublisherText'

Row: 8

Column: 32

A querye example is: 'http://isbndb.com//api/books.xml?access_key=WNCZC8HT&index1=isbn&value1=3110165228'

Thank you very much for the help!

Sebastian

Link to comment
Share on other sites

Okay, I have been lots of reading...

I think I have to creat a xsl-stylesheet to translate the data into grammer that can be read by FMP.

Now the problem is I have no idea how to do that! I have been reading on www.w3.org but it seems pretty complicated.

I would greatly appreciate any help. Thanks

Link to comment
Share on other sites

I think I have to creat a xsl-stylesheet to translate the data into grammer that can be read by FMP.

Now the problem is I have no idea how to do that! I have been reading on www.w3.org but it seems pretty complicated.

Actually, it's not a complex as you think! Make an EXPORT from your database with one or two records using the FMPXMLRESULT grammar. This is what your IMPORT will need to look like. Check it for the elements required. Add the XSLT elements around your sample, replace the static field data with "calls" to the source XML elements and use the XSLT with your import.

There are example files (free download) for my book FMP Developer's Guide to XML/XSL.

Link to comment
Share on other sites

  • 4 weeks later...

I'm facing a daunting xslt task too, Beverly, and this is all new to me. Your tip here gave me more insight than the last two days of searching the net and reading manuals. Thanks very much. (I also downloaded the files and ordered your book.)

Really appreciate you work in this area of FM.

Link to comment
Share on other sites

Hi everyone

This is directed to Beverly's post 219907 above.

As I am struggling with this XSLT style sheet creation myself.

I wanted to clarify if I am understanding your response to OP question.

I understand and can read the XML file I want to get the data from. I am able to set up a FMP data base with the categories/data fields I want.

I can use this blank data base I just created to generate my XSLT style sheet by doing a XML export of this blank/dummy record and grabbing the style sheet FMP produces. Then reuse this style sheet for my import of the XML file.

Thanks

Joe

Edited by Guest
Link to comment
Share on other sites

jman1, I don't know if you are asking a question(s); it appears so. You can use a "raw" XML export from FileMaker (i.e., with no stylesheet specified), to see what the xml result (FMPXMLRESULT grammar) should look like for an import.

But the export is not an XSLT stylesheet, it's just xml data. XSLT files are xml also, and they start with an xml declaration. And, in FileMaker's case, they have a lot of the same stuff at the top. And an export is a good way to get this stuff. But down in the body of the stylesheet you will not have data, you will have the xml expressions for extracting the data from the other source xml file (which is often not in FMPXMLRESULT format at all).

Think of the XSLT stylesheet(s) as a filter, for picking out the data from the source xml; and optionally rearranging it, or adding other data. It places the extracted data within your specified FileMaker elements, so FileMaker knows what/where it is, and can import it.

Because the data in the source xml can be arranged in all kinds of different ways, in elements and attributes, nested however they saw fit, each xslt stylesheet usually has to be custom made, to extract/rearrange the source xml for FileMaker.

It is a little confusing, because if you do an XML Import with FileMaker, using an xslt stylesheet, you will NEVER see the FileMaker XML you are importing (or trying to). That is why you have to do a raw export to see what it should look like. But you can see it if you use some other xml/xsl transformation application, to preview the result. They also tend to give much better error messages than FileMaker, and often highlight the error in the xsl. Using only FileMaker Import, by trial and error, is not fun (unless you're a genius and get it right the 1st time).

Link to comment
Share on other sites

Hi Fenton

I am trying to get my bearing on this XSLT thing. Yup I am having a bit of a struggle.

I think I am understanding it better. I did download Text XSLT and Exchanger lite as you recommended. All though I can fudge some XSLT in Text xslt and hit process to get some info out of my XML file I still can not get filemaker to do the same it seems to choke and spit out errors. I did spend the weekend plowing threw forum post and several books. I seem to be slowed down because most of the examples and books seem to be doing the style sheets for HTML conversion so there is a lot of code on fonts style, size, formating and color that I have to weed through.

I actually seemed to have a much easier time with the troi text xml plugin yanking out the data I needed. But it seems I should be going the XSLT route for forward compatibility.

Thanks again for your input. When I have myself on steadier course I will post some specific questions.

Joe

Link to comment
Share on other sites

Yes, XSLT, though it is only a Markup language, as opposed to full Programming language, has quite a bit of depth. It seems the learning goes on and on. But most actual tasks that you run into are not all that complex. Look at some of the examples we've posted here; they are mostly about fairly simple extraction, either for import or export.*

Since FileMaker expects a certain format of the data for import, FMPXMLRESULT, you can manage to do an error-free transformation in TestXSLT, but still get FileMaker import errors when you try and use the same xslt. So it means that you need to see what you're missing, or have gotten wrong, how your result differs from a raw XML export from FileMaker (no stylesheet).

*It is almost impossible to post a generic xslt for all different xml sources. Because the "x" in XML stands for "extensible" (I guess EML didn't sound so hot :P-). Which lets the author decide the particular structure of the xml, as long as it follows the fairly strict rules. Add in the fact that you can use whatever nesting you want, as well as the fact that data can be contained in either an "attribute" or an "element", and you get several possible "correct" xml structures for any given data. And almost always more than 1 correct xslt for any given xml, even to get exactly the same result. FileMaker, on the other hand, pretty much just wants 1 structure for its import.

Link to comment
Share on other sites

Hi! you can download all my example files, if you think that it would help.

Fenton's right, the xml EXPORT is just a starting point for creating the XSLT needed to IMPORT into Filemaker Pro. See if the example files can show you the steps.

Link to comment
Share on other sites

This topic is 6446 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.