Search

I’m getting the following error message when rendering a page processing a Dynamic DS with data from Tumblr API:

**This page contains the following errors:**
error on line 49 at column 3394: xmlParseEntityRef: no name
**Below is a rendering of the page up to the first error.**

My DS is fetching 10 posts at a time from Tumblr with a start post number of $tumblr-post-start. This parameter is calculated from the URL-param $blog-page-num with the Global Parameters extension.

Currently, five of seven pages (http://example.com/page/{$blog-page-num}) is working correctly. On the other two pages all data gets processed up to a title contaning &:

<regular-title>Word &amp; another word</regular-title>

The strange thing is that if I’m fetching all posts at once (insted of 10 at a time) no error occurs on these two titles, they get processed just fine. Any ideas?

It seems that my Global parameter is messing something up, I guess I shouldn’t use those since I’m not a PHP guy, so is there something wrong with this:

return (intval($context['params']['blog-page-num']) > 1) ? strval((intval($context['params']['blog-page-num'])-1)*10) : "0";

Can you pastie your XML, XSL, and DS?

Sure thing!

The XML (I’ve removed everything but Tumblr DS data).

It’s quite a lot of XSL so I haven’t pastied it, but if someone want’s access to the site that could be arranged.

The DS fetches the XML from Tumblr’s API with the following URI: http://demo.tumblr.com/api/read/?start={$tumblr-post-start}&num=10

The $tumblr-start-post is calculated with the Global Param extension:

return (intval($context['params']['blog-page-num']) > 1) ? strval((intval($context['params']['blog-page-num'])-1)*10) : "0";

The param $blog-page-num is a URL parameter; http://example.com/sida/{$blog-page-num}. So if http://example.com/sida/3 is visited ($blog-page-num = 3) then $tumblr-start-post is calculated to 20 and the DS fetches post number 20 to 29. This works as intended and is confirmed by the ?debug=params page.

But when fetching posts 20-29 ($blog-page-num = 3, which is included in example XML), I get the error message shown in the previous post. So it crashes on the post/@id='118883010', it prints everything up to this post and it seems that the &amp; in the regular-title messes something up.

The same data processed on my front page $root gets outputted correctly, only when I process the data on the page $root/sida something goes wrong. The two pages, hem.xsl and sida.xsl are identical and imports exactly the same stuff.

It can’t be that the Global Parameter extension is messing things upp either (as I previously thought) because it’s not working even if I disable the $tumblr-post-start parameter.

I also have this error message outputted into the log files over and over again:

WARNING: 2 - Invalid argument supplied for foreach() in file /home/user/domains/example.com/public_html/symphony/lib/toolkit/data-sources/datasource.dynamic_xml.php on line 23

Any suggestions are appriciated!

The error points to the dynamic data source is failing at a specific place. This doesn’t sound like a problem with your XSLT.

To isolate the problem, try loading the entire XML and process the XSLT over it. If that works, try loading the dynamic XML’s URL manually (over entries 20-29) and make sure that works also.

I’ve loaded the XML locally and tested it and it’s not invalid, working over the XML on XSLT is also fine.

If you like, drop me a line and I can take a look allen at this website dot com

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