> From: Reinhard Poetz [mailto:[EMAIL PROTECTED]]
> Thank you for this solution. > > - 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". > - 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. Cheers, Manos > > Regards, > Reinhard > > > -----Original Message----- > > From: Manos Batsis [mailto:[EMAIL PROTECTED]] > > Sent: Monday, July 01, 2002 12:45 PM > > To: [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: RE: How to remove namespace declarations and prefixes? > > > > > > Piece of cake. A stylesheet which does exactly that would is > > > > <?xml version="1.0" encoding="UTF-8"?> > > <xsl:stylesheet version="1.0" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > <xsl:output method="xml" version="1.0" encoding="UTF-8" > indent="yes"/> > > <xsl:template match="*"> > > <!-- remove element prefix (if any) --> > > <xsl:element name="{local-name()}"> > > <!-- process attributes --> > > <xsl:for-each select="@*"> > > <!-- remove attribute prefix (if any) --> > > <xsl:attribute name="{local-name()}"> > > <xsl:value-of select="."/> > > </xsl:attribute> > > </xsl:for-each> > > <xsl:apply-templates/> > > </xsl:element> > > </xsl:template> > > </xsl:stylesheet> > > > > However, adding another step in your pipeline may not be the best > > solution. You might want to modify your existing last stylesheet to > > remove prefixes using the local-name() function as above. > > > > Hope this helps, > > > > Manos > > --------------------------------------------------------------------- > 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]> > > --------------------------------------------------------------------- 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]>