Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDATA section ignored in KML description #17

Closed
ghost opened this issue Sep 6, 2014 · 7 comments
Closed

CDATA section ignored in KML description #17

ghost opened this issue Sep 6, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2014

When I load a KML file the KML description is ignored when it's inside a CDATA section.

This works just fine,

      <description>
           Here is some text
      </description>

but not this one;

      <description>
        <![CDATA[
             Here is some text
        ]]>
      </description>

It seems an old issue in togeojson.js and should be fixed mapbox/togeojson#42
Using the latest togeojson.js file doesn't solved my problem.

Is this a leaflet.filelayer issue or togeojson.js ?

Regards,

Robertico

@leplatrem
Copy link
Collaborator

Hi Robertico !

This part parses the XML into nodes and gives it to togeojson :
https://github.com/makinacorpus/Leaflet.FileLayer/blob/gh-pages/leaflet.filelayer.js#L80-L82

If the problem was fixed in togeojson, we might pass the raw XML instead of parsing it here...

Could you try to change this and see if it helps ?

Thanks for reporting!

@ghost
Copy link
Author

ghost commented Sep 13, 2014

Hi,

I'm not sure I understand you correctly.
Do I need to comment out these lines? When I do so, it doesn't work at all.

Sorry, I'm not a professional programmer :-)

@leplatrem
Copy link
Collaborator

Well, I upgraded togeojson towards 0.8.1, and it works wel, it strips out CDATA out of texts !

@ghost
Copy link
Author

ghost commented Sep 17, 2014

I doubted my findings, but...
this doesn't work.

      <description>
        <![CDATA[
             Here is some text
        ]]>
      </description>

but this does !

<description><![CDATA[Here is some text]]></description>

So it must be a single line without line breaks.
As far as I know they're both valid. Nevertheless a bug?

@leplatrem
Copy link
Collaborator

In the example I tried it worked.
But this way :

<description><![CDATA[

             Here is some text
]]></description>

Otherwise, it would be a bug in togeojson...

@ghost
Copy link
Author

ghost commented Sep 19, 2014

Thanks. Created a new issue on togeojson for this.

@SBats
Copy link
Contributor

SBats commented Sep 7, 2016

I close this issue. If someone has still problems with it please reopen !

@SBats SBats closed this as completed Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants