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.

Featured Replies

Hi,

I am totally new in xslt.  I have the following xslt and I tried to export as xml.   I got an error.    "SAXParseException: invalid document structure".  Is there a problem in my structure?  What's the proper structure?

 

<?xml version='1.0' encoding='UTF-8' ?>

<xsl:stylesheet version='1.0'

  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'

  xmlns:fm="http://www.filemaker.com/fmpdsoresult"

  exclude-result-prefixes="fm">

      <xsl:output version='1.0' encoding='UTF-8' indent='yes'

        method='xml' />

      <xsl:template match="/">

      <cityforcast>

            <xsl:for-each select="fm:FMPDSORESULT/fm:ROW">

                  <forcast>

                        <id><xsl:value-of select="./fm:ID” /></id>                       

                        <city><xsl:value-of select="./fm:City” /></city>

                        <temperature><xsl:value-of select="./fm:Temperature” /></temperature>

                        <humidity><xsl:value-of select="./fm:Humidity” /></humidity>

<windspeed><xsl:value-of select="./fm:Wind Speed” /></windspeed>

                        <winddirection><xsl:value-of select="./fm:Wind Direction” /></winddirection>

                        <clouds><xsl:value-of select="./fm:Clouds” /></clouds>

                  </forcast>

            </xsl:for-each>

      </cityforcast>

      </xsl:template>

</xsl:stylesheet>

Weather.fmp12

I see two problems here:

1. Your stylesheet uses the right quotation mark character (a.k.a. a "smart" or "curly" quote) where a regular quotation mark is required; for example in line 23, after "fm:ID":

<id><xsl:value-of select="./fm:ID” /></id>

and in 6 more places.

Lesson: use a text editor, not a word processor, to create and edit XML/XSLT documents.

 

2. Two of your fields have spaces in their names. This is allowed (though not recommended) in Filemaker, but when you export as XML using the FMPDSORESULT  grammar, Filemaker will replace the spaces with underscore characters because XML element names cannot contain spaces and the expression:

<xsl:value-of select="./fm:Wind Speed” />

is invalid XSLT syntax. It will work if you change it to:

<xsl:value-of select="./fm:Wind_Speed" />

This is one of the reasons why the FMPXMLRESULT grammar is preferable; you do not depend on your field names - most importantly, you can rename your fields without affecting your stylesheet. 

 

Create an account or sign in to comment

Similar Content

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.