你在这里: Popular Formats > XML(可扩展标记语言)阅读器/写作 > XFMAP. > 映射规则(可选元素) > 使用-映射元素(限制主动搜索集)

使用-映射元素(限制主动搜索集)

<使用映射>执行映射规则的元素更改了默认内容active-search-set(see the主动搜索集的内容(默认内容)。它限制了一个内容active-search-set到其下列映射规则<使用>元素。

例如,如果以下是一个feature mapping rule

 ...<使用映射>  > 

然后,当上面的时候feature mapping rule正在执行,它feature-search-set(回想一下feature-search-setis thefeature mapping rule’sactive-search-set)只能包含feature mapping rulesMR1andMR2

请考虑以下输入XML文档:

drawing.xml

<?XML版本=“1.0”?> <绘图> <图>   0.949  <组件类型=“green”> 0.357 <组件类型=“blue”> 0.283   <颜色类型=“前景”> <组件类型=“红色”> 0.532  <组件类型=“绿色”> 0.899  <组件类型=“蓝色”> 0.521    

以下XFMAP文档映射上面的映射

元素到FME功能:

drawing.xmp

<?xml版本=“1.0”?> <!doctype xfmap系统“xfmap.dtd”>           <! -使用映射元素将限制特征搜索集以仅包含MR_Colors映射规则。来自Color元素的类型属性的值将作为MR_Colors映射规则的参数传递。--> <use-mappings>        >  <--这signature of this mapping rule has 1 named parameter called colorType, its value is passed as an argument from the mapping rule above. --> <signature name=”mr_colors”>    > <属性>   <! - 访问ColorType参数。- >     <值>     < - 注意:此映射规则没有使用映射元素。当该映射规则正在执行特征搜索集时,设置为其默认内容。也就是说,在要素内容映射下定义的所有功能映射规则 - >   

创建的FME功能是:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Feature Type: `figure' Attribute: `background.blue' has value `0.283' Attribute: `background.green' has value `0.357' Attribute: `background.red' has value `0.949' Attribute: `foreground.blue' has value `0.521' Attribute: `foreground.green' has value `0.899' Attribute: `foreground.red' has value `0.532' Attribute: `xml_type' has value `xml_no_geom' Geometry Type: Unknown (0) =======================================================================