Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: newbie xslt namespace question

From: "Joris Gillis" <roac@-------.-->
To: NULL
Date: 1/3/2005 6:47:00 PM
Hi,

> the problem i have now is that the element ogr:geometryProperty is not
> matched by the template. The problem seems to be the ogr-prefix (which
> is the default namespace in the gml-file).

Apparently, 'http://gdal.velocet.ca/ogr' is the default namespace in the gml-file. The 'ogr' prefix declares a non-default namespace (viz. 'http://ogr.maptools.org/')
Therefore the 'cat' element and the 'ogr:geometryProperty' element can never be matched (in Xpath) with one single namespace (prefix).

You'll have to define yet another prefix in the XSLT that links to 'http://ogr.maptools.org/' in order to match the 'geometryProperty' elment with a prefix.


e.g.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogr="http://gdal.velocet.ca/ogr"
xmlns:OGR='http://ogr.maptools.org/'
xmlns:xs="http://www.w3.org/2001/XMLSchema">

     <xsl:template match="ogr:defol">
       test2
       <xsl:apply-templates select="OGR:geometryProperty"/>
       <xsl:apply-templates select="ogr:site_id"/>
       <xsl:apply-templates select="ogr:cat"/>
     </xsl:template>

     <xsl:template match="OGR:geometryProperty">
       test3
       <xsl:apply-templates select="gml:Polygon"/>
     </xsl:template>
	
</xsl:stylesheet>

regards,

-- 
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Spread the wiki (http://www.wikipedia.org)


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent