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.

Changing XML Hierarchy

Featured Replies

I have a large number of items like this:

<row>

<class>TYPE A</class>

<field1>foo1</field1>

<field2>bar1</field2>

</row>

<row>

<class>TYPE A</class>

<field1>foo2</field1>

<field2>bar2</field2>

</row>

<row>

<class>TYPE B</class>

<field1>foo3</field1>

<field2>bar3</field2>

</row>

I'd like to separate out all the "class" fields and come up with something like this:

<class name="TYPE A">

<row>

<field1>foo1</field1>

<field2>bar1</field2>

</row>

<row>

<field1>foo2</field1>

<field2>bar2</field2>

</row>

</class>

<class name="TYPE B">

<row>

<field1>foo3</field1>

<field2>bar3</field2>

</row>

</class>

Although the end result is that I'd like to produce a large number of HTML tables that look something like this:

TYPE A:

field 1: field2:

foo1 bar1

foo2 bar2

TYPE B:

field 1: field2:

foo3 bar3

  • Author

Nevermind, I think I figured it out. This seems to do what I wanted. The key was finding out how to find unique values for "class":

<xsl:for-each select="//fmp:Class[not(.=preceding::fmp:Class)]">

<p><b><xsl:value-of select="."/></b></p>

<table border="1">

<tr>

<th align="left">Field 1:</th>

<th align="left">Field 2:</th>

</tr>

<xsl:for-each select="//fmp:Class[.=current()]/parent::*">

<tr>

<xsl:choose>

<xsl:when test="position() mod 2 = 1">

<xsl:attribute name="class">clsOdd</xsl:attribute>

</xsl:when>

<xsl:otherwise>

<xsl:attribute name="class">clsEven</xsl:attribute>

</xsl:otherwise>

</xsl:choose>

<xsl:for-each select="fmp:Class/following-sibling::*">

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

</xsl:for-each>

</tr>

</xsl:for-each>

</table>

<hr/>

</xsl:for-each>

  • 2 weeks later...
  • Newbies

Hi Tim,

I'm trying to use a xslt style sheet with an xml export from FM version 6. The format I exported is FMPDSORESULT. Whenever I try to do anything with the xml file, it won't work correctly. A match would not be found if I use FMPDSORESULT as a match or anything like "//ROW".

To debug the problem, I exported without using a xsl style sheet. I used a program called oxygen to edit and parse the files. I had a hunch: the FMPDSORESULT element has an attribute xmlsn="http://www.filemaker.com/fmpdsoresult" so I renamed the attribute name and it worked.

How can I get this to work?

Thanks!

-Jordan

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.