[OpenLayers-Dev] GML parser and attribute nodes
bartvde at osgis.nl
bartvde at osgis.nl
Wed Feb 4 04:00:25 EST 2009
Typo in my post, the last one should be _geometry, so:
if(node.childNodes.length == 1 &&
node.firstChild.nodeType == 3) {
if(this.extractAttributes) {
name = "_attribute";
}
} else if (node.childNodes.length == 0) {
name = "_attribute";
} else {
name = "_geometry";
}
> Hi list,
>
> currently the GML/Base.js parser ignores attribute nodes like:
>
> <rws:ELEMENTCODE></rws:ELEMENTCODE>
>
> This is because of the following check:
>
> if(node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
>
> However, I would like to parse this type of attribute node (because
> otherwise I will have to protect all code that does something with the
> features against this case, e.g. JSON encoding the features and exporting
> them to Excel results in a shifting columns problem), so I've modified
> Base.js in the following way:
>
> if(node.childNodes.length == 1 &&
> node.firstChild.nodeType == 3) {
> if(this.extractAttributes) {
> name = "_attribute";
> }
> } else if (node.childNodes.length == 0) {
> name = "_attribute";
> } else {
> name = "_attribute";
> }
>
>
> Is this something general, or very specific to my use-case? Should I open
> up a ticket with a patch?
>
> Best regards,
> Bart
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
More information about the Dev
mailing list