|
Posted by NiallBCarter on June 18, 2008, 5:04 am
Please log in for more thread options
>
> {'', 'kml'}
>
> Which is a different tuple. Also, the root element in your document is
> this kml element, while your template match attribute looks for a root
> element called 'Document'. To get the names right you have to either
> declare a namespace prefix and use it in your XPath expressions ala
>
> /kml:kml/kml:Document/...
>
> or use predicates with the namespace-uri() and local-name() functions:
>
> /*[local-name() = 'kml' and namespace-uri() = 'http://...']/...
>
So would I be right in saying that it is not as simple as I thought?
> Do note that there are more sophisticated XML/XSLT/XPath modules on
> CPAN, XML::LibXSLT for example.
I am aware that there are more sophisticated modules but I experience
troubles with each one I try. It was suggested that I stick to
XML::XSLT for the moment and try to come up with a work around rather
than have to hassle the IT staff to install more modules on the
managed computer I work on.
Essentially all I want to do is strip out the <kml>, <Document> parts
and be left with a DOM containing <Placemark> and all contents </
Placemark>
Is there a simple way of doing this?
rgds,
Niall
|