将FMPXMLRESULT语法中的数据转换成“数字地理空间元数据的内容标准(CSDGM)”。兼容的XML

发布于 2024-08-29 11:15:17 字数 1440 浏览 9 评论 0原文

我在 FileMaker 中遇到问题;我希望将 METADATA 元素/FIELD 元素“NAME”属性链接到 RESULTSET 元素/COL 元素中的相应数据。

但是,我还希望将 METADATA 元素/FIELD 元素“NAME”映射到“数字地理空间元数据内容标准 (CSDGM)”元数据元素

具有 CSDGM 基本元素的示例 XML 元数据记录

<?xml version="1.0" encoding="ISO-8859-1" ?>
  <metadata>
   <idinfo>
      <citation>
       <citeinfo>
          <origin>Louisiana State University Coastal Studies Institute</origin>
          <pubdate>20010907</pubdate>
          <title>Geomorphology and Processes of Land Loss in Coastal Louisiana, 1932 –
          1990</title>
       </citeinfo>
     </citation>
     <descript>
      <abstract>A raster GIS file that identifies the land loss process and
       geomorphology associated with each 12.5 meter pixel of land loss between
       1932 and 1990. Land loss processes are organized into a hierarchical
       classification system that includes subclasses for erosion, submergence,
       direct removal, and undetermined. Land loss geomorphology is organized
       into a hierarchical classification system that includes subclasses for both
       shoreline and interior loss.</abstract>
     <purpose>The objective of the study was to determine the land loss
      geomorphologies associated with specific processes of land loss in coastal
      Louisiana.</purpose>
    </descript>

I have a problem in FileMaker; I wish to link the METADATA element/FIELD element “NAME” attribute to its corresponding data in the RESULTSET element/COL element.

However, I also wish to map the METADATA element/FIELD element “NAME” to "Content Standard for Digital Geospatial Metadata (CSDGM)" metadata elements

Sample XML Metadata Record with CSDGM Essential Elements

<?xml version="1.0" encoding="ISO-8859-1" ?>
  <metadata>
   <idinfo>
      <citation>
       <citeinfo>
          <origin>Louisiana State University Coastal Studies Institute</origin>
          <pubdate>20010907</pubdate>
          <title>Geomorphology and Processes of Land Loss in Coastal Louisiana, 1932 –
          1990</title>
       </citeinfo>
     </citation>
     <descript>
      <abstract>A raster GIS file that identifies the land loss process and
       geomorphology associated with each 12.5 meter pixel of land loss between
       1932 and 1990. Land loss processes are organized into a hierarchical
       classification system that includes subclasses for erosion, submergence,
       direct removal, and undetermined. Land loss geomorphology is organized
       into a hierarchical classification system that includes subclasses for both
       shoreline and interior loss.</abstract>
     <purpose>The objective of the study was to determine the land loss
      geomorphologies associated with specific processes of land loss in coastal
      Louisiana.</purpose>
    </descript>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梓梦 2024-09-05 11:15:17

我发现这是一篇相当旧的帖子;您还需要答案吗?如果是,请澄清“链接元素到元素”的含义以及是否需要导入此文件、导出它或两者都需要。

更新:这是一个将 FileMaker XML 语法转换为 CSDGM 的基本 XSLT。它假设所有数据都驻留在一个表中并按指定的顺序导出。它还假设 GSDGM 语法有一个 metadata 作为根元素,然后为每个记录重复 idinfo 和子元素。

请注意,它不会将 FileMaker 日期(如 5/17/2010)转换为 20100517;可以用 XSLT 编写此内容,但在表中添加一个生成此类字符串的计算字段并导出该字段(而不是日期)会快得多。

<?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">

  <!-- This transformation converts FileMaker FMPXMLRESULT into CSDGM. 
       The assumed source data structure is that:

    Origin
    Date
    Title
    Abstract
    Purpose -->

  <xsl:variable name="ORIG" select="1" />
  <xsl:variable name="DATE" select="2" />
  <xsl:variable name="TITL" select="3" />
  <xsl:variable name="ABST" select="4" />
  <xsl:variable name="PURP" select="5" />

  <!-- The resulting format is XML, ISO-8859-1 -->
  <xsl:output method="xml" encoding="ISO-8859-1" />

  <!-- Main -->
  <xsl:template match="/">
    <metadata>
      <xsl:for-each select="//fm:ROW">
        <idinfo>
          <citation>
            <citeinfo>
              <origin>
                <xsl:value-of select="fm:COL[$ORIG]" />
              </origin>
              <pubdate>
                <xsl:value-of select="fm:COL[$DATE]" />
              </pubdate>
              <title>
                <xsl:value-of select="fm:COL[$TITL]" />
              </title>
            </citeinfo>
          </citation>
          <descript>
            <abstract>
              <xsl:value-of select="fm:COL[$ABST]" />
            </abstract>
            <purpose>
              <xsl:value-of select="fm:COL[$PURP]" />
            </purpose>
          </descript>
        </idinfo>
      </xsl:for-each>
    </metadata>
  </xsl:template>

</xsl:stylesheet>

I see it's a rather old post; do you still need an answer? If yes, then please clarify what you mean by ‘link element to element’ and whether you need to import this file, export it, or both.

Update: here's a basic XSLT that transforms FileMaker XML grammar into CSDGM. It assumes all data reside in a single table and are exported in the specified order. It also assumes that the GSDGM grammar has a single metadata as the root element and then repeats idinfo and children for every record.

Note that it won't convert FileMaker dates like 5/17/2010 to 20100517; it's possible to write this in XSLT, but it will be much faster to add a calculated field in the table that produces such a string and export this field instead of Date.

<?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">

  <!-- This transformation converts FileMaker FMPXMLRESULT into CSDGM. 
       The assumed source data structure is that:

    Origin
    Date
    Title
    Abstract
    Purpose -->

  <xsl:variable name="ORIG" select="1" />
  <xsl:variable name="DATE" select="2" />
  <xsl:variable name="TITL" select="3" />
  <xsl:variable name="ABST" select="4" />
  <xsl:variable name="PURP" select="5" />

  <!-- The resulting format is XML, ISO-8859-1 -->
  <xsl:output method="xml" encoding="ISO-8859-1" />

  <!-- Main -->
  <xsl:template match="/">
    <metadata>
      <xsl:for-each select="//fm:ROW">
        <idinfo>
          <citation>
            <citeinfo>
              <origin>
                <xsl:value-of select="fm:COL[$ORIG]" />
              </origin>
              <pubdate>
                <xsl:value-of select="fm:COL[$DATE]" />
              </pubdate>
              <title>
                <xsl:value-of select="fm:COL[$TITL]" />
              </title>
            </citeinfo>
          </citation>
          <descript>
            <abstract>
              <xsl:value-of select="fm:COL[$ABST]" />
            </abstract>
            <purpose>
              <xsl:value-of select="fm:COL[$PURP]" />
            </purpose>
          </descript>
        </idinfo>
      </xsl:for-each>
    </metadata>
  </xsl:template>

</xsl:stylesheet>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文