Filemaker xml 导出:如何让每一行都在一个新行开始?
Filemaker xml export: how to make each row start on a new line?
我是 xml/xls 的新手,但我需要从 filemaker 导出一些记录作为 .xml
文件。
我可以做到这一点,但是当我打开文件时,每个 <ROW>
标签都与最后一个标签在同一行,这对我来说非常复杂。
Filemaker 提供了使用 httpd 请求制作样式表的选项,但我真的不明白它期望什么...如果有人能指出正确的方向,我将非常感激。
假设您只需要一个 "pretty-printed" XML 文件作为结果,使用它作为您的 XSLT 样式表:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/>
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Beverly Voth 写了一本关于该主题的书,但 FileMaker 论坛可能是查找所需信息的最佳场所。
大多数 xml 不会在节点之间有运输 returns,因为它们对数据结构无关紧要。您要查找的是 "pretty" xml。一些编辑器会将 xml 显示为漂亮或者会给你这个选项,例如 Notepad++ xml 插件有它。
如果你只需要搞定xml结构,除了简单的文本编辑器之外没有任何工具,只需批量替换“
Filemaker gives the option of making a stylesheet with a httpd
request, but I really don't understand what it expects...
FileMaker 不制作 XSLT 样式表,您必须提供一个或 link 到 Web 上可用的样式表。
@michael.hor257k 答案的变体,使用 xsl:copy-of 而不是 xsl:copy
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" version="1.0" exclude-result-prefixes="xalan">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2" />
<xsl:template match="/">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
我是 xml/xls 的新手,但我需要从 filemaker 导出一些记录作为 .xml
文件。
我可以做到这一点,但是当我打开文件时,每个 <ROW>
标签都与最后一个标签在同一行,这对我来说非常复杂。
Filemaker 提供了使用 httpd 请求制作样式表的选项,但我真的不明白它期望什么...如果有人能指出正确的方向,我将非常感激。
假设您只需要一个 "pretty-printed" XML 文件作为结果,使用它作为您的 XSLT 样式表:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/>
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Beverly Voth 写了一本关于该主题的书,但 FileMaker 论坛可能是查找所需信息的最佳场所。
大多数 xml 不会在节点之间有运输 returns,因为它们对数据结构无关紧要。您要查找的是 "pretty" xml。一些编辑器会将 xml 显示为漂亮或者会给你这个选项,例如 Notepad++ xml 插件有它。
如果你只需要搞定xml结构,除了简单的文本编辑器之外没有任何工具,只需批量替换“
Filemaker gives the option of making a stylesheet with a httpd request, but I really don't understand what it expects...
FileMaker 不制作 XSLT 样式表,您必须提供一个或 link 到 Web 上可用的样式表。
@michael.hor257k 答案的变体,使用 xsl:copy-of 而不是 xsl:copy
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" version="1.0" exclude-result-prefixes="xalan">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2" />
<xsl:template match="/">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>