[OpenLayers-Dev] XML parsing, SLD parsing

Andreas Hocevar andreas.hocevar at gmail.com
Mon Nov 5 15:53:39 EST 2007


Tim,

On 11/5/07, Tim Schaub <tschaub at openplans.org> wrote:
> Guess my question was - where do you need node.text or node.textContext
> instead of using the standard node.nodeValue?

Ah, now you're talking! The reason is that in CSS, two ways of
defining properties are common:

(1)
<CssParameter name="myParam">myValue</CssParameter>

(2)
<CssParameter name="myParam">
    <ogc:Literal>myValue</ogc:Literal>
</CssParameter>

To check for both with one statement, I use text || textContent.

Is this ok, or would you rather see a fallback if ogc:Literal is not found?

Regards,
Andreas.



More information about the Dev mailing list