Hey, James.

>> I'm working on a templating system right now that works as an abstract
>> class.  It will scan a well-formed (in the XML sense) HTML document,
>> and grab subtrees where the root of the subtree has a code attribute -
>> this attribute isn't in any of the published standards, so I feel
>> pretty safe using it for now.
>
> Um, pretty sure XHTML strict, for example, won't allow arbitrary 
> attributes.
> For example, using the 'border' attribute on an img element will break 
> validation.

no argument here.

>
> Any elements or attributes not defined in the corresponding DTD or 
> scheme would need to be removed before the results are sent to a
> browser.

that's part of my design, yes.

>
> This is one reason PIs (processing instructions; <?name target ?>) 
> work well, or else non-HTML/XML markup (e.g. <% %>) that gets
> removed before any HTML/XML tools see the text.
>
Not to put too fine a point on it, but most of the currently available 
templating systems that use such tags are embedding 'code' into the 
HTML - such as loops, branching conditions, etc.

While I recognize that there's a time and place to mix business logic 
into HTML, there are also many cases where you'll want web developers 
to just mark up a page, turn it over to a developer, who just 'hints' 
it with these attributes, and keeps the business logic in the script.  
If a web page developer then has to tweak the page, s/he won't have to 
slough through lines of 'code' to find their markup for tweaking.

Besides, PI's and non HTML/XML markup aren't really designed to 
encapsulate subtrees within a document, and what I was trying to 
accomplish was to 'hint' a subtree for processing by the script.

-rh