Kid is based on XML, so if you didn’t get an error when you put an unescaped “<” into an attribute, something would be horribly wrong.

It’s a bad idea to do anything that violates XML syntax (like accepting < in attributes), because then you lose the ability to edit and process Kid macros with any of the zillions of standard XML tools out there.

And that was the whole point of using XML in the first place.

There’s only one thing worse than processing XML, and that’s processing something that looks almost like XML but isn’t.

That would be like throwing out the baby (interoperability) but keeping the bathwater (clumsy syntax).

 

            -Don

 

On 12/10/05, Dan R <[EMAIL PROTECTED]> wrote:
> Now if I try and do a
>
> <div py:if="ulevel <= 0">       Whatever        </div>
>
> I get an ExpatError. The == < and > comparisons are ok. What's going on?

I would expect < to fail also... The template needs to be valid XML,
so it would seem like you need to do &lt; in place of <.

Kevin


Yep. With XML the > is a legal character in an attribute value, while < is not[0]. It would be nice to have Kid encode things before they get passed to the parser. So we could get something like this to work:

    <div py:if="${ulevel <= 0}">

But I am not sure how good of an idea this would be. I'll bring it up on the Kid mailing list after I think about it for a bit.

[0] http://www.w3.org/TR/2004/REC-xml-20040204/#NT-AttValue

-- David

Reply via email to