Troubleshooting

 <  Day Day Up  >  

graphics/troubleshooting_icon.jpg

Wrong XML Format

I'm trying to import an XML file someone gave me, but I can't even get to the Import Field Mappings dialog. FileMaker says there's an "unknown element" in the document.

FileMaker can import only XML that's in the FMPXMLRESULT grammar. If you got the XML document from some source other than FileMaker, it's very unlikely to conform to FMPXMLRESULT . You'll need to apply a stylesheet to the XML as you import it to transform it into valid FMPXMLRESULT XML.

Errors in Stylesheets

FileMaker says there's a "parse error" in my XSL stylesheet.

There's a lot of programming in an XSL stylesheet ”and XSL and XML are fairly unforgiving languages. A single bracket out of place in your stylesheet, and the XML parser rejects it as being ill- formed . You need to be able to track down the syntax error and fix it. A good XML development environment, such as Oxygen for the Macintosh or XMLSpy for the PC, can be a big help in tracking down such problems.

Correct Stylesheet, Failed Import

My XML development tool tells me my stylesheet is valid and correct, but when I use it in the process of importing XML into FileMaker I still get strange errors from FileMaker.

It's perfectly possible to write a stylesheet that's correct in itself, but does not produce correct output. When you're importing into FileMaker, the inbound data has to be in correct FMPXMLRESULT format. Any deviation from that format, and FileMaker rejects the data. You might have written a stylesheet that is correct and runs perfectly without an error, but that nonetheless doesn't produce correct FMPXMLRESULT output as you intended. Here again, you need to figure out what went wrong and how to fix it.

There are other possible errors as well. For example, if you are fetching either your XML data or an XSL stylesheet from an HTTP server, you get an error if that server isn't available to you when you try to perform the import.

Unfortunately, FileMaker isn't much of an XML debugger. If you run into either of the errors we just discussed, FileMaker gives you a fairly terse error message, which may possibly lead you to the line of the file that produced the problem. If the problem is that you produced bad XML from your stylesheet, you may not even get that much information.

This is no fault of FileMaker's. XML development is a big area and it's not in the scope of FileMaker's capabilities to be a full-fledged development environment for generating and debugging XML files. But if you're at all serious about using FileMaker and XML together, you'll want to invest in such a tool.

An XML development tool generally consists of an XML editor that provides a lot of assistance in writing XML and XSL files. It may include features such as tag balancing (automatically closing tags when it seems right to do so), command completion (for example, being able to finish your XSL commands for you after you type a few letters ), automatic indentation, and, of course, document validation and debugging.

To use such a tool to develop an export stylesheet for FileMaker, for example, you could first do a sample XML export from your FileMaker database, into a test file. You could bring this FileMaker XML file into your XML development tool. Then you could write up your XSL stylesheet, have the tool check its syntax to make sure it's technically correct, and then have the tool apply the stylesheet to the FileMaker XML. You could then inspect the result for correctness.

We strongly recommend you look into such a tool if you plan on doing much XML work with FileMaker. On the Mac, the Oxygen XML editor is fairly full-featured (http://www.oxygenxml.com). On the PC, Altova's XMLSpy is highly regarded (http://www.altova.com).

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net