<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Yes. Thanks for the answer. This is an extract of the code.</span></div><div><br><span></span></div><div style="font-style: italic;"><span>puntigml = new OpenLayers.Layer.GML("Specimens", "/gis/GeoLayer.gml",{projection: new OpenLayers.Projection("EPSG:4326")});</span></div><div style="font-style: italic;"><span>map.addLayer(puntigml);</span><span><br></span></div><div style="font-style: italic;"><span>select_feature_control =new OpenLayers.Control.SelectFeature(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; puntigml,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; multiple: false,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; toggle: true,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; multipleKey: 'shiftKey',<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; toggleKey: 'ctrlKey',<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; box: true&nbsp;&nbsp;
 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>map.addControl(select_feature_control);</span></div><div style="font-style: italic;"><br><span></span></div><div style="font-style: italic;"><span>function selezione_elemento(event) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //info record<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var
 tipo=event.feature.attributes.type; </span><span>// comment#1</span><br><span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var collect=event.feature.attributes.place.name; //comment#2<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var famiglia=event.feature.attributes.family;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var specie=event.feature.attributes.species;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById('tipo').innerHTML=tipo;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.getElementById('collection').innerHTML=collect;<br></span></div><div style="font-style: italic;"><span>}</span></div><div style="font-style: italic;"><span>puntigml.events.register('featureselected', this, selezione_elemento);</span></div><div><br><span></span></div><div><span>This is an example of my gml file</span></div><div><br><span></span></div><div style="font-style:
 italic;"><span>&lt;gml:featureMember&gt;</span></div><div style="font-style: italic;"><span>&lt;gml:Specimens&gt;</span></div><div style="font-style: italic;"><span>&lt;type&gt;herbaria&lt;/type&gt; // comment#1<br></span></div><div style="font-style: italic;"><span>&lt;species&gt;Quercus cerris L.&lt;/species&gt;</span></div><div style="font-style: italic;"><span>&lt;place&gt;</span></div><div style="font-style: italic;"><span class="tab">&nbsp;&nbsp;&nbsp; </span><span>&lt;name&gt;Valle di Copogna-Monte Lago&lt;/name&gt; //comment #2<br></span></div><div style="font-style: italic;"><span class="tab">&nbsp;&nbsp;&nbsp; </span><span>&lt;town&gt;Serravalle di Chienti&lt;/town&gt;</span></div><div style="font-style: italic;"><span class="tab">&nbsp;&nbsp;&nbsp; </span><span>&lt;province&gt;Macerata&lt;/province&gt;</span></div><div style="font-style: italic;"><span class="tab">&nbsp;&nbsp;&nbsp;
 </span><span>&lt;region&gt;Marche&lt;/region&gt;</span></div><div style="font-style: italic;"><span class="tab">&nbsp;&nbsp;&nbsp; </span><span>&lt;country&gt;Italia&lt;/country&gt;</span></div><div style="font-style: italic;"><span>&lt;/place&gt;</span></div><div style="font-style: italic;"><span>&lt;ogr:geometryProperty&gt;</span></div><div style="font-style: italic;"><span>&lt;gml:Polygon srsName="EPSG:4326"&gt;</span></div><div style="font-style: italic;"><span>&lt;gml:outerBoundaryIs&gt;</span></div><div style="font-style: italic;"><span>&lt;gml:LinearRing&gt;</span></div><div style="font-style: italic;"><span>&lt;gml:coordinates&gt;12.916666749999999,43.100000000000001 13,43.100000000000001 13,43.149999999999999 12.916666749999999,43.149999999999999 12.916666749999999,43.100000000000001&lt;/gml:coordinates&gt;&lt;/gml:LinearRing&gt;</span></div><div style="font-style: italic;"><span>&lt;/gml:outerBoundaryIs&gt;</span></div><div style="font-style:
 italic;"><span>&lt;/gml:Polygon&gt;</span></div><div style="font-style: italic;"><span>&lt;/ogr:geometryProperty&gt;</span></div><div style="font-style: italic;"><span>&lt;/gml:Specimens&gt;</span></div><div style="font-style: italic;"><span>&lt;/gml:featureMember&gt;</span></div><div><br><span></span></div><div><span>When I try to access to a first order node like &lt;type&gt; or &lt;species&gt; the selection function works (look comment #1) but when I try to access to a subtag doesn't extract any information and the firebug result is <br></span></div><div><span><span style="font-style: italic;">event.feature.place is undefined - var collect=event.feature.place.name;</span><br></span></div><div><br></div><div>Thanks again,</div><div><br></div><div><br></div><div>Francesco<br></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif;
 font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">Da:</span></b> Pierre Stévens &lt;pieside@gmx.com&gt;<br> <b><span style="font-weight: bold;">A:</span></b> Francesco Geri &lt;francescogeri@yahoo.it&gt; <br> <b><span style="font-weight: bold;">Inviato:</span></b> Lunedì 16 Aprile 2012 16:12<br> <b><span style="font-weight: bold;">Oggetto:</span></b> Re: [OpenLayers-Users] gml and attributes<br> </font> </div> <br>Hello,<br><br>"event.feature.field1.field2" is normally the right way to access to <br>attribute "field2".<br><br>1. Check if "field2" is correctly written.<br>2. It can be other thing<br><br>Can you give us the real lines (not with &lt;field1&gt;&lt;field2&gt;...&lt;/field1&gt;)? <br>It can help more.<br><br><br>Le lun 16 avr 2012 15:51:32 CEST, Francesco Geri a écrit :<br>&gt; Hello,<br>&gt; I have some problems whie I try to access to the attributes of gml<br>&gt; file
 stored in subtag. Normally when I use the<br>&gt; event.feature.attributes.field1 I can extract the attributes stored in<br>&gt; the node "field1". But when I have a situation like this<br>&gt;<br>&gt; &lt;field1&gt;<br>&gt; &lt;field2&gt;<br>&gt; information<br>&gt; &lt;/field2&gt;<br>&gt; &lt;/field1&gt;<br>&gt;<br>&gt; How I can access to the field2 node? I try with<br>&gt; event.feature.field1.field2 but I obtain an undefined value.<br>&gt;<br>&gt; thanks to all,<br>&gt;<br>&gt;<br>&gt; Francesco<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt; <a ymailto="mailto:Users@lists.osgeo.org" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>&gt; <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br><br><br><br><br> </div> </div>  </div></body></html>