Skip to content

Commit

Permalink
modified the existing APIs to handle XHTML1 serialization rules
Browse files Browse the repository at this point in the history
* tree.c include/libxml/tree.h: modified the existing APIs
  to handle XHTML1 serialization rules automatically, also add
  xmlIsXHTML() to libxml2 API. Some tweaking to make sure
  libxslt serialization uses it when needed without changing
  the library API.
* test/xhtml1 result/noent/xhtml1 result/valid/xhtml1.xhtml
  result/xhtml1: added a new test specifically for xhtml1 output
  and updated the result of one XHTML1 test
Daniel
  • Loading branch information
Daniel Veillard committed Nov 21, 2002
1 parent c14401e commit d5c2f92
Show file tree
Hide file tree
Showing 7 changed files with 681 additions and 52 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Thu Nov 21 15:05:45 CET 2002 Daniel Veillard <daniel@veillard.com>

* tree.c include/libxml/tree.h: modified the existing APIs
to handle XHTML1 serialization rules automatically, also add
xmlIsXHTML() to libxml2 API. Some tweaking to make sure
libxslt serialization uses it when needed without changing
the library API.
* test/xhtml1 result/noent/xhtml1 result/valid/xhtml1.xhtml
result/xhtml1: added a new test specifically for xhtml1 output
and updated the result of one XHTML1 test

Wed Nov 20 14:24:56 CET 2002 Daniel Veillard <daniel@veillard.com>

* xinclude.c parserInternals.c encoding.c: fixed #99082
Expand Down
6 changes: 6 additions & 0 deletions include/libxml/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,12 @@ int xmlSaveFileEnc (const char *filename,
xmlDocPtr cur,
const char *encoding);

/*
* XHTML
*/
int xmlIsXHTML (const xmlChar *systemID,
const xmlChar *publicID);

/*
* Compression.
*/
Expand Down
30 changes: 30 additions & 0 deletions result/noent/xhtml1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- 3.1.1 3/ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Virtual Library</title>
</head>
<!-- 4.8 -->
<script type="text/javascript"><![CDATA[
... unescaped script content ...
]]></script>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
<!-- C2 -->
<img src="foo.gif" alt="foo" />
<!-- C3 -->
<p></p>
<!-- C7 -->
<p lang="fr" xml:lang="fr">coucou</p>
<p xml:lang="fr" lang="fr">salut</p>
<!-- C8 -->
<p name="fragid" id="fragid">test</p>
<!-- 4.5 -->
<dl compact="compact">
<dt>Internet Engineering Task Force</dt>
<dd>An organization which establishes technical standards for the Internet</dd>
</dl>

</html>
88 changes: 44 additions & 44 deletions result/valid/xhtml1.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "dtds/xhtml1-strict.dtd">
<?xml-stylesheet href="W3C-PR.css" type="text/css"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>XHTML 1.0: The Extensible HyperText Markup
Language</title>
<link rel="stylesheet" href="W3C-PR.css" type="text/css"/>
<style type="text/css">
<link rel="stylesheet" href="W3C-PR.css" type="text/css" />
<style type="text/css"><![CDATA[
span.term { font-style: italic; color: rgb(0, 0, 192) }
code {
color: green;
Expand Down Expand Up @@ -49,14 +49,14 @@ div.contents {
}
.tocline { list-style: none; }
table.exceptions { background-color: rgb(255,255,153); }
</style>
]]></style>
</head>
<body>
<div class="navbar">
<a href="#toc">table of contents</a>
<hr/>
<hr />
</div>
<div class="head"><p><a href="http://www.w3.org/"><img class="head" src="w3c_home.gif" alt="W3C"/></a></p>
<div class="head"><p><a href="http://www.w3.org/"><img class="head" src="w3c_home.gif" alt="W3C" /></a></p>

<h1 class="head"><a name="title" id="title">XHTML</a><sup>&#x2122;</sup> 1.0:
The Extensible HyperText Markup Language</h1>
Expand All @@ -69,7 +69,7 @@ The Extensible HyperText Markup Language</h1>
<dt>This version:</dt>

<dd><a href="http://www.w3.org/TR/1999/PR-xhtml1-19991210">
http://www.w3.org/TR/1999/PR-xhtml1-19991210</a> <br/>
http://www.w3.org/TR/1999/PR-xhtml1-19991210</a> <br />
(<a href="xhtml1.ps">Postscript version</a>,
<a href="xhtml1.pdf">PDF version</a>,
<a href="xhtml1.zip">ZIP archive</a>, or
Expand Down Expand Up @@ -100,7 +100,7 @@ liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Tradem
trademark</a>, <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-software">software
licensing</a> rules apply.</p>
<hr/>
<hr />
</div>

<h2 class="notoc">Abstract</h2>
Expand Down Expand Up @@ -1047,7 +1047,7 @@ standard HTML elements plus a group of elements geared to the
specialist's needs.</p>

<!--OddPage-->
<h1><a name="appendices" id="appendices"/>
<h1><a name="appendices" id="appendices"></a>
<a name="dtds" id="dtds">Appendix A. DTDs</a></h1>

<p><b>This appendix is normative.</b></p>
Expand Down Expand Up @@ -1328,29 +1328,29 @@ Acknowledgements</a></h1>
members of the W3C HTML working group:</p>

<dl>
<dd>Steven Pemberton, CWI (HTML Working Group Chair)<br/>
Murray Altheim, Sun Microsystems<br/>
Daniel Austin, CNET: The Computer Network<br/>
Frank Boumphrey, HTML Writers Guild<br/>
John Burger, Mitre<br/>
Andrew W. Donoho, IBM<br/>
Sam Dooley, IBM<br/>
Klaus Hofrichter, GMD<br/>
Philipp Hoschka, W3C<br/>
Masayasu Ishikawa, W3C<br/>
Warner ten Kate, Philips Electronics<br/>
Peter King, Phone.com<br/>
Paula Klante, JetForm<br/>
Shin'ichi Matsui, W3C/Panasonic<br/>
<dd>Steven Pemberton, CWI (HTML Working Group Chair)<br />
Murray Altheim, Sun Microsystems<br />
Daniel Austin, CNET: The Computer Network<br />
Frank Boumphrey, HTML Writers Guild<br />
John Burger, Mitre<br />
Andrew W. Donoho, IBM<br />
Sam Dooley, IBM<br />
Klaus Hofrichter, GMD<br />
Philipp Hoschka, W3C<br />
Masayasu Ishikawa, W3C<br />
Warner ten Kate, Philips Electronics<br />
Peter King, Phone.com<br />
Paula Klante, JetForm<br />
Shin'ichi Matsui, W3C/Panasonic<br />
Shane McCarron, Applied Testing and Technology (The Open Group through August
1999)<br/>
Ann Navarro, HTML Writers Guild<br/>
Zach Nies, Quark<br/>
Dave Raggett, W3C/HP (W3C lead for HTML)<br/>
Patrick Schmitz, Microsoft<br/>
Sebastian Schnitzenbaumer, Stack Overflow<br/>
Chris Wilson, Microsoft<br/>
Ted Wugofski, Gateway 2000<br/>
1999)<br />
Ann Navarro, HTML Writers Guild<br />
Zach Nies, Quark<br />
Dave Raggett, W3C/HP (W3C lead for HTML)<br />
Patrick Schmitz, Microsoft<br />
Sebastian Schnitzenbaumer, Stack Overflow<br />
Chris Wilson, Microsoft<br />
Ted Wugofski, Gateway 2000<br />
Dan Zigmond, WebTV Networks</dd>
</dl>

Expand All @@ -1364,21 +1364,21 @@ Dan Zigmond, WebTV Networks</dd>
<dt><a name="ref-css2" id="ref-css2"><b>[CSS2]</b></a></dt>

<dd><a href="http://www.w3.org/TR/REC-CSS2">&quot;Cascading Style Sheets, level 2 (CSS2) Specification&quot;</a>, B.
Bos, H. W. Lie, C. Lilley, I. Jacobs, 12 May 1998.<br/>
Bos, H. W. Lie, C. Lilley, I. Jacobs, 12 May 1998.<br />
Available at: <a href="http://www.w3.org/TR/REC-CSS2">
http://www.w3.org/TR/REC-CSS2</a></dd>

<dt><a name="ref-dom" id="ref-dom"><b>[DOM]</b></a></dt>

<dd><a href="http://www.w3.org/TR/REC-DOM-Level-1">&quot;Document Object Model (DOM) Level 1 Specification&quot;</a>, Lauren
Wood <i>et al.</i>, 1 October 1998.<br/>
Wood <i>et al.</i>, 1 October 1998.<br />
Available at: <a href="http://www.w3.org/TR/REC-DOM-Level-1">
http://www.w3.org/TR/REC-DOM-Level-1</a></dd>

<dt><a name="ref-html4" id="ref-html4"><b>[HTML]</b></a></dt>

<dd><a href="http://www.w3.org/TR/1999/PR-html40-19990824">&quot;HTML 4.01 Specification&quot;</a>, D. Raggett, A. Le&#xA0;Hors, I.
Jacobs, 24 August 1999.<br/>
Jacobs, 24 August 1999.<br />
Available at: <a href="http://www.w3.org/TR/1999/PR-html40-19990824">
http://www.w3.org/TR/1999/PR-html40-19990824</a></dd>

Expand All @@ -1394,7 +1394,7 @@ and Electronics Engineers, Inc, 1990.</dd>

<dd><a href="http://www.ietf.org/rfc/rfc2046.txt">&quot;RFC2046: Multipurpose Internet Mail Extensions (MIME) Part
Two: Media Types&quot;</a>, N. Freed and N. Borenstein, November
1996.<br/>
1996.<br />
Available at <a href="http://www.ietf.org/rfc/rfc2046.txt">
http://www.ietf.org/rfc/rfc2046.txt</a>. Note that this RFC
obsoletes RFC1521, RFC1522, and RFC1590.</dd>
Expand All @@ -1403,15 +1403,15 @@ obsoletes RFC1521, RFC1522, and RFC1590.</dd>
[RFC2119]</b></a></dt>

<dd><a href="http://www.ietf.org/rfc/rfc2119.txt">&quot;RFC2119: Key words for use in RFCs to Indicate Requirement
Levels&quot;</a>, S. Bradner, March 1997.<br/>
Levels&quot;</a>, S. Bradner, March 1997.<br />
Available at: <a href="http://www.ietf.org/rfc/rfc2119.txt">
http://www.ietf.org/rfc/rfc2119.txt</a></dd>

<dt><a name="ref-rfc2376" id="ref-rfc2376"><b>
[RFC2376]</b></a></dt>

<dd><a href="http://www.ietf.org/rfc/rfc2376.txt">&quot;RFC2376: XML Media Types&quot;</a>, E. Whitehead, M. Murata, July
1998.<br/>
1998.<br />
Available at: <a href="http://www.ietf.org/rfc/rfc2376.txt">
http://www.ietf.org/rfc/rfc2376.txt</a></dd>

Expand All @@ -1420,33 +1420,33 @@ http://www.ietf.org/rfc/rfc2376.txt</a></dd>

<dd><a href="http://www.ietf.org/rfc/rfc2396.txt">&quot;RFC2396: Uniform Resource Identifiers (URI): Generic
Syntax&quot;</a>, T. Berners-Lee, R. Fielding, L. Masinter, August
1998.<br/>
This document updates RFC1738 and RFC1808.<br/>
1998.<br />
This document updates RFC1738 and RFC1808.<br />
Available at: <a href="http://www.ietf.org/rfc/rfc2396.txt">
http://www.ietf.org/rfc/rfc2396.txt</a></dd>

<dt><a name="ref-xml" id="ref-xml"><b>[XML]</b></a></dt>

<dd><a href="http://www.w3.org/TR/REC-xml">&quot;Extensible Markup Language (XML) 1.0 Specification&quot;</a>, T.
Bray, J. Paoli, C. M. Sperberg-McQueen, 10 February 1998.<br/>
Bray, J. Paoli, C. M. Sperberg-McQueen, 10 February 1998.<br />
Available at: <a href="http://www.w3.org/TR/REC-xml">
http://www.w3.org/TR/REC-xml</a></dd>

<dt><a name="ref-xmlns" id="ref-xmlns"><b>[XMLNAMES]</b></a></dt>

<dd><a href="http://www.w3.org/TR/REC-xml-names">&quot;Namespaces in XML&quot;</a>, T. Bray, D. Hollander, A. Layman, 14
January 1999.<br/>
January 1999.<br />
XML namespaces provide a simple method for qualifying names used
in XML documents by associating them with namespaces identified
by URI.<br/>
by URI.<br />
Available at: <a href="http://www.w3.org/TR/REC-xml-names">
http://www.w3.org/TR/REC-xml-names</a></dd>

</dl>
<p><a href="http://www.w3.org/WAI/WCAG1AAA-Conformance" title="Explanation of Level Triple-A Conformance">
<img height="32" width="88" src="wcag1AAA.gif" alt="Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0"/></a></p>
<img height="32" width="88" src="wcag1AAA.gif" alt="Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" /></a></p>
<div class="navbar">
<hr/>
<hr />
<a href="#toc">table of contents</a>
</div>
</body>
Expand Down
30 changes: 30 additions & 0 deletions result/xhtml1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- 3.1.1 3/ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Virtual Library</title>
</head>
<!-- 4.8 -->
<script type="text/javascript"><![CDATA[
... unescaped script content ...
]]></script>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
<!-- C2 -->
<img src="foo.gif" alt="foo" />
<!-- C3 -->
<p></p>
<!-- C7 -->
<p lang="fr" xml:lang="fr">coucou</p>
<p xml:lang="fr" lang="fr">salut</p>
<!-- C8 -->
<p name="fragid" id="fragid">test</p>
<!-- 4.5 -->
<dl compact="compact">
<dt>Internet Engineering Task Force</dt>
<dd>An organization which establishes technical standards for the Internet</dd>
</dl>

</html>
34 changes: 34 additions & 0 deletions test/xhtml1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- 3.1.1 3/ -->
<html xml:lang="en" lang="en">
<head>
<title>Virtual Library</title>
</head>
<!-- 4.8 -->
<script type="text/javascript">
... unescaped script content ...
</script>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
<!-- C2 -->
<img src="foo.gif" alt="foo"/>
<!-- C3 -->
<p/>
<!-- C7 -->
<p lang="fr">coucou</p>
<p xml:lang="fr">salut</p>
<!-- C8 -->
<p name="fragid">test</p>
<!-- 4.5 -->
<dl compact="">
<dt>Internet Engineering Task Force</dt>
<dd>An organization which establishes technical standards for the Internet</dd>
</dl>

</html>


Loading

0 comments on commit d5c2f92

Please # to comment.