Howdy y'all,

So I have a site that uses TinyMCE as the content editor, purely because my clients are not tech savvy and transitioning them to Markdown is a big ask.

One of the many downsides to a WYSIWYG editor is the entities that get added to the copy, which we all know do not play nicely with XSLT.

So, I am trying to declare entities within the master.xsl DOCTYPE, but it's not making an iota of difference :( The error points me to line 141 of class.xsltprocess.php, which is the loadXML call. What it's doing is beyond me, so I thought I'd put it to you marvellous Symphony users.

Using Symphony version 2.6.7.

Any thoughts? Is there somewhere within the Symphony core I can add entities to be defined?

Hi Phillip,

I am using WYSIWYG fields like everyday with no such issues, and also without a need to declare any entities whatsoever. Never had to.

I don't know where could be the issue. Maybe encoding somewhere? Well, I am using a different WYSIWYG (CKEditor - but pls don't ask to try out this version of mine, it's a non-universal, feature-trimmed, config-playground version, meant just for textual markup, no images, no filebrowser dialogs, halfway-themed etc... but one day to be released), anyway, I would say there must be an issue outside the WYSIWYG, as I almost never use Markdown, and I'd tried out all kinds of WYSIWYG editors around with no problems I think (it was only for a short time, so I don't remember now - CKE is the best for me).

Thanks for the question, this was actually pretty fun to dig into.

It definitely looks like you're able to do this by declaring the entities as part of your XSL stylesheet! Check out this gist, where copy and world are the entities which I have defined. Your entity can actually be whatever you like... even a shortcut for an XSL condition.

In the second example, you can also create your own entities file to keep things DRY which means you could reference it from a master utility or something and have your entire project be covered.

I discovered this from reading this link and the subsequent part 2.

I'm not sure what caveats there are to this technique, but it's interesting to know it's possible.

Great research @brendo! You're a legend.

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