1. "push" vs. "pull"

Hmm, I don't know whether I would validate the XML input for HTML output. 
You would have to validate so many elements and attributes - I think it's to 
extreme. But there have been many discussions about push or pull approach 
(output data-driven or xsl-driven).

XSL FAQ: http://www.dpawson.co.uk/xsl/sect2/pushpull.html
XSL mailing list archive: 
http://sources.redhat.com/cgi-bin/htsearch?method=and&format=builtin-long&sort=time&config=htdig&restrict=%2Fml%2Fxsl-list%2F&exclude=&words=push+pull

2. namespace "attributes"

The problem is, that xmlns:xxx (namespace declaration) are no attributes. 
You can normally remove them by specifying an 
"exclude-result-prefixes='xxx'" on the <xsl:stylesheet> element. The problem 
in your code is, that you are copying the nodes ... and so the namespace 
declarations too. You have to replace <xsl:copy> by <xsl:element 
name="{name()}">.

Regards,

Joerg



Robert Bourdeau wrote:
> 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:[EMAIL PROTECTED]]
>>Sent: Tuesday, July 16, 2002 9:48 AM
>>To: [EMAIL PROTECTED]
>>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.


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
[EMAIL PROTECTED]
www.virbus.de


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to