Writer Directives
XML编写器处理的指令如下所示。所示后缀以当前前缀
DATASET
必需/可选:Required
This keyword specifies the location for the output XML document.
Workbench Parameter:目标XML(可扩展标记语言)文件
例子:
XML\u数据集c:\data\采购.xml
PRETTY_PRINT
必需/可选:Optional
本指令指定是否输出XMLcument should be pretty-printed with indentation. The valid values for this directive are YES and NO. The default value is NO.
XML \u漂亮\u打印是
Workbench Parameter:Pretty Print
INDENT_SIZE
必需/可选:Optional
This directive takes effect whenPRETTY_PRINT设置为“是”。它指定缩进大小。此指令的有效值是0到9。此指令的默认值为1。
XML_INDENT_SIZE 3
Workbench Parameter:缩进大小
REPLACE_TABS_WITH_SPACES
必需/可选:Optional
By default the Tab character is used to pretty-print the indentations; set this directive to YES to substitute the Tab character with a Space. The size of a single indentation is controlled by theINDENT_SIZEdirective. The valid values for this directive are YES and NO. The default value is NO.
XML\u用\u空格替换\u选项卡\u是
Workbench Parameter:Replace Tabs with Spaces
文本\u缩进
必需/可选:Optional
文本\u缩进\u否
Workbench Parameter:文本缩进
XSD_DOC
必需/可选
Optional
Specifies the location for the XML Schema document. This keyword is optional. If the keyword is not specified or if it does not contain a path, then the XML Schema document is generated in the same folder as the one specified through theDATASETkeyword. If this keyword is set to a URI, then XSD output will be suppressed.
Note:The XSD_DOC directive applies if any of the special feature types XML_ROOT_ELEMENT and XML_FRAGMENT are present.
Workbench Parameter:XML Schema Document
例子:
XML_XSD_DOC c:\data\purchases.xsd
TARGET_NS_URI
必需/可选:Optional
This keyword allows the specification of the target namespace URI for the generated XML Schema document. All elements in the XML Schema document will reside in this namespace.
The default value for this keyword is:
http://www.亚搏在线safe.com/xml/xmltables
Workbench Parameter:Target Namespace URI
例子:
XML\u目标\u NS\u URIhttp://www.mytables.com/purchappies
TARGET_NS_PREFIX
这个指令允许焦油的规范get namespace prefix for the generated XML Schema document.
The default value depends on the value of TARGET_NS_URI. If TARGET_NS_URI is using the default value, the default value for this directive isfme
. If TARGET_NS_URI is not using the default value, the default value for this directive becomes the default prefix, which is the empty string.
必需/可选
Optional
映射文件语法
XML\u目标\u NS\u前缀ps
Workbench Parameter
目标命名空间前缀
XML_NAMESPACE_DECLARATIONS
必需/可选
Optional
This keyword specifies additional XML Namespace Declarations for the root element in the output dataset. The values for this directive are white space separated prefix and URIs pairs, no default namespace declarations are allowed with this directive.
例子
XML_NAMESPACE_DECLARATIONS gml http://www.opengis.net/gml xlink http://www.w3.org/1999/xlink
Workbench Parameter
XML Namespace Declarations
TABLES_SEQUENCE
必需/可选
Optional
The sequence order for the rows in the outputDATASETdefaults to following the order of the XMLDEFline specification in the FME mapping file. This keyword allows the user to change the order by specifying a sequence of table names; the sequence must be a subset of the tables defined by theDEF线。
例子
If the XMLDEFlines define four tables with names – state, river, city, and road – then theTABLES_SEQUENCE可通过指定以下内容来控制城市、州、河流和道路的输出顺序顺序:
XML\u表\u序列“城市州河路”
or
XML_TABLES_SEQUENCE ‘city state’
第二种选择是有效的,因为未列出的其余表将按照映射文件XML的顺序输出DEF线。
Note:The value of the XML_TABLES_SEQUENCE keyword must be enclosed in quotes if more than one table is listed.
TABLES_ROOT_ELEMENT
必需/可选:Optional
允许为输出指定根元素名称DATASET. If it is not specified, the root element name defaults toxml-tables.
Workbench Parameter:Tables Root Element Name
例子:
XML\u表\u根\u元素购买
WRAP_TABLES
必需/可选:Optional
The valid values for this keyword are对andno.When this keyword is set to对, the elements which represent the rows for a particular table within the outputDATASETdocument will be wrapped by a container element. The default value for this keyword is对.
The wrapper element name will be the name of the rows prepended by the value of theTABLE_WRAPPER_PREFIX并以TABLE_WRAPPER_SUFFIX.
Workbench Parameter:包装表格元素
例子:
XML_WRAP_TABLES yes
TABLE_WRAPPER_PREFIX
必需/可选:Optional
此关键字与WRAP_TABLESkeyword, and will take effect only if that keyword is set to对. 此关键字的默认值为空字符串。
Workbench Parameter:Table Wrap Prefix
例子:
XML\u表\u包装器前缀-
TABLE_WRAPPER_SUFFIX
必需/可选:Optional
此关键字与WRAP_TABLESkeyword and will take effect only if that keyword is set to对. The default value for this keyword is-table.
Workbench Parameter:表格包装后缀
例子:
XML_TABLE_WRAPPER_SUFFIX -mytables
抑制\u XML\u文档
必需/可选:Optional
此关键字的有效值为是和否。此关键字允许抑制实际XML文档。此关键字的默认值为否。
Workbench Parameter:Suppress XML Document
例子:
XML_SUPPRESS_XML_DOCUMENT no
SUPPRESS_XSD_DOCUMENT
必需/可选:Optional
此关键字的有效值为是和否。此关键字允许抑制XML架构文档。如果XSD_DOC关键字设置为URI,无论此值如何,XSD输出都会被抑制。此关键字的默认值为否。
Workbench Parameter:Suppress XSD Output
例子:
XML\u抑制\uXSD\u文档编号
GENERATE_XFMAP
Note:自FME 2013起,本指令已被否决。
必需/可选:Optional
The valid values for this keyword are对andno. This keyword allows the generation of a tailored xfMap document that can be used by the XML Reader to read the outputDATASETdocument back to the FME. The default value for this keyword isno.
Workbench Parameter:Generate XML Map Document
例子:
XML_GENERATE_XFMAP yes
XFMAP
Note:自FME 2013起,本指令已被否决。
必需/可选:Optional
This keyword takes effect only ifGENERATE_XFMAPis set to对; it specifies the location and filename for the xfMap document to be generated. If it is not specified, then the location defaults to the same folder as the one inDATASET,文件名将成为basenameDATASET加上.xmp文件extension.
Workbench Parameter:XML映射文档
例子:
XML\uxMap c:\data\采购.xmp
GENERATE_ROW_ID
必需/可选:Optional
The valid values for this keyword are对andno. When this keyword is set to对, an ID attribute of XML Schema type ID will be generated for each element that represents a row of a table. The name of the attribute may be set by theROW_ID_ATTR_NAMEkeyword. The values generated for the ID attribute will be unique for the entire outputDATASET. 唯一值只是从1开始的正整数计数生成的,并且由于XML模式ID类型不允许ID以数字开头,因此行\u ID\u前缀keyword’s value is used to prefix the ID. The default value for this keyword isno.
Workbench Parameter:生成行ID属性
例子:
XML\u生成\u行\u ID yes
ROW_ID_ATTR_NAME
必需/可选:Optional
This keyword only takes effect ifGENERATE_ROW_IDis set to对. 它为表示表行的每个元素指定ID属性的名称。此关键字的默认值为”行id”.
Workbench Parameter:行ID属性名称
例子:
XML_ROW_ID_ATTR_NAME myID
行\u ID\u前缀
必需/可选:Optional
This keyword only takes effect ifGENERATE_ROW_IDis set to对. It specifies the prefix for the unique positive integers that are generated as the values for the row IDs. This value may not start with a digit and its default value is “身份证件”.
Workbench Parameter:行ID前缀
例子:
XML_ROW_ID_PREFIX fid
Will generate ID values:fid1、fid2、fid3、,....
应用\u样式表
必需/可选:Optional
This keyword allows an XSLT style sheet to be applied to the final outputDATASETdocument. TheSTYLESHEET_RESULT关键字可以与此关键字一起使用,以指定结果转换的位置和文件名。此关键字没有默认值。
Workbench Parameter:XSLT Style Sheet to Apply
例子:
XML_APPLY_STYLESHEET c:\data\myTransform.xsl
STYLESHEET_RESULT
必需/可选:Optional
This keyword only takes effect if应用\u样式表已指定。当该关键字不存在或其值为空字符串时,结果XSLT转换将具有与输出相同的位置和文件名DATASET文件名前缀除外transformed_.
Workbench Parameter:要写入的样式表文件
例子:
XML_STYLESHEET_RESULT c:\data\myTransformedDoc.xml
输出\u编码
必需/可选:Optional
Specifies the encoding for the outputDATASETdocument. The default value for this keyword isUTF-8.
Workbench Parameter:输出数据集编码
例子:
XML_OUTPUT_ENCODING UTF-16
XML_ROOT_ELEMENT_APPEND_PATH
必需/可选:Optional
This keyword specifies a single element, or a path to a single element, in the document specified by theXML_ROOT_ELEMENTfeature type.
Each element in the path is separated by a forward slash, ‘/’, a wildcard, ‘*’, may also be used as the prefix or local-name of the element, e.g., ‘*:e’, ‘p:*’, or just ‘*’, which translates to ‘*:*’.
The keyword default value is the empty string. This will match or select the root element.
Consider the following XML document:
… … …
To insert fragments after the
- SelectXML_ROOT_ELEMENT_APPEND_PATHas “data/initialize”, and
- Set附加\u XML\u片段\u ASas后续的\u兄弟姐妹
或:
- SelectXML_ROOT_ELEMENT_APPEND_PATHas “data/finalize”, and
- Set附加\u XML\u片段\u ASasPRECEDING_SIBLINGS
例子
XML\u XML\u ROOT\u元素\u APPEND\u路径数据/集合
Workbench Parameter
XML_ROOT_ELEMENT Append Path
附加\u XML\u片段\u AS
必需/可选:Optional
This keyword controls how the fragments are inserted into the document in relation to the selected or matched element. The possible values for the parameter are:
- 前一个\u子项
- SUCCEEDING_CHILDREN
- PRECEDING_SIBLINGS
- 后续的\u兄弟姐妹
这些值将与选定或匹配的元素相关。
The default value for this keyword isSUCCEEDING_CHILDREN.
Workbench Parameter
将XML\u片段附加为
例子
XML_APPEND_XML_FRAGMENTS_AS PRECEDING_SIBLINGS