[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: ExtendedData from KML

Subject: Re: ExtendedData from KML
From: Alan Hale <alan.hale@xxxxxxxxxxx>
Date: Tue, 17 Mar 2009 22:02:51 +0000
Re:  ExtendedData from KML
Many thanks for the swift reply Michael.

Just simple comma-separated values, one line per placemark - and what you have suggested works fine (with the insertion of the ExtendedData element) so:

<xsl:value-of select="ExtendedData/Data[@name='grid_ref']/value"/>

Thanks again.

Alan Hale
Aberystwyth

Michael Kay wrote:
It's not clear what you want the output to be, but my guess would be you are
looking for something like

<xsl:value-of select="Data[@name='grid_ref']/value"/>

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Alan Hale [mailto:alan.hale@xxxxxxxxxxx] Sent: 17 March 2009 21:43
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: ExtendedData from KML


Hi

I am attempting to convert a KML file to CSV using XSLT. I can succeed with most elements and attributes, along these lines:

    <xsl:template match="Folder">
         <xsl:for-each select="Placemark">
            <xsl:value-of select="@id" />,
            <xsl:value-of select="name" />,
            <xsl:value-of select="Point/coordinates" />,
            <xsl:value-of select="Snippet" />
            <br />
        </xsl:for-each>
    </xsl:template>

but I don't know how to deal with the ExtendedData section which has multiple <Data> elements identifed with individual attributes, e.g.:

 <ExtendedData>
          <Data name="sciencName">
            <value>Acer campestre</value>
          </Data>
          <Data name="grid_ref">
            <value>SN593798</value>
          </Data>
          <Data name="eng_name">
            <value>Field Maple</value>
          </Data>
          <Data name="rdb_status">
            <value>Lower risk - least concern</value>
          </Data>
</ExtendedData>

Any advice much appreciated.

Thanks

Alan Hale
Aberystwyth

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.