[ZPT] Processing instructions in HTML with ZPT

Brad Clements bkc@murkworks.com
Mon, 29 Oct 2001 17:25:47 -0500


On 29 Oct 2001 at 22:47, Dieter Maurer wrote:

>   Your "tal:attributes" is parsed as part of the
>   processing instruction's value and (of course) not
>   evaluated...
>  > ...
> 
>  > What's the work around for this?
> Do not want to use processing instructions with attributes...
> No HTML/SGML/XML aware applications will recognize them...
> 

Sorry Dieter, you are wrong about this:

http://msdn.microsoft.com/workshop/author/behaviors/overview/elementb_ovw.asp?frame=true#Creating_Custom_Element

Scroll down to "Importing a custom element".

Don't yell at me about how MS has cobbed this together, the fact remains that this code 
must be used to achieve the desired effect.

---------- (hope this doesn't go as html) ------

Importing a Custom Element
The primary document requires a few simple additions to import the custom 
element. The HTML document first declares a namespace, which is used to 
ensure that the custom element has a unique qualifier. The following HTML 
element declares a namespace called games using the XMLNS attribute. Setting 
this attribute allows a custom element with the prefix "games" to be used in the 
primary document.
<HTML XMLNS:games>
The next step is to import the custom element into the namespace. In the 
following example, the games namespace imports the implementation of the 
checkers element in the Checkers.htc file.
<?IMPORT namespace="games" implementation="checkers.htc" >
The IMPORT directive is really the key to implementing an element behavior in 
the primary document. When the browser begins processing the IMPORT 
directive, it waits until the contents of the HTC file have downloaded 
completely before continuing. The way this instruction is processed is the 
reason why the behavior is bound synchronously to the custom element.


Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements