Thomas Rokkjaer | 3 Jul 10:00 2007
Picon

Re: Parsing XML Error

My URL looks like the following (ie GML):
GetFeatureInfo.xsl:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:wmc="http://www.opengis.net/context" xmlns:xlink=" http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="xml"/><xsl:strip-space elements="*"/><xsl:param name="queryLayer">highways</xsl:param><xsl:param name="xCoord">1</xsl:param><xsl:param name="yCoord">1</xsl:param><xsl:param name="infoFormat">text/html</xsl:param><xsl:param name="imgFormat">image/png</xsl:param><xsl:param name="featureCount">1</xsl:param><xsl:variable name="bbox"><xsl:value-of select="/wmc: ViewContext/wmc:General/wmc:BoundingBox/ <at> minx"/>,<xsl:value-of select="/wmc:ViewContext/wmc:General/wmc:BoundingBox/ <at> miny"/>,<xsl:value-of select="/wmc:ViewContext/wmc:General/wmc:BoundingBox/ <at> maxx "/>,<xsl:value-of select="/wmc:ViewContext/wmc:General/wmc:BoundingBox/ <at> maxy"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="/wmc:ViewContext/wmc:General/wmc:Window/ <at> width "/></xsl:variable><xsl:variable name="height"><xsl:value-of select="/wmc:ViewContext/wmc:General/wmc:Window/ <at> height"/></xsl:variable><xsl:variable name="srs" select="/wmc: ViewContext/wmc:General/wmc:BoundingBox/ <at> SRS"/><xsl:template match="/"><url><xsl:apply-templates select="wmc:ViewContext/wmc:LayerList"/><error>URL not calculated for layer=<xsl:value-of select="$queryLayer"/></error></url></xsl:template><xsl:template match="wmc:Layer"><xsl:if test="contains($queryLayer,wmc:Name)"><xsl:variable name="version"><xsl:value-of select=" wmc:Server/ <at> version"/></xsl:variable><xsl:variable name="baseUrl"><xsl:value-of select="wmc:Server/wmc:OnlineResource/ <at> xlink:href"/></xsl:variable><xsl:variable name="firstJoin"><xsl:choose><xsl:when test="substring($baseUrl,string-length($baseUrl))='?'"/><xsl:when test="contains($baseUrl, '?')">&amp;</xsl:when><xsl:otherwise>?</xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="$baseUrl"/><xsl:value-of select="$firstJoin"/>VERSION=<xsl:value-of select="$version"/>&amp;REQUEST=GetFeatureInfo&amp;LAYERS=<xsl:value-of select="$queryLayer"/>&amp;SRS=<xsl:value-of select="$srs"/>&amp;BBOX=<xsl:value-of select="$bbox"/>&amp;WIDTH=<xsl:value-of select="$width"/>&amp;HEIGHT=<xsl:value-of select="$height"/>&amp;INFO_FORMAT=<xsl:value-of select="$infoFormat"/>&amp;FORMAT=<xsl:value-of select="$imgFormat"/>&amp;FEATURE_COUNT=<xsl:value-of select="$featureCount"/>&amp;QUERY_LAYERS=<xsl:value-of select="$queryLayer"/>&amp;X=<xsl:value-of select="$xCoord"/>&amp;Y=<xsl:value-of select="$yCoord"/></xsl:if></xsl:template></xsl:stylesheet>
 
/Thomas
 
On 7/3/07, Andrea Aime <aaime <at> openplans.org> wrote:
Thomas Rokkjær ha scritto:
> Hi Andrea
>
> Sorry for the late reply. But here goes...
>
> The stroked o "ø" should be reported directly.
> If I fetch the url, which is being used in my GetFeatureInfo and sends
> this directly to Firefox or IE then I get a correctly formated response
> from the GeoServer too (including the danish characters reported directly).
> But when it is displayed within the index.html page the danish
> characters gives the beforementioned error in IE and are displayed in
> Firefox with a "?" or the classic "unknown symbol" instead of danish
> characters.

I see... which format do you use for GetFeatureInfo?
If it's XML and then you do some XSLT, it's the client side business
to handle the issue, because we generate correct XML.
If instead you're asking data in another format, such as HTML, then
yeah, I guess Geoserver is not properly escaping these character
into correct HTML escape codes (I'll have to look for a library that
is able to do proper HTML entity escaping).

Cheers
Andrea



--
Med venlig hilsen

Thomas Rokkjær
Mobil 3095 0774

http://picasaweb.google.com/thomas.rokkjaer
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Andrea Aime | 6 Jul 19:42 2007

Re: Parsing XML Error

Thomas Rokkjaer ha scritto:
> My URL looks like the following (ie GML):
> " 
>
http://infudv1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=brnby:testPoints_point&SRS=EPSG:25832&BBOX=710084.36,6168442.59,719205.09,6175139.87&WIDTH=600&HEIGHT=400&INFO_FORMAT=application/vnd.ogc.gml&FORMAT=image/png&FEATURE_COUNT=1&QUERY_LAYERS=brnby:testPoints_point&X=288&Y=192 
> <http://infudv1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=brnby:testPoints_point&SRS=EPSG:25832&BBOX=710084.36,6168442.59,719205.09,6175139.87&WIDTH=600&HEIGHT=400&INFO_FORMAT=application/vnd.ogc.gml&FORMAT=image/png&FEATURE_COUNT=1&QUERY_LAYERS=brnby:testPoints_point&X=288&Y=192>"
>  
> GetFeatureInfo.xsl:
> <?xml version="1.0"?>

Hmmm... this look like a client side issue. The trouble is
that your XSLT does not handle the transformation from the direct
stroked o (valid in XML) to the HTML escape code.
May it be that you have to set the output method of xslt to html?

See this thread (found googling for "xslt escape"):
http://www.stylusstudio.com/xsllist/200406/post40240.html#

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane