Page 1 of 1

XSLT : Some rubbish in html output

Posted: Mon Feb 25, 2008 4:53 pm
by michel.weber
After transforming the XML rsult stream via XSLT, the resulting HTML contains some rubbish XML which is not in the initial XML stream.

<ResultTitle xmlns:u="http://www.thunderstone.com/ParametricSearch/1.0/" xmlns:gml="http://www.opengis.net/gml">
<Abstract xmlns:u="http://www.thunderstone.com/ParametricSearch/1.0/" xmlns:gml="http://www.opengis.net/gml">
<UrlDisplay xmlns:u="http://www.thunderstone.com/ParametricSearch/1.0/" xmlns:gml="http://www.opengis.net/gml">

Although common browsers don't seem to have a problem with this, could this be cleaned up?

XSLT : Some rubbish in html output

Posted: Tue Feb 26, 2008 9:56 am
by jason112
Both the extra elements and extra namespaces will be removed with an XSL update. If you've customized your XSL, the following changes will need to be made manually:

For the places where ResultTtile, Abastract, and UrlDisplay are shown, they should be changed from this

<xsl:copy-of select="ResultTitle"/>

to this

<xsl:apply-templates select="ResultTitle/child::node()"/>

That gets rid of the elements, but it pushes the namespaces to the <b> tags. Those can be gotten rid of by overriding the default template so it doesn't output the namespaces. Add this additional template:

<xsl:template match="*">
<xsl:element name="{name()}" namespace="{namespace-uri()}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

That should get rid of all the extraneous output.