Search

I'm using a namespace as an xpath selector for doing some final formatting. Does anyone know if there is a way to apply a namespace to normal datasource outputs?

Basically, I have templates that use 'xhtml:*' as the match, but it only works with the markup in my templates (since it is namespaced), not the actual data coming from /data. Also, I'd rather not use a mode on the datasource matches, because some of the DS content will be in other namespaces, and meant for other templates.

Any thoughts? My plan B is to tweak tinyMCE to add prefixes or declare the default ns in a wrapper element, or something...

Ok I figured this out. My default namespace was xhtml (http://www.w3.org/2002/06/xhtml2), so instead of using the actual prefix, I matched by uri:

 <xsl:template match="*[namespace-uri() = 'http://www.w3.org/2002/06/xhtml2']" >

Which is better anyway, since the prefixes themselves are arbitrary.

EDIT:

Actually, elements coming out of symphony data have a blank default ns, so this is the way I'm doing it:

 <xsl:template match="*[namespace-uri() = 'http://www.w3.org/2002/06/xhtml2' or namespace-uri() = '' ]">

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details