Search

I was wondering if somebody could explain to me (in relatively plain English) what exactly does adding 'data' to a do? I understand that you use a template match to Render and/or manipulate xml, but I thought that you had match it to the document root or an element.

Chris

I'm not very experienced myself but as I understand it this matches the stuff that's inside root. Which would be the actual data you're trying to get at.

If you add ?debug to the end of a URL of a symphony page you can see the XML in a tree format with data surrounding all your other items that you've included. It'll probably help you visualise its place in the hierarchy.

You'll find that unless you're already inside a deeper node you need to put data at the start of your xpath when you're addressing a node in your template.

<xsl:template match="data"> 

Matches the data node from the Symphony XML output. As @munki said, append ?debug to your URL to see the entire XML tree.

Thanks. I didn't notice the data tag before in the xml. I'm probably wrong here, but when you put 'data' in the match, can it be used to allow you to apply a template which you have written and is processed in one spreadsheet (say, the home.xsl of a page) into the html code that you have written in another spreadsheet (say, a master).

Apologies if what I've written doesn't make any sense.

Apologies if what I've written doesn't make any sense.

No, from what I've understood it makes perfect sense and that's exactly how it works.

<xsl:apply-templates select="data" />

may be in one file and

<xsl:template match="data">...</xsl:template>

in an entirely different one.

Thanks phoque for clearing this up for me.

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