Permalink
Browse files

note common mistakes

  • Loading branch information...
1 parent 1df9c5c commit 6caef1831e67978eca40ae257db55ee049414506 @tomill committed Feb 9, 2010
Showing with 40 additions and 0 deletions.
  1. +40 −0 lib/Template/Semantic.pm
View
40 lib/Template/Semantic.pm
@@ -430,6 +430,46 @@ Accessor to defined filter.
=back
+=head1 COMMON MISTAKES
+
+The template should be XHTML/XML. Small errors might be no problem if using
+XML::LibXML's C<recover> option (This moudle sets C<recover(2)> by default).
+But plese take care these common mistakes.
+
+=over 4
+
+=item * Ampersand mark shouhd be C<&amp;>
+
+NG.
+
+ <a href="/?foo=&bar=">&</a>
+
+OK.
+
+ <a href="/?foo=&bar=">&amp</a>
+
+Note: values doesn't need escape.
+
+ $ts->process($template, {
+ 'a' => 'foo & bar',
+ 'a@href' => '?foo=1&bar=2',
+ })
+
+=item * Template should have signle route element
+
+NG. libxml uses first part only.
+
+ <div>foo</div>
+ <div>bar</div>
+
+NG. libxml thinks this is the blank text.
+
+ foo
+ <div>bar</div>
+
+=back
+
+
=head1 SEE ALSO
L<Template::Semantic::Document>, L<Template::Semantic::Cookbook>

0 comments on commit 6caef18

Please sign in to comment.