![]() ![]() Example:įme:set-list-attribute( "names", /countries/country/name/text() ),įme:set-list-attribute( "capitals", /countries/country/capital ) The function serializes each value in the sequence into an element in the list attribute. This function sets the value of a feature list attribute. The feature has the following attributes: Attribute The following XML document is the context item for the examples in this section.įme:set-attribute( "name_xml", /country/name ),įme:set-attribute( "area", /country/area/text() ),įme:set-attribute( "city_list", /country/cities/city/text() ),įme:set-attribute( "city_list2", /country/cities/city/text(), "|" ) The default delimiter is a comma, but the third parameter may be used to provide a different delimiter. If the sequence contains more than one value, the values will be concatenated into a delimited string, and the attribute will be set to this concatenated value. The feature attribute will be set to the serialized value of the sequence of values. This function sets the value of a feature attribute. The fme:get-xml-list-attribute function may be used as shown below: XQuery If the delimiter parameter is provided, it will be copied into the return sequence between each parsed XML value. Values which are not valid XML will be skipped. The function attempts to parse each value in the list attribute into an XML node. This function is similar to the fme:get-xml-attribute function, but retrieves list attributes. "dates" : fme:get-list-attribute("dates") The fme:get-list-attribute function returns the following results: XQuery ![]() Example:Ĭonsider a feature with the following attributes: The fme:get-xml-list-attribute function may be used to retrieve a list of XML nodes, and the fme:get-json-list-attribute function may be used to retrieve a list of JSON objects or arrays. If a delimiter parameter is provided, the function will serialize the contents of the list attribute into a single string, using the value of the delimiter parameter as a delimiter.Īs with the fme:get-attribute function, all string values returned by this function will be converted to be valid XML or JSON strings, depending on the context of the function call. If no delimiter parameter is provided, the function will return the list attribute as a sequence of individual items. ![]() This function retrieves the contents of a list attribute from the current feature. "location" : fme:get-attribute( "location" ) The fme:get-attribute function returns the following results: XQuery Example:Ĭonsider a feature with the following attributes: Attribute ![]() The fme:get-json-attribute may be used to return JSON objects or arrays. Similarly, if the value is being inserted into a JSON document, the value will be enclosed in quotes, and reserved characters will be escaped. The fme:get-xml-attribute function may be used to return XML nodes. In particular, if the value is being inserted into an XML document, any XML syntax will be escaped. String values returned by this function will be converted to be serializable in the context in which they are used. If a second parameter is not provided, and the feature has no value for the given attribute, the function will simply return an empty sequence. The second parameter may be any type of XQuery value: string, number, XML node, nested function call, etc. If a second parameter is provided, and the feature does not have a value for the given attribute name, the function will simply return the value of the second parameter. This function retrieves the value of an attribute from the current feature. ![]()
0 Comments
Leave a Reply. |