/[suikacvs]/markup/html/whatpm/Whatpm/HTML/Serializer.html
Suika

Contents of /markup/html/whatpm/Whatpm/HTML/Serializer.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Sun Nov 11 04:59:36 2007 UTC (16 years, 11 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/html
++ ChangeLog	11 Nov 2007 04:59:27 -0000
2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* readme.en.html: Link to |Whatpm::HTML::Serializer|.

++ whatpm/Whatpm/ChangeLog	11 Nov 2007 04:59:14 -0000
2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* HTML.pod (get_inner_html): Removed.

	* Makefile (HTML-all, HTML-clean): New.

2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* HTML.pm.src (get_inner_html): Removed (moved to HTML/Serializer.pm).

++ whatpm/Whatpm/HTML/ChangeLog	11 Nov 2007 04:58:48 -0000
2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* Serializer.pod: New file.

	* Makefile: New file.

2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* Serializer.pm: New module (split from ../HTML.pm.src).

2007-11-11  Wakaba  <wakaba@suika.fam.cx>

	* ChangeLog: New file.

1 wakaba 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2     <html xmlns="http://www.w3.org/1999/xhtml">
3     <head>
4     <title>Whatpm::HTML::Serializer - HTML DOM Serializer</title>
5     <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/pod.css" type="text/css" />
6     <link rev="made" href="mailto:admin@suika.fam.cx" />
7     </head>
8    
9     <body>
10    
11     <p><a name="__index__"></a></p>
12     <!-- INDEX BEGIN -->
13    
14     <ul>
15    
16     <li><a href="#name">NAME</a></li>
17     <li><a href="#synopsis">SYNOPSIS</a></li>
18     <li><a href="#description">DESCRIPTION</a></li>
19     <li><a href="#methods">METHODS</a></li>
20     <li><a href="#see_also">SEE ALSO</a></li>
21     <li><a href="#author">AUTHOR</a></li>
22     <li><a href="#license">LICENSE</a></li>
23     </ul>
24     <!-- INDEX END -->
25    
26     <hr />
27     <p>
28     </p>
29     <h1><a name="name">NAME</a></h1>
30     <p>Whatpm::HTML::Serializer - HTML DOM Serializer</p>
31     <p>
32     </p>
33     <hr />
34     <h1><a name="synopsis">SYNOPSIS</a></h1>
35     <pre>
36     require Whatpm::HTML::Serializer;
37    
38     ## Serialize an HTML document
39     my $html = Whatpm::HTML::Serializer-&gt;get_inner_html ($doc);
40     ## NOTE: $html = $doc-&gt;inner_html is preferred.
41    
42     ## Serialize an HTML element
43     my $html = Whatpm::HTML::Serializer-&gt;get_inner_html ($el);
44     ## NOTE: $html = $el-&gt;inner_html is preferred.
45    
46     ## Serialize an HTML document fragment
47     my $html = Whatpm::HTML::Serializer-&gt;get_inner_html ($df);</pre>
48     <p>
49     </p>
50     <hr />
51     <h1><a name="description">DESCRIPTION</a></h1>
52     <p>The <code>Whatpm::HTML::Serializer</code> module provides a function that
53     implements the fragment serialization algorithm of HTML5. It can
54     be used to serialize a HTML <code>Document</code> or <code>Element</code> node into
55     an HTML document or fragment.</p>
56     <p>Note that the algorithm cannot be used to serialize an arbitrary
57     DOM tree; an attempt to serialize a DOM that cannot be represented
58     in a static HTML document (fragment) will result in an invalid
59     document or in a document representing different DOM tree.</p>
60     <p>For example, the DOM tree:</p>
61     <pre>
62     +- Element |p|
63     +- Element |ul|</pre>
64     <p>... cannot be represented in HTML serialization. The serialization
65     algorithm will generate an invalid HTML fragment:</p>
66     <pre>
67     &lt;p&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/p&gt;</pre>
68     <p>... which represents another DOM tree:</p>
69     <pre>
70     +- Element |p|
71     +- Element |ul|
72     (with &quot;invalid &lt;/p&gt;&quot; error)</pre>
73     <p>... without raising any error or warning. This is a limitation of
74     the HTML serialization format and the fragment serialization algorithm.</p>
75     <p><strong>NOTE</strong>: Usually you don't have to call this module directly,
76     since <a href="../../Message/DOM/Document.html">the Message::DOM::Document manpage</a> and <a href="../../Message/DOM/Element.html">the Message::DOM::Element manpage</a>
77     modules implement the <code>inner_html</code> attribute for
78     DOM <code>Document</code> and <code>Element</code> nodes.</p>
79     <p>
80     </p>
81     <hr />
82     <h1><a name="methods">METHODS</a></h1>
83     <dl>
84     <dt><strong><a name="item_get_inner_html"><em>$html</em> = Whatpm::HTML::Serializer-&gt;get_inner_html (<em>$node</em>, [<em>$onerror</em>])</a></strong><br />
85     </dt>
86     <dd>
87     Serialize a node by the HTML fragment serialization algorithm.
88     </dd>
89     <dl>
90     <dt><strong><a name="item__24node"><em>$node</em></a></strong><br />
91     </dt>
92     <dd>
93     The node to serialize. The node must be a DOM <code>Document</code>,
94     <code>DocumentFragment</code>, or <code>Element</code> node.
95     </dd>
96     <p></p>
97     <dt><strong><a name="item__24onerror"><em>$onerror</em></a></strong><br />
98     </dt>
99     <dd>
100     A reference to <code>CODE</code>, which will be invoked when an error occurs.
101     If the algorithm is required to raise an <code>INVALID_STATE_ERR</code> error,
102     i.e. if the algorithm is faced to a <code>Node</code> whose type is different
103     from any of ones supported by the algorithm, the <code>CODE</code> is
104     invoked with that <code>Node</code> as an argument. It is expected for the
105     <code>CODE</code> to raise an exception. If no exception is raised,
106     the <code>Node</code> is ignored for the purpose of the algorithm.
107     </dd>
108     <dd>
109     <p>If <em>$onerror</em> is omitted, an empty <code>CODE</code> (which does nothing)
110     is assumed.</p>
111     </dd>
112     <p></p>
113     <dt><strong><a name="item__24html"><em>$html</em></a></strong><br />
114     </dt>
115     <dd>
116     A <code>SCALAR</code> reference to the result of the HTML fragment serialization
117     algorithm.
118     </dd>
119     <p></p></dl>
120     </dl>
121     <p>
122     </p>
123     <hr />
124     <h1><a name="see_also">SEE ALSO</a></h1>
125     <p>Whatpm &lt;http://suika.fam.cx/www/markup/html/whatpm/readme&gt;.</p>
126     <p>HTML5 &lt;http://whatwg.org/html5&gt;.</p>
127     <p>manakai's <a href="../../Message/DOM/Document.html">the Message::DOM::Document manpage</a> and <a href="../../Message/DOM/Element.html">the Message::DOM::Element manpage</a>
128     modules are implementing the <code>inner_html</code> attribute.</p>
129     <p>
130     </p>
131     <hr />
132     <h1><a name="author">AUTHOR</a></h1>
133     <p>Wakaba &lt;<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>&gt;.</p>
134     <p>
135     </p>
136     <hr />
137     <h1><a name="license">LICENSE</a></h1>
138     <p>Copyright 2007 Wakaba &lt;<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>&gt;</p>
139     <p>This library is free software; you can redistribute it
140     and/or modify it under the same terms as Perl itself.</p>
141    
142     </body>
143    
144     </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24