属性元素(处理多个值)
该xfMap
当我们想从XML文档流信息到FME要素的属性,并将该信息映射到具有多个值的属性,那么我们就可以:
- use a “primitive attribute” and append, with a separator character, the multiple values into one string, or
- use the FME attribute list, or
- 保留一个属性值从多个值。
该
多值选项
当值了类型属性多值,那么
该following example sets the separator for the appended values to be the pipe character:
...
属性>
An extra attribute on the FME feature may also be created counting the number of values in the multi-value attribute. The创建计数属性是可以使用的可选属性,当类型属性被设置为多值;其有效值是和no,withnobeing its default value.
计数属性的名称是基于在指定的名称相同表达序列of the
伯爵属性的前缀和后缀可以通过指定计数属性名称前缀和count-attribute-name-suffixattributes, respectively.
Both计数属性名称前缀和count-attribute-name-suffix是可选属性。为默认值计数属性名称前缀is the empty string, while the default value for thecount-attribute-name-suffixis计数。该count-attribute-name-suffix不得为空字符串时,它是存在的。
列表选项
当值了类型属性名单,then a multiple value attribute in the input XML document stream will be converted into an attribute list for the FME feature that is under construction.
单值期权
This is the default value for the类型属性。一个属性可以与一个特定的名称only have one value in the FME feature.
该
例
下面的示例示出了多个值处理。考虑下面的输入XML和xfMap文件:
purchase.xml
<?XML版本= “1.0”?> <购买日期= “1999-10-20”> <项目>的- 无线电项目>的
- 牙刷项目>的
- 毛巾项目> <项目>肥皂项目>的
- 瓶装水项目> 项目> 采购>
purchase.xmp
该following shows a log of the FME feature constructed when thepurchase.xml和purchase.xmp文档被送入XML阅读器:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
功能类型:购1999-10-20'
属性:第一项“具有价值电台”
Attribute: item-at-3-(4th item)' has value Soap'
Attribute: items1' has value Radio,Toothbrush,Towel,Soap,Bottled Water'
属性:items2' 具有价值收音机:牙刷:毛巾:肥皂:瓶装水”
属性:最后一个项目“具有价值瓶装水”
属性:列表ATTR {0}“价值电台”
Attribute: list-attr{1}' has value Toothbrush'
Attribute: list-attr{2}' has value Towel'
属性:列表ATTR {3}“的价值肥皂”
Attribute: list-attr{4}' has value Bottled Water'
属性:XML_TYPE“具有价值xml_no_geom”
Attribute: list-attr{0}' is sequenced
属性:列表ATTR {1}”测序
Attribute: list-attr{2}' is sequenced
Attribute: list-attr{3}' is sequenced
属性:列表ATTR {4}”测序
几何类型:未知(0)
+========================================================================