agentz,<br><br>The TagSet stuff in TD is cool, btw.<br><br><div><span class="gmail_quote">On 8/9/07, <b class="gmail_sendername">Agent Zhang</b> &lt;<a href="mailto:agentzh@gmail.com">agentzh@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 7/14/07, Andrew Sterling Hanenkamp &lt;<a href="mailto:sterling@hanenkamp.com">sterling@hanenkamp.com
</a>&gt; wrote:<br>&gt; Here&#39;s a sample of what I was thinking:<br>&gt;<br>&gt; use Template::Declare::XML;<br>&gt; use Jifty::View::Declare schema {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; namespace cas =&gt; &#39;<a href="http://www.yale.edu/tp/cas">
http://www.yale.edu/tp/cas</a>&#39;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; default_prefix is &#39;cas&#39;;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; tag serviceResponse =&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is not_empty;<br>&gt;<br><br>This is a wonderful way to generate XML schema file or even DTD file
<br>using TD :) Anyone feels like hacking that in? ;)</blockquote><div><br>I want to, but I don&#39;t know when I would be able to commit. Maybe sometime over the next month, but probably not in the next week or two.<br></div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;<br>&gt; template &#39;serviceValidate&#39; =&gt; sub {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; my $result = get &#39;result&#39;;
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; xml_decl { version =&gt; 1.0, encoding =&gt; &#39;UTF-8&#39; };<br>&gt;<br><br>I&#39;ve just committed a patch for the xml_decl sub but the API is now a<br>bit more general.<br><br>For instance,<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;xml_decl { &#39;xml&#39;, version =&gt; &#39;1.0&#39; };<br>&nbsp;&nbsp;&nbsp;&nbsp;xml_decl { &#39;xml-stylesheet&#39;,&nbsp;&nbsp;href =&gt; &quot;chrome://global/skin/&quot;,<br>type =&gt; &quot;text/css&quot; };<br><br>will produce<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;?xml version=&quot;
1.0&quot;?&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt;</blockquote><div><br>Good idea. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;<br>&gt; If there&#39;s a namespace prefix &quot;cas&quot; then it can infer this to be shorthand for:<br>&gt;<br>&gt; tag &#39;cas_serviceResponse&#39; =&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; prefix &#39;cas&#39;,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; local_name &#39;serviceResponse&#39;,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; is not_empty;<br>&gt;<br><br>To be honest, I&#39;m not very happy with this way of specifying XML<br>namespaces since it&#39;s not flexible enough. I&#39;m proposing using Perl<br>packages to emulate this kind of things. For example, html::div { ...
<br>}, but we need to define the html package and import symbols into it<br>ourselves (sort of).</blockquote><div><br>Yeah, I wasn&#39;t precisely pleased with this myself, but it would have been flexible enough for what I was considering at the time. :-P
<br><br>The package idea is interesting, I&#39;d be interested to see an example of how you would declare it and use it.<br><br>Cheers,<br>Andrew<br></div></div><br>