Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Newb question - basic XSL Stylesheet to return XML in CWP

Featured Replies

Hi all

I have embarked on using XSLT for exposing certain parts of my Filemaker database. I started out by using the Site Assistant to generating some HTML pages using XSL and got the hang of this, editing the XSL files that Site Assistant produced to get to where I wanted which was just some very basic tables with a list of records.

Now I am trying to do the same thing but returning XML rather than HTML. None of the Site Assistant options return XML so I started trying to figure out how to do this. I found a few examples using the FMXMLRESULT grammar but I am using the FMRESULTSET grammar and can't get it working.

I would be really grateful if someone could post some code that would just kick out a really simple XML page with a list of records with a few fields per record.

My records are called "Connections" and the fields I need to show are called "CLI", "OrderType" and "OrderDate".

I tried using the built-in XML URLs (no XSL) but they return a lot of junk I don't want to show. I just need something really basic and neat.

All help much appreciated.

Michael

See if this simple example can get you started:

FMRESULTSET.zip

  • Author

Awesome. I got that working! Thanks so much!

As a non-FM colleague pointed out to me the other day, Filemaker has a fantastic community!

I have one related question. I am using the syntax

https://myserver.mydomain.com/fmi/xsl/connections.xsl?-grammar=fmresultset&-db=Mydb&-lay=xml_connections&cli=02134567890&-find

In my previous xsl work that returns HTML, I did not need to insert the

-grammar=fmresultset

part of the URL.

Is there some way I can remove it here for neatness and consistency with the other URLs? Maybe it can be incorporated into the stylesheet or something? I am just curious why my 2 stylesheets behave a bit differently.

Thanks so much again.

Michael

I'll let someone who knows more about CWP answer this.

  • Author

Hi there

Just to update the thread with where I am thinking the issue is with this thing about having to specify the grammar in the URL, I noticed that xsl sheets generated by Filemaker's Sits Assistant had a line like

<?xslt-cwp-query params="-db=mydb&-lay.response=xml_connections-grammar=fmresultset&-encoding=UTF-8"?>

(note the forum code is putting the "php" near the beginning of that string of code not me!)

so I guess this is telling the xsl sheet what grammer to expect. However I dropped this into the xsl sheet that I had working and I got an error from the Filemaker XSL engine "MCS-120" but nothing else specified.

Does anyone know how this works and what syntax I should use to tell my xsl sheet to expect the grammar to be fmresultset so I can take this out of the URL?

Also, I noticed that the line above also specified the -db parameter. Could I take this out of the URL as well if this included in the xsl sheet somehow?

Many thanks

Michael

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.