[OpenLayers-Dev] XML parsing, SLD parsing

Andreas Hocevar andreas.hocevar at gmail.com
Sat Nov 3 18:36:59 EDT 2007


thanks for looking at my SLD renderer patch!

On 11/3/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> There's a 'getChildValue' method on the Format.XML class -- will this
> work in place of getXmlNodeValue?

It works when I want to get the value of the first child. But it does
not work on a text node, where I would have to use node.textContent in
FF and node.text in IE, like in Util.getXmlNodeValue.

I changed the sld parser now to user getChildValue where approprieate,
and node.text || node.textContent elsewhere.

> If you could give this a try, and see if it works, ti would be great to
> move away from anything in a non Format.XML namespace. If it turns out
> not to work, then we'll probably need to add more to the Format.XML
> class to handle it -- Tim might be able to comment on that more if it
> comes to that.

I would propose to add another convenience method in
OpenLayers.Format.XML, called eg. getTextContent, which would be
node.textContent in a cross-browser manner.

What do you think?


More information about the Dev mailing list