[OpenLayers-Dev] problem with GML v2 parser

Tim Schaub tschaub at opengeo.org
Thu Nov 13 13:25:29 EST 2008


Hey Bart-

Thanks for the report.  If you haven't already, could you attach your 
sample data to a ticket?  It would be good to incorporate it into the 
test data when the issue is closed.  (And we won't have to hunt for this 
email.)

Tim

bartvde at osgis.nl wrote:
> Hi list,
> 
> I've got a slight problem with the GML v2 parser when running it over the
> attached GML file. What I run into is that obj.attributes is undefined,
> but I can't really find an explanation why this is happening ... and
> ofcourse it would be good to know why instead of just patching it the way
> I did below.
> 
> GML/Base.js, readers:
> 
>             "_attribute": function(node, obj) {
>                 var local = node.localName || node.nodeName.split(":").pop();
>                 var value = this.getChildValue(node);
>                 if (!obj.attributes) {
>                     obj.attributes = {};
>                 }
>                 obj.attributes[local] = value;
>             }
> 
> I've also attached an example to reproduce the error.
> 
> obj.attributes is undefined
> /OpenLayers/Format/GML/Base.js
> Line 342
> 
> TIA.
> 
> Best regards,
> Bart
> 
> 
> ------------------------------------------------------------------------
> 
> 
>   GML Parser Example
> 
> Demonstrate the operation of the GML parser.
> 
> This script reads data from a GML file and parses out the coordinates, 
> appending them to a HTML string with markup tags. This markup is dumped 
> to an element in the page.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list