Hello, all--

OK, first of all, I have not forgotten that the SXML tools are full of
black magic, etc. - no need to rehash that discussion. And so if it is not
deemed feasible to fix the misbehavior I'm seeing, so be it. But I couldn't
let this pass without saying something.

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
the following error:

csi> (load-template "base.html")

Warning: DOCTYPE DECL html
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd found and skipped
Error: XMLNS [4] for '
#\=
"'"

    Call history:

    civet-impl.scm:84: *template-path*
    civet-impl.scm:439: make-pathname
    civet-impl.scm:440: pathname-replace-extension
    civet-impl.scm:441: template-cache-path
    civet-impl.scm:88: *template-cache-path*
    civet-impl.scm:89: template-path
    civet-impl.scm:84: *template-path*
    civet-impl.scm:89: make-pathname
    civet-impl.scm:441: make-pathname
    civet-impl.scm:442: update-cached-template?
    civet-impl.scm:428: file-exists?
    civet-impl.scm:429: file-exists?
    civet-impl.scm:430: file-modification-time
    civet-impl.scm:431: file-modification-time
    civet-impl.scm:444: open-input-file
    civet-impl.scm:447: ssax:xml->sxml          <--

This is obviously not very informative - but more than that, I found it
misleading, because it refers to 'XMLNS [4]' - so I thought at first there
was an error related to a namespace. That was not the case, as you'll see.

Fortunately, I kept a cool head and decided to check the file with xmlwf.
Here's what that told me:

  $ xmlwf base.html
  base.html:16:17: not well-formed (invalid token)

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.

I think someone who doesn't have extensive experience with XML and/or is
trying to parse a file they did not create themselves might have no idea
what to do with that SSAX error.

--
Matt Gushee
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to