1 users online. Create an account or sign in to join them.Users

Search

Hi,

Why would this give me an error? Please excuse any ignorance here - been wasting the last 9 months of my life working with Modx and Interspire - so looking to brush up on my Symphony skills.

 <?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"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
indent="yes" />

 <xsl:import href="../utilities/master.xsl" />

<xsl:template match="/">

 hello world

 </xsl:template>
 </xsl:stylesheet>

You’ve misplaced your <xsl:import /> or <xsl:include /> elements as they must go before <xsl:output />.

Yeah, but I can’t see why?

When I create a new page in Symphony, that is basically the code I have, but I generally change it to this:

 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 <xsl:import href="../utilities/master.xsl"/>

 <xsl:template match="data">

 hello world

 </xsl:template>
 </xsl:stylesheet>

And it works - but I would rather not have to do that.

You can edit the default page XSLT in /symphony/template/page.xsl.

ok, but this is off the shelf right? So what do I need to do to make it work? You say the import element needs to go outside of the - but it is isn’t it?

Sorry, I don’t think I understand what your problem is… Is it your import element or the default XSLT code?

Well what is wrong with my initial code? And what would I need to do to make it work?

I tried your initial code and it worked after I moved the xsl:import statement above the xsl:output statement.

ah I see, so it goes before the output element? I need to read up on this output element are refresh my mind.

I’ve missed xslt - and i’ve quickly forgotten stuff.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details