cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Bourdeau" <bourd...@ciesin.columbia.edu>
Subject RE: cleaning xmlns attribute with XSL transformation
Date Tue, 16 Jul 2002 13:43:26 GMT
One thing that strikes me is that you're tranferring XML element attributes
to HTML element attributes uninspected. It would seem to be, admittedly
far from expert, a better practice is to specifically select and handle the XML attributes,
transforming then into appropriate (perhaps equivalent) HTML attributes. But
for the most part, most such attributes would belong in the xsl-stylesheet or
CSS anyway.

I know that doesn't answer your question if why your code doesn't work. 
But perhaps folks will respond about the wisdom of doing it one way or another.

regards,

--- Bob


> -----Original Message-----
> From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
> Sent: Tuesday, July 16, 2002 9:48 AM
> To: cocoon-users@xml.apache.org
> Subject: cleaning xmlns attribute with XSL transformation
> 
> 
> How can I set up the xsp processor that way that it will not unclude 
> 'xmlns' attributes to HTML output?
> 
> For example. I'm generate XML from my XSP.In XSP page  i define the 
> following namespace: [xmlns:xsp="http://apache.org/xsp"].
> my XSP:
> <content>
>  <test type="test">test</test>
> </content>
> 1)When I tried to execute this logicsheet
> ...
> <xsl:template match="content">
>  <xsl:apply-templates/>
> </xsl:template>
> ...
>   <xsl:template match="@*" priority="-3">
>    <xsl:choose>
>     <xsl:when test="not(contains(name(.),'xmlns'))">
>      <xsl:copy><xsl:value-of select="."/></xsl:copy>
>     </xsl:when>
>    </xsl:choose>
>   </xsl:template>
> 
>   <xsl:template match="node()" priority="-2">
>      <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
>   </xsl:template>
> 
> 
>   <xsl:template match="text()" priority="-1"><xsl:value-of 
> select="."/></xsl:template>
> 
> root tags (<test>) contain [xmlns:xsp="http://apache.org/xsp] attribute 
> (and 'test' attribute also)
> 
> 2)When I tried to execute this logicsheet
> ...
> <xsl:template match="content">
>  <xsl:apply-templates/>
> </xsl:template>
> ...
>   <xsl:template match="@*" priority="-3">
>    <xsl:choose>
> <!-- ******************************************* -->
>     <xsl:when test="not(contains(name(.),'test'))">
> <!-- ******************************************* -->
>      <xsl:copy><xsl:value-of select="."/></xsl:copy>
>     </xsl:when>
>    </xsl:choose>
>   </xsl:template>
> 
>   <xsl:template match="node()" priority="-2">
>      <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
>   </xsl:template>
> 
> 
>   <xsl:template match="text()" priority="-1"><xsl:value-of 
> select="."/></xsl:template>
> 
> Root tags (<test>) contain [xmlns:xsp="http://apache.org/xsp] attribute 
> without test attribute
> Of course I cleaned this attribute, but why xmlns:xsp attribute is not 
> cleaned in first XSL example?
> 
> Or I'm in a wrong way here?
> 
> 
> Thanx.
> Yury.
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message