Entity Replacement Change Requests | OGC

OGC 07-147r2 24 Copyright © 2007, 2008 Open Geospatial Consortium, Inc. All Rights Reserved. Document Style id=myPrettyDocument ListStyle ... ListStyle Style styleUrlmyPrettyDocument ... Document The following example illustrates the use of a shared style. kml xmlns=http:www.opengis.netkml2.2 Document nameDocument.kmlname open1open Style id=exampleStyleDocument LabelStyle colorff0000cccolor LabelStyle Style Placemark nameDocument Feature 1name styleUrlexampleStyleDocumentstyleUrl Point coordinates-122.371,37.816,0coordinates Point Placemark Placemark nameDocument Feature 2name styleUrlexampleStyleDocumentstyleUrl Point coordinates-122.370,37.817,0coordinates Point Placemark Document kml

6.5 Entity Replacement

Entity substitution is employed as a template mechanism within the kml:BalloonStyle kml:text element. Individual values shall be substituted for each instance of the entity, or a null string if no value exists. The source of values for entity substitution is local to the kml:AbstractFeatureGroup being styled and any kml:Schema elements associated with it. Entity syntax for identifying a substitution value is as follows: 1. [element_or_attribute_name], where element_or_attribute_name is the name of a field element or attribute of the kml:AbstractFeatureGroup . This identifies the value of the field element or attribute. 2. [name_attribute_of_Data_element], where name_attribute_of_Data_element is the value of the kml:name attribute of a descendant kml:Data element of the kml:AbstractFeatureGroup . This identifies the value of the child kml:value element of the kml:Data element. OGC 07-147r2 Copyright © 2007, 2008 Open Geospatial Consortium, Inc. All Rights Reserved. 25 3. [name_attribute_of_Data_elementdisplayName], where name_attribute_of_Data_element is the value of the kml:name attribute of a descendant kml:Data element of the kml:AbstractFeatureGroup ; is a separator; and displayName is the value of the kml:displayName attribute of the kml:Data element. This identifies the value of the kml:displayName attribute. 4. [TYPENAMETYPEFIELD], where TYPENAME is the value of the kml:name attribute of a descendant kml:Schema element of the kml:AbstractFeatureGroup ; is a separator; and TYPEFIELD is the value of the kml:name attribute of a child kml:SimpleField element of the kml:Schema element . This identifies the value of a descendant kml:SimpleData element of the kml:AbstractFeatureGroup that references the kml:SimpleField element. 5. [TYPENAMETYPEFIELDdisplayName], where TYPENAME is the value of the kml:name attribute of a descendant kml:Schema element of the kml:AbstractFeatureGroup ; is a separator; and TYPEFIELD is the value of the kml:name attribute of a child kml:SimpleField element of the kml:Schema element; and displayName is the value of the child kml:displayName element of the kml:SimpleField element. This identifies the value of the kml:displayName element. For example, the [name] and [description] entities in the following kml:BalloonStyle kml:text element shall be replaced by the kml:name and kml:description values of kml:AbstractFeatureGroup elements associated with the kml:BalloonStyle : textThis is [name], whose description is:br[description]text

6.6 Extension Model