Search

Hello, I have a draft page where I have a xsl:template matching part of the xml. It prints to screen the nodes and so on. Yet in the default template which comes with symphony there is the homepage importing utilities with templates in them. They are not printed unless I use apply-templates. Are they mutually exclusive? And how? And how much? Sorry it's still a bit complicated for me. I thought 'template' was just a template definition, and apply-templates was the real generator, but seems like it's not.

Thanks!

I thought 'template' was just a template definition, and apply-templates was the real generator, but seems like it's not.

Well, this is pretty correct. The apply-template is where you tell your template to get crackin'.

The reason your nodes are printed to the screen is because you are telling xslt to apply templates to a node that does not have a template defined for it. This is mostly the case if your match is less specific than your template.

I hope this makes sense, if it doesn't: please post your XSLT, then it's easier to see.

I feel so dumb :)

This is the draft code I'm working on. This is the master page that's usually imported in the default theme.

The second page contains xsl:tempate logic (via import), but it's not printed.

So I infer, should one of the two (xml or xsl:template) be missing in future page redesign (for example removing xsl:apply-templates, or changing its select attribute) all the structure would go berserk, is it correct?

This is another example. <xsl:template match="cd">, albeit in the root of the xslt document, is ignored. Probably because 'cd' is not a root in the xml document?

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