第8页
斯潘4
Here is a technique for recursively extracting all attributes from below a tag match. This little trick can allow any FME user to read almost any XML dataset quickly, so it is very powerful. It can also be combined with XML geometry reading methods.
Description许多用户在阅读复杂的xml或gml时遇到问题。方法是使用FME的通用XML读取器。这可以通过特征路径完成。然而,xfmaps是xml解释脚本,它使您能够完全灵活地以您想要的方式读取xml,包括几何图形解释,这是featurepath尚不支持的。基本思想是在featuremapping部分中指定xml结构中要生成要素类型的节点。然后在“要素内容映射”区域中指定这些要素中的每一个要素所包含的内容。XfMap Structure CommandThis can take a fair bit of time to list out all your attributes, so here is a technique for recursively extracting all attributes from below a tag match. This little trick can allow any FME user to read almost any xml dataset, so it is very powerful.The 'mapping match="Feature/*"' means that this maps all children whose parent is to: attribute1=John attribute2=wincover activeDate\u from=11-22-99 activeDate\u to=12-11-09 ConsiderationsThe only caveat is that it builds attribute names of the form parent_childAttrbite for everything below the tag matched. Also, where 'childAttribute' occurs multiple times, you get a list construct in FME childAttribute{0}, childAttribute{1}. You could then decide to match the tag at the childAttribute level rather than the parent level, or you could use a ListExploder within FME to create individual features for every list element. Source XML exampleSuppose we want to read the source xml below. The structure command above would allow us to read all the attributes below the
Adding Geometry to Structure XFMapsThe trick is to define an exception so that we dont try to render the geometry field 'Coordinate_BOX' automatically into an attribute. We do this by qualifying the mapping expression with:
|
© 2020 Safe Software Inc |法律