Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I'm new to FM but not to DB although it was a long time ago I did anything with a DB. My problem is this;

I'm (trying to) building a DB that is going to receive data from the Internet and store some of it. The data is an ID# (text) and a CELL# (text), the ID is used for a lookup in the DB and the CELL is being added to the matching record of the ID. So, I thought that if I could transform the data into XML and use a PERL / AS to make FM import the file and I'd be fine wink.gif

I

Posted

First, you should get Beverly Voth's book on using FileMaker and XML, which covers much of this. Do a search for her name; she's posted here recently.

FileMaker has its own XML syntax. It will not accept xml like the above just straight. You need to use an xsl stylesheet in between. This would work I think:

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

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>

<xsl:template match="/">

<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">

<ERRORCODE>0</ERRORCODE>

<PRODUCT BUILD="" NAME="" VERSION=""/>

<DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT="h:mm:ss a"/>

<METADATA>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="TRANSMITTER_ID" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="CELL_ID" TYPE="TEXT"/>

</METADATA>

<RESULTSET FOUND="{count(/INCIDENT)}">

<xsl:for-each select="/INCIDENT">

<ROW>

<xsl:attribute name="MODID">0</xsl:attribute>

<xsl:attribute name="RECORDID"><xsl:value-of select="position()"/></xsl:attribute>

<COL>

<DATA>

<xsl:value-of select="TRANSMITTER_ID"/>

</DATA>

</COL>

<COL>

<DATA>

<xsl:value-of select="CELL_ID"/>

</DATA>

</COL>

</ROW>

</xsl:for-each>

</RESULTSET>

</FMPXMLRESULT>

</xsl:template>

</xsl:stylesheet>

Posted

Separate post. You say data "from the internet." Is this data going to become a file on your computer? If so you can just do it all with FileMaker and xsl. Or are you trying to do some kind of http request for the data?

We were recently (last few days) discussing getting data from Amazon web services, via an http request. Do a search on my name. There is some AppleScript in there, using "XSLT Tools.osax."

Posted

Hi Fenton,

thanks for your time and XML file! I'm currently trying to read all literature about FM7 but asking someone who know is obiously a lot faster wink.gif

I've tried it but don't know if I'm doing somethimg wrong. I try to import the file via FILE->"IMPORT RECORDS"->"XML DATA SOURCE" - FM7 returns with the answer "XSL:for-each... not valid". I've noticed that I don't have priviledges for the page ="http://www.w3.org/1999/XSL/Transform" version="1.0"

and I can't reach http://www.filemaker.com/fmpxmlresult when I tried to download them to my machine! Am I doing something wrong?

I don't have the users manual yet, but can you tell me where the imported data is stored in FM7? do you need to import the data into a record or is there a "internal record" for this?

Hope you can help me on this - really greatful for your suggstions and time fenton! wink.gif

Kind regards Andrew

Posted

Well, this is why Beverly's book is useful, to get some basics on XML and FileMaker. There also must be something in the FileMaker documentation how to import XML using XSL. You need to know what the dialog choices mean.

Because you're trying something impossible that you don't need to do. Those "http" URLs are NOT really web addresses (though they may be, but that's not their usefulness). They are simply part of "namespace" declarations for the XSL stylesheet. One for XSL ("xsl:") and one for FileMaker's "xmlresult".

That is just the form they take. If you look at the top of any HTML page you will see its namespace. It is not somewhere you "go" or something you "download." It's just a way of telling the processor what it can be expecting to deal with. One use is so you could use something like a <table> element in XML and be referring to a piece of furniture instead of a web table. Odd but true.

I'm not very good at explaining (or knowing) this precisely. It's almost esoteric. But you don't have to know everything about it in order to do a few simple things.

Basically you want to Import XML, with your XML file as the file, using an XSL stylesheet file (lower checkbox), specifying a file of the XSL code I posted earlier. That's all. You don't have to do anything really to either file. They will work as is.

(Actually I did remove the "standalone='yes'")

So, it's 2 text files, each targeted by the Import XML, .xml file at the top choice, .xsl file as the lower choice. I could make an example file folder with this. But it's midnight, and my computer has turned into a pumpkin :-]

Posted

GREAT! laugh.gif

That clarified alot - thanks! I can now import the data!!!

Have looked for the book here in NZ via the et but cannot find it! Will try again tomorrow... smile.gif

Best Regards

Andrew

PS. sorry about your computer, hope it feels better in the morning wink.gif

This topic is 7177 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.