cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinhard Poetz" <reinhard_po...@gmx.net>
Subject RE: How to remove namespace declarations and prefixes?
Date Mon, 01 Jul 2002 12:06:02 GMT
> -----Original Message-----
> From: Manos Batsis [mailto:m.batsis@bsnet.gr]
> Sent: Monday, July 01, 2002 1:21 PM
> To: cocoon-users@xml.apache.org
> Cc: reinhard_poetz@gmx.net
> Subject: RE: How to remove namespace declarations and prefixes?


> > - Do you know if this influences the performance?
>
> Reinhard, *anything* influences performance. The professor at the course
> I follow, presented this issue very simply as "In software design, you
> always give some to take some".


That's absoluty clear - may I have to pose the question more correctly:
Is there a difference in performance - your solution compared to a working
"exclude-result-prefixes"-attribute?


> > - Is there a special reason why "exclude-result-prefixes"
> >   doesn't work or is it a bug?
>
> Are you using it correctly?
> For example, if you know your XSLT will *only* process either XSD or
> XHTML documents, you can do the same with
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:xht="http://www.w3.org/1999/xhtml"
>    exclude-result-prefixes="xs xht">
>   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> <xsl:template match="*|@*">
>   <xsl:copy>
>     <xsl:apply-templates/>
>   </xsl:copy>
> </xsl:template>
> </xsl:stylesheet>
>
> Note that you have to declare ALL the namespaces you wish to filter out
> by associate them with a namespace prefix(duh); then put a space
> separated list of ALL prefixes as the value of the
> exclude-result-prefixes attribute.
> The only case this doesn't work is when you don't know the namespaces
> you may encounter.

Did you try it with Cocoon? If yes, which version do you use?

My stylesheet:

<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:f="http://www.poetz.cc/forms"
   xmlns:l="http://www.poetz.cc/linking"
   xmlns:cinclude="http://apache.org/cocoon/include/1.0"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:rss="http://purl.org/rss/1.0/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	exclude-result-prefixes="f">

...

Regards,
Reinhard


---------------------------------------------------------------------
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