chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Cryptic SSAX error message


From: Matt Gushee
Subject: Re: [Chicken-users] Cryptic SSAX error message
Date: Wed, 18 Mar 2015 20:56:06 -0600

Hi, Peter--

On Tue, Mar 17, 2015 at 2:13 AM, Peter Bex <address@hidden> wrote:
On Mon, Mar 16, 2015 at 09:27:36PM -0600, Matt Gushee wrote:
> I was building a new blog with Coq au vin, which uses Civet to process
> templates, which in turn uses SSAX ... and one of my XHTML templates caused
> [an] error.

[error elided]

> Now that's a helpful error message. It turns out the problem was the inline
> _javascript_ in my template (which contained the <= operator). Since I was
> using the XHTML Transitional doctype, that's allowed per W3C specs, and it
> simply hadn't occurred to me that it was likely to result in
> non-well-formed XML.

You shouldn't parse HTML with an XML parser.

Not in general, no. But wouldn't you agree that, regardless of what is wrong with the input file and why it is wrong, it would be good if SSAX output something that would actually be useful in troubleshooting? That was my main point. And of course, as I mentioned, I'm well aware that desirable != doable, but I didn't (and don't) know if this is a known issue, so I thought I should say something.
 
Since you're using CHICKEN,
you could try the html-parser CHICKEN egg, which is more permissive.

But that's not the goal. Perhaps you recall this discussion from 2 years ago?

>> [Matt]
>> Finally, an idea has occurred to me. What about a templating system where
>> what actually gets used at runtime is SXML, but designers could create
>> templates in XHTML, then when they are satisfied with the design, use a
>> preprocessing tool to convert them to SXML? That would at least ensure
>> well-formed markup.

> [Peter]
> Yep, that would be good.  Representation and surface syntax don't
> neccessarily need to be equivalent, though the Lisper in me disagrees
> about that being a good idea :)
REF: http://lists.nongnu.org/archive/html/chicken-users/2013-03/msg00058.html

So Civet is the templating system I created pursuant to that conversation. The templates are supposed to be well-formed XML (in practice, mainly XHTML), and presumably created by a developer who knows what they're doing - though the current issue may call that into question ;-).

I certainly don't believe my approach is ideal from a purely technical standpoint. But given that the meta-goal of my projects is to "use Scheme to create web development tools that might be used by people who don't know Scheme" (as opposed to "use Scheme to develop websites"), I think it's about as good a compromise as can be expected. If I were creating Civet today, I think I would look for a different approach - but mainly because it is now clear (maybe it was in 2013 and I just didn't know it) that HTML5 (in non-XML syntax) is becoming dominant, and the never-popular XHTML is dying, if not dead. But I still stand by the fundamental reasoning that led to Civet as it is (and BTW, it works pretty well within its limitations - you should try it ;-)
I *think* XHTML Strict is a proper XML application, but I'm not 100% sure,

I'm not 100% sure either, but if the W3C says it's XML, they most likely mean it is completely well-formed. One thing I know is that it prohibits inline CSS and _javascript_ - and now I understand why.
 
--
Matt Gushee

reply via email to

[Prev in Thread] Current Thread [Next in Thread]