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> <<a href="mailto:agentzh@gmail.com">agentzh@gmail.com</a>> 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 <<a href="mailto:sterling@hanenkamp.com">sterling@hanenkamp.com
</a>> wrote:<br>> Here's a sample of what I was thinking:<br>><br>> use Template::Declare::XML;<br>> use Jifty::View::Declare schema {<br>> namespace cas => '<a href="http://www.yale.edu/tp/cas">
http://www.yale.edu/tp/cas</a>';<br>> default_prefix is 'cas';<br>><br>> tag serviceResponse =><br>> is not_empty;<br>><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'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;">><br>> template 'serviceValidate' => sub {<br>> my $result = get 'result';
<br>><br>> xml_decl { version => 1.0, encoding => 'UTF-8' };<br>><br><br>I'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>
xml_decl { 'xml', version => '1.0' };<br> xml_decl { 'xml-stylesheet', href => "chrome://global/skin/",<br>type => "text/css" };<br><br>will produce<br><br> <?xml version="
1.0"?><br> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?></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;">
><br>> If there's a namespace prefix "cas" then it can infer this to be shorthand for:<br>><br>> tag 'cas_serviceResponse' =><br>> prefix 'cas',<br>> local_name 'serviceResponse',
<br>> is not_empty;<br>><br><br>To be honest, I'm not very happy with this way of specifying XML<br>namespaces since it's not flexible enough. I'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'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'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>