Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 856607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:15:39+00:00 2026-05-15T08:15:39+00:00

I am looking to export from Filemaker using column names (instead of positions). Currently

  • 0

I am looking to export from Filemaker using column names (instead of positions). Currently I export the following XSL stylesheet that exports by position with:

<?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/fmpxmlresult" exclude-result-prefixes="fm" >
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
  <people>
    <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW">
      <person>
        <name>
          <xsl:value-of select="fm:COL[01]/fm:DATA"/>
        </name>
        <location>
          <xsl:value-of select="fm:COL[02]/fm:DATA"/>
        </location>
      </person>
    </xsl:for-each> 
  </people>
</xsl:template>
</xsl:stylesheet>

Any ideas? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:15:40+00:00Added an answer on May 15, 2026 at 8:15 am

    If you just want to make the code more readable, then I’d suggest something simple, like:

    <!-- expected columns -->
    <xsl:variable name="NAME" value="1" />
    <xsl:variable name="LOCATION" value="2" />
    <!-- ... -->
    <people>
      <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW">
        <person>
          <name>
            <xsl:value-of select="fm:COL[$NAME]/fm:DATA"/>
          </name>
          <location>
            <xsl:value-of select="fm:COL[$LOCATION]/fm:DATA"/>
          </location>
        </person>
      </xsl:for-each> 
    </people>
    

    BTW, with <xsl:value-of /> you can omit the fm:DATA, i.e. use:

    <xsl:value-of select="fm:COL[$LOCATION] />
    

    It will return the same result.

    If you need something more sophisticated, please explain.

    Update:

    To refer to columns by column names is harder, but possible with something like that:

    <!-- Define a key to get a field and all fields that precede it by the field name -->
    <xsl:key name="N" match="/fm:FMPXMLRESULT/fm:METADATA/fm:FIELD" use="@NAME" />
    <xsl:key name="N" match="/fm:FMPXMLRESULT/fm:METADATA/fm:FIELD" 
      use="following-sibling::fm:FIELD/@NAME" />
    <!-- Then *count* them it in the code like that -->
    <people>
      <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW">
        <person>
          <name>
            <xsl:value-of select="fm:COL[count(key('N', 'name'))]" />
          </name>
          <location>
            <xsl:value-of select="fm:COL[count(key('N', 'location'))]" />
          </location>
        </person>
      </xsl:for-each> 
    </people>
    

    Not utterly elegant, but works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to export data to excel from Delphi without having to own a
I'm looking to do exactly and only that. Export a tag we created in
Looking for an example that: Launches an EXE Waits for the EXE to finish.
Looking for C# class which wraps calls to do the following: read and write
Looking for a Linux application (or Firefox extension) that will allow me to scrape
I'm looking at what is needed to move from wordpress.com to a BlogEngine.NET or
I want to export data from a table to a specifically formatted XML file.
I'm writing a small sqlalchemy shim to export data from a MySQL database with
Recently, sometimes (rarely) when we export data from our application, the export log contains
I am looking for the API calls that would allow loading cookies into IE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.