I’m using two datasources on my site. The idea is that when certain URL parameters are set one datasource is used otherwise it uses a different datasource.

The datasource that tests for a min/max is using this code:

mysql: value >= {$url-min} AND value <= {$url-max}

When these values aren’t set the page returns this error:

XSLT Processing Error This page could not be rendered due to the following XSLT processing errors. XML Line 296 loadXML(): StartTag: invalid element name in Entity, line: 296 Line 308 loadXML(): StartTag: invalid element name in Entity, line: 308

When I debug the page and look in the XML I get the following error:

MySQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND  `t84`.`value`  <= 
ORDER BY `e`.`id` DESC
LIMIT 0, 10' at line 11 in query "SELECT  `e`.id, 
        `e`.section_id, e.`author_id`, 
        UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, 
        UNIX_TIMESTAMP(e.`creation_date_gmt`) AS `creation_date_gmt`

FROM `sym_entries` AS `e`
 LEFT JOIN `sym_entries_data_84` AS `t84` ON (`e`.`id` = `t84`.entry_id)        

AND `e`.`section_id` = '13' 
 AND   `t84`.`value`  >=  AND  `t84`.`value`  <= 
ORDER BY `e`.`id` DESC
LIMIT 0, 10"

I played around with my XSLT and there seems to be nothing I can do to make it work so it must be a datasource error. How can I make it behave, short of removing that filter, which I have to have?

I should note that in my XSLT I did try writing this:

<xsl:param name="url-min" select="0"/>
<xsl:param name="url-max" select="0"/>

But it didn’t help.

More info:

In the log I get the following information:

Log Created: 2010-05-05T15:33:39-04:00
Symphony Log
Version: 2.0.7
2010/05/05 15:33:40 > WARNING: 2 - array_intersect() [<a href='function.array-intersect'>function.array-intersect</a>]: Argument #2 is not an array in file /Users/doug/Projects/Goodbuy Timeshare/201005 Site Maintenance/Web Files/Alpha Site/symphony/lib/toolkit/class.frontendpage.php on line 427

Corresponding function in class.frontpage.php is:

foreach($dependenciesList as $handle => $dependencies){

    $dependenciesList[$handle] = @array_intersect($dsKeyArray, $dependencies);

        $orderedList[] = str_replace('_', '-', $handle);

This is a problem with your DS since the XML returns an SQL error.

As you mentioned, the error occurs when the parameters have no value so the first thing I would consider doing is to make sure there’s always a value.

Have you tried using enumeration to set a default?

mysql: value >= {$url-min:10} AND value <= {$url-max:100}

Outstanding! I was wondering what the solution was for that. This will also allow me to simplify things a bit. If it automatically has a default it means I don’t need to switch between two datasources.

Allan, you rock.

…I just realized, I can possibly simplify things quite a bit more than that as well!

@Allen beat me to it… lol

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