cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Painter-Wakefield <paint...@mc.duke.edu>
Subject Re: XHTML/XSLT issue
Date Fri, 02 Apr 2004 16:48:43 GMT




:)  Not sure how that happened, sorry!  I wonder where those crept in from?

You could try adding this template, although I am dubious it will work:

<xsl:template match="@xmlns"/>

and modify
<xsl:template match="@*|node()"> ....
to
<xsl:template match="@*|node()" priority="-1"> ....


Another possibility is that namespaces are getting attached to the
attributes, although I've never seen it happen.  In that case, you could
replace
<xsl:template match="@*|node()"> ...

with
<xsl:template match="@*">
      <xsl:attribute name="{local-name()}"><xsl:value-of
select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="text()"><xsl:copy/></xsl:template>


FWIW, I don't think the namespace declarations affect behavior on any of
the common browsers.

-Christopher





Christopher,
in all intents and purposes, the code you sent works, but there are a
few instances where I am left with the following:

<image xmlns="" src="artistImage/32/228/202/1.jpg" />

i.e. an xmlns=""

Anything we can do about those?

Peter
On 2 Apr 2004, at 17:23, Christopher Painter-Wakefield wrote:

>
>
>
>
> I think maybe you are missing the context for the code that was
> supplied.
> It looks to me as if it was intended to be used within another
> stylesheet
> (e.g., "priority='-1'").  Here is a complete stylesheet that should
> work if
> you apply it as a separate transform (I tested it briefly):
>
> -----------------cleanup.xsl-------------------
> <?xml version="1.0"?>
> <xsl:stylesheet
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>       version="1.0"
>>
>
> <xsl:template match="*">
>       <xsl:element name="{local-name()}">
>             <xsl:apply-templates select="@*|node()"/>
>       </xsl:element>
> </xsl:template>
>
> <xsl:template match="@*|text()">
>       <xsl:copy/>
> </xsl:template>
>
> </xsl:stylesheet>
> -----------------------------------------------
>
> If you want to not lose comments and that sort of thing, you may need
> to
> add templates, but this will copy everything that counts.
>
> -Christopher
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message