Accessing XML Data on a FileMaker Advanced Server (versions 7+):
Accessing it
- Sample XML
- show (view source on window that opens)
FileMaker returns the XML document in the form:
node 0 = error code
node 1 = product build info
node 2 = data source
node 3 = metadata
node 4 = resultset
any related information on a layout gets returned as a resultset
- show (view source on window that opens)
- Reading
syntax
- Find specific record:
http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametosearchon&fieldname1=value1&-find
(Change the bolded entries to match your specific environment)
Find All Records:
http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametosearchon&-findall
(Change the bolded entries to match your specific environment)
- Find specific record:
- Create record syntax
- http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametocreatenewrecordon&-new
- http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametocreatenewrecordon&-new
- Edit record syntax
- http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametoeditrecordon&recordname=newvalue&-edit
- http://servername/fmi/xml/fmresultset.xml?-db=databasename&-lay=layoutnametoeditrecordon&recordname=newvalue&-edit
- Accessing the resultset
- Use XPATH to access info
- Whether you're using Flash, Ajax, etc. using XPATH will help 'find' the information you want.
XPATH for resultset = fmresultset/resultset/record
XPATH for error code = fmresultset/error (reading the attribute 'code' will give you the error code)
- Whether you're using Flash, Ajax, etc. using XPATH will help 'find' the information you want.
- Node
Access
- firstChild.lastChild.firstChild
- firstChild.lastChild.firstChild
- Use XPATH to access info