[OpenLayers-Dev] GML parser and attribute nodes

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Wed Feb 4 13:10:51 EST 2009


Hey Tim,

sorry for not providing a test case, it just slipped my mind in this 
case. I was also trying to see if there was interest before going to the 
trouble, so you've beat me to it in a way. Thanks.

I've just run tests before and after applying the patch in IE7, and can 
confirm things work okay, except the usual suspect overview map failing 
1 test, but there is an open ticket for that already.

Thanks again.

Best regards,
Bart

Tim Schaub wrote:
> Hey-
>
> Christopher Schmidt wrote:
>   
>> On Wed, Feb 04, 2009 at 09:53:27AM -0700, Tim Schaub wrote:
>>     
>>> Hey-
>>>
>>> bartvde at osgis.nl wrote:
>>>       
>>>> 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";
>>>>                     }
>>>>
>>>>         
>>> Yeah, I like the look of that better :).
>>>
>>> I think this sounds good.  Please open a ticket.
>>>       
>> http://trac.openlayers.org/ticket/1927
>>     
>
> Bart, I added some tests.  If someone runs them in IE, I'll commit.
>
> Also, if you can't provide a test with a patch, at least some sample 
> data helps.  I get tired of making up GML all the time.
>
> Tim
>
>   
>>> Tim
>>>
>>>       
>>>>> 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
>>>>>
>>>>>           
>>>> _______________________________________________
>>>> 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.
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at openlayers.org
>>> http://openlayers.org/mailman/listinfo/dev
>>>       
>
>
>   


-- 
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at osgis.nl
http://www.osgis.nl




More information about the Dev mailing list