How to get comments stored in <![CDATA[]>

46 views
Skip to first unread message

Jeffrey Backes

unread,
Apr 23, 2015, 1:20:25 AM4/23/15
to javaap...@googlegroups.com
I need to get to the comments in a Google Maps generated file:

<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
    <Document>
        <name>2014 August Vacation</name>
        <description><![CDATA[Driving tour of Paris]]></description>



I have tried using:

    kml = Kml.unmarshal(new File(path), false);


    if (kml == null) {
      throw new RuntimeException(".kml files was not found in " + path);
    }

    Object feature = kml.getFeature();

    if (!(feature instanceof Document)) {
      throw new RuntimeException("Parse error #1");
    }

    Document document = (Document) feature;

 
But the "Document" class contains no method to get to the comments.  I was hoping to find a setIgnoreComments() method off Document or kml, but alas no luck.

What am I doing wrong?

jeff
Reply all
Reply to author
Forward
0 new messages