----- Original Message ----- From: "David Kaufman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 19, 2002 2:32 AM Subject: Re: [htmltmpl] New filter for HTML::Template supports well-formed XML syntax.
> > 1) The HTML::Template tags are represented as qualified names in > > the 'tmpl' namespace. > > > > <TMPL_LOOP foo>...</TMPL_LOOP> > > > > becomes: > > > > <tmpl:loop foo>...</tmpl:loop> > > is that really well-formed? don't attribues *have* to have (quoted) values? > i'd have thought it would have to become: Major brain fart - of course I meant <tmpl:loop name="foo">! Sometimes I forget that just because H::T doesn't require its default attributes, XML sure does. > > 2) I have added a TMPL_ATTR attribute as a synonym for TMPL_VAR > > to allow dynamic attributes to be expressed in valid XML syntax. > > > > <html:img src="<TMPL_VAR foo>" /> > > > > becomes: > > > > <html:img tmpl:attr="src foo" /> > > interesting solution. the src="foo" attribute is valid for html::img -- > have you though about using XML *entities* to represent tmpl_var output? > could: > > <html:img src="<TMPL_VAR foo>" /> > > also be expressed simply as: > > <html:img src="&foo;"> /> > > no? i thought not :-) Another interesting solution! I just realized that my proposed syntax has a serious limitation, as XML does not allow repeated attributes. My current implementation does not take this into account. Back to the drawing board.... > keep in mind that a DTD's are only used to define and test the "xml > validity" of a document against a strict document type; they are by > definition *not* required to test for well-formedness. a DTD defines (and > strictly restricts) what tags can or must appear, in what order, within what > containing tags, and what attributes those tags can or must have. while > this can be great for highly structured and strictly formatted xml documents > like, say an invoice or a database record, i wouldn't knock myself out > trying to impose a DTD document type on every possible HTML::Template out > there --- many are not even used to generate/template HTML! we use it to > generate mail-merged plaintext emails and even Apache conf file! how would > one define deterministically what tags (and only what tags) always are, can > be, should be, must be and/or implicitly are in something as flexible and > "loose" as the output of a generated H::T template? What I was refering to would be an XHTML 1.1 extension that allows DTD savvy tools to recognize the H::T elements. This would simply define the document type for an HTML::Template in XHTML application, extending the content model specified in the XHTML 1.1 DTD. At this point, it's strictly a mental exercise H::T::wfXML is simply a regex based filter that extends the H::T syntax to allow the template developer to produce well-formed documents - It performs no validation. The standard TMPL_x tags are passed through unaltered. > is the code available for download anywhere else yet? > > need help with the docs? > > -dave I managed to get most of the documentation done, but any help would be appreciated. You can find the 0.01 alpha distribution on the Patches page on SourceForge. Kurt Stephens [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
