diff options
Diffstat (limited to 'files/zh-cn/mozilla中的xml/index.html')
-rw-r--r-- | files/zh-cn/mozilla中的xml/index.html | 227 |
1 files changed, 0 insertions, 227 deletions
diff --git a/files/zh-cn/mozilla中的xml/index.html b/files/zh-cn/mozilla中的xml/index.html deleted file mode 100644 index fb24cd8e17..0000000000 --- a/files/zh-cn/mozilla中的xml/index.html +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: Mozilla中的XML -slug: Mozilla中的XML -tags: - - XML -translation_of: Archive/Mozilla/XML_in_Mozilla ---- -<p> -</p><p>Mozilla has good support for <a href="cn/XML">XML</a>. Several World Wide Web Consortium (<a class="external" href="http://w3c.org/">W3C</a>) Recommendations and drafts from the XML family of specifications are supported, as well as other related technologies. -</p> -<h3 id="Supported_Core_XML_W3C_Recommendations" name="Supported_Core_XML_W3C_Recommendations"> Supported Core XML W3C Recommendations </h3> -<p>The core XML support includes parsing XML without validation (we use the Expat parser), displaying XML with CSS, manipulating XML documents with scripts via DOM, associating stylesheets with XML documents, and namespaces in XML. The core support is very good with few bugs. -</p> -<h4 id="DTDs_and_Other_External_Entities" name="DTDs_and_Other_External_Entities"> DTDs and Other External Entities </h4> -<p>Mozilla does not load external entities from the web. -</p><p>Mozilla can load external entities whose system identifier uses the <code>chrome</code> protocol. This feature is used mainly to <a href="cn/XUL_Tutorial/Localization">localize Mozilla to different languages</a> (the UI strings are stored in external DTD files). Another exception is an entity whose system identifier is a relative path, and the XML declaration states that the document is not standalone (default), in which case Mozilla will try to look for the entity under <tt><bin>/res/dtd</tt> directory. -</p><p>Mozilla may also make an exception with XHTML documents, see below. -</p><p>Mozilla will read internal (DTD) subsets, and in special circumstances external DTDs as explained above and will use this information to recognize ID type attributes, default attribute values, and general entities. -</p> -<h4 id="Other_Notes" name="Other_Notes"> Other Notes </h4> -<p>A lot of the Document Object Model (<a class="external" href="http://www.w3.org/DOM/">DOM</a>, W3C Recommendations and drafts) applies to XML. Likewise, the Cascading Style Sheets (<a class="external" href="http://www.w3.org/Style/CSS/">CSS</a>, W3C Recommendations and drafts) style language can be used to style XML documents. -</p><p>The code for most the core XML can be found in the following directories on the Mozilla CVS server: <code><a href="https://dxr.mozilla.org/mozilla-central/source/content/xml/" rel="custom">content/xml/</a></code>, <code><a href="https://dxr.mozilla.org/mozilla-central/source/parser/expat/" rel="custom">parser/expat/</a></code> and <code><a href="https://dxr.mozilla.org/mozilla-central/source/parser/htmlparser/" rel="custom">parser/htmlparser/</a></code>. -</p><p>The newsgroup to discuss XML in Mozilla depends a bit on the nature of the question. For example, DOM related questions should probably be discussed in the netscape.public.mozilla.dom newsgroup, while style issues should be discussed on netscape.public.mozilla.style and so on. The catch-all newsgroup for XML discussion is netscape.public.mozilla.xml. -</p> -<table class="standard-table"> <tbody><tr> -<td class="header">Specification or technology -</td><td class="header">Status and/or further documentation -</td></tr> -<tr> -<td>XML -</td><td><a class="external" href="http://www.w3.org/TR/REC-xml">W3C Recommendation</a> -</td></tr> -<tr> -<td>Namespaces in XML -</td><td><a class="external" href="http://www.w3.org/TR/REC-xml-names/">W3C Recommendation</a> -</td></tr> -<tr> -<td>Associating Stylesheets with XML Documents -</td><td><a class="external" href="http://www.w3.org/TR/xml-stylesheet/">W3C Recommendation</a> -</td></tr> -<tr> -<td>Styling XML Documents with CSS -</td><td> -</td></tr> -<tr> -<td>Manipulating XML documents with scripts through DOM -</td><td> -</td></tr> -</tbody></table> -<h3 id="Other_Supported_XML_W3C_Recommendations" name="Other_Supported_XML_W3C_Recommendations"> Other Supported XML W3C Recommendations </h3> -<table class="standard-table"> <tbody><tr> -<td class="header">Specification or Technology -</td><td class="header">Documentation -</td></tr> -<tr> -<td>XHTML -</td><td><a class="external" href="http://www.w3.org/TR/xhtml1/">W3C Recommendation</a> -</td></tr> -<tr> -<td>XML Base (for links only, not used for <code>:visited</code> etc. <a href="cn/CSS">CSS</a> properties) -</td><td><a class="external" href="http://www.w3.org/TR/xmlbase/">W3C Recommendation</a> -</td></tr> -<tr> -<td>XLink (simple XLinks only) -</td><td><a class="external" href="http://www.w3.org/TR/xlink/">W3C Recommendation</a> -</td></tr> -<tr> -<td>FIXptr -</td><td><a class="external" href="http://lists.w3.org/Archives/Public/www-xml-linking-comments/2001AprJun/att-0074/01-NOTE-FIXptr-20010425.htm">W3C "proposal"</a> -</td></tr> -<tr> -<td>XPointer Framework -</td><td><a class="external" href="http://www.w3.org/TR/xptr-framework/">W3C Recommendation</a> -</td></tr> -<tr> -<td>XPointer <code>element()</code> scheme -</td><td><a class="external" href="http://www.w3.org/TR/xptr-element/">W3C Recommendation</a> -</td></tr> -<tr> -<td>XPointer <code>xmlns()</code> scheme -</td><td><a class="external" href="http://www.w3.org/TR/xptr-xmlns/">W3C Recommendation</a> -</td></tr> -<tr> -<td>XPointer <code>fixptr()</code> scheme -</td><td>This scheme is simply a wrapper for FIXptr -</td></tr> -<tr> -<td>XPointer <code>xpath1()</code> scheme -</td><td><a class="external" href="http://www.simonstl.com/ietf/draft-stlaurent-xpath-frag-00.html">Internet-Draft</a> -</td></tr> -<tr> -<td><code>document.load()</code>, <code>document.async</code> -</td><td><a class="external" href="http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS">Part of DOM Level 3 Load & Save module, a W3C Working Draft</a> -</td></tr> -</tbody></table> -<h4 id="XHTML" name="XHTML"> XHTML </h4> -<p>We have reasonable <a href="cn/XHTML">XHTML</a> support, most things should work. We treat XHTML documents differently depending on the mime type (or file suffix if files are loaded from local discs). Files that go through the <a href="cn/HTML">HTML</a> code path are not checked for well-formedness. You will also notice not all XHTML features are supported when you exercise HTML code path. -</p> -<table class="standard-table"> <tbody><tr> -<td class="header">MIME Type -</td><td class="header">File Suffix -</td><td class="header">Code Path -</td></tr> -<tr> -<td>text/xml<br>application/xml<br>application/xhtml+xml -</td><td>xml<br>xht<br>xhtml -</td><td>XML -</td></tr> -<tr> -<td>text/html -</td><td>html<br>htm -</td><td>HTML -</td></tr> -</tbody></table> -<p>The entire document need not be XHTML. You can use XHTML elements inside an arbitrary XML document by using the XHTML namespace. See the <a href="#Testing_and_QA">Testing and QA</a> section for samples. The correct XHTML namespace is <code><span class="nowiki">http://www.w3.org/1999/xhtml</span></code> -</p><p>Please note that the XHTML entities, like <code>&auml;</code>, work only in conforming XHTML documents that have a valid XHTML Formal Public Identifier (or in other words, a DOCTYPE section with a PUBLIC identifier). XHTML entities will not work in arbitrary XML documents, not even if the XHTML namespace is used. The public identifiers that are recognized are: -</p> -<pre>-//W3C//DTD XHTML 1.0 Transitional//EN --//W3C//DTD XHTML 1.1//EN --//W3C//DTD XHTML 1.0 Strict//EN --//W3C//DTD XHTML 1.0 Frameset//EN --//W3C//DTD XHTML Basic 1.0//EN --//W3C//DTD XHTML 1.1 plus MathML 2.0//EN --//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN --//W3C//DTD SVG 20001102//EN --//WAPFORUM//DTD XHTML Mobile 1.0//EN -</pre> -<h4 id="XML_Linking_and_Pointing" name="XML_Linking_and_Pointing"> XML Linking and Pointing </h4> -<p>XML Linking support includes <a class="external" href="http://www.w3.org/TR/xmlbase">XML Base</a> (used only when you mouse over a link or click a link) and simple <a class="external" href="http://www.w3.org/TR/xlink/">XLinks</a>. You can make any XML element into an XLink by using the XLink namespace <code><span class="nowiki">http://www.w3.org/1999/xlink</span></code>. You can also use the linking elements from the XHTML namespace. See the <a href="#Testing_and_QA">Testing and QA</a> section for samples. -</p><p>For pointing into resources in XML documents Mozilla also supports <a class="external" href="http://lists.w3.org/Archives/Public/www-xml-linking-comments/2001AprJun/att-0074/01-NOTE-FIXptr-20010425.htm">FIXptr</a>, a simplified, non-compatible version of XPointer. In addition to using FIXptr in links, it is possible to use it from scripts. See the proprietary <code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/public/idl/core/nsIDOMXMLDocument.idl" rel="custom">dom/public/idl/core/nsIDOMXMLDocument.idl</a></code> interface. There is test case for <a class="link-https" href="https://bugzilla.mozilla.org/attachment.cgi?id=46954&action=view">FIXptr links</a> and a <a class="link-https" href="https://bugzilla.mozilla.org/attachment.cgi?id=61629&action=view">scripting example</a>. -</p><p>Since 1.4alpha, Mozilla also supports <a class="external" href="http://www.w3.org/TR/xptr-framework/">XPointer Framework</a>, <a class="external" href="http://www.w3.org/TR/xptr-element/">XPointer <code>element()</code> scheme</a>, <a class="external" href="http://www.w3.org/TR/xptr-xmlns/">XPointer <code>xmlns()</code> scheme</a>, XPointer <code>fixptr()</code> scheme and <a class="external" href="http://www.simonstl.com/ietf/draft-stlaurent-xpath-frag-00.html">XPointer <code>xpath1()</code> scheme</a>. The XPointer processor is extensible and it is easy to implement support for other schemes - have a look at the <a href="https://dxr.mozilla.org/mozilla-central/source/content/xml/document/public/nsIXPointer.idl" rel="custom">API</a>. The <code>xpath1()</code> scheme was <a href="https://dxr.mozilla.org/mozilla-central/source/content/xslt/src/xpath/nsXPath1Scheme.cpp" rel="custom">implemented using this extensible mechanism</a>. There is also a <a href="https://dxr.mozilla.org/mozilla-central/source/dom/public/idl/core/nsIDOMXMLDocument.idl" rel="custom">proprietary API from scripts</a> to the XPointer processor. There is a <a class="link-https" href="https://bugzilla.mozilla.org/attachment.cgi?id=119333&action=view">testcase for XPointers</a> that you can also study. -</p><p>Lastly, there is a pref you might want to try (especially useful with FIXptr) that will select the link target when you traverse it. There is no UI for setting this pref yet, so you will need to manually edit the preferences file. Add this line: -</p> -<pre>pref("layout.selectanchor", true); -</pre> -<h4 id="DOM_Load_and_Save_Methods" name="DOM_Load_and_Save_Methods"> DOM Load and Save Methods </h4> -<p><code>document.load()</code> is a part of the W3C <a class="external" href="http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS">DOM Level 3 Load & Save module</a>. Mozilla currently implements only the <code>load()</code> method and the <code>async</code> property. Since 1.4alpha it has been possible to load documents synchronously, before that it was only asynchronous. <a href="https://dxr.mozilla.org/mozilla-central/source/content/xml/tests/load/" rel="custom">See the load sample</a> in the XML tests directory. (Loading the load.html file from the LXR generated page will not work because LXR will munge the test.xml file into HTML and serve it as HTML. To test this functionality, create the files on your local disk or on a webserver.) -</p> -<h3 id="Outside_Supported_XML_W3C_Recommendations" name="Outside_Supported_XML_W3C_Recommendations"> Outside Supported XML W3C Recommendations </h3> -<table class="standard-table"> <tbody><tr> -<td class="header">Specification or Technology -</td><td class="header">Documentation -</td><td class="header">Mozilla Project -</td></tr> -<tr> -<td><a href="cn/XSLT">XSLT</a> -</td><td><a class="external" href="http://www.w3.org/TR/xslt">W3C Recommendation</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/xslt/">XSLT</a> -</td></tr> -<tr> -<td><a href="cn/XPath">XPath</a> -</td><td><a class="external" href="http://www.w3.org/TR/xpath">W3C Recommendation</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/xslt/">XSLT</a> -</td></tr> -<tr> -<td><a href="cn/XMLHttpRequest">XMLHttpRequest</a> -</td><td><a class="external" href="http://msdn.microsoft.com/library/psdk/xmlsdk/xmld8bp0.htm">Microsoft</a> -</td><td><a class="external" href="http://www.mozilla.org/xmlextras/">XML Extras</a> -</td></tr> -<tr> -<td><a href="cn/DOMParser">DOMParser</a> and <a href="cn/XMLSerializer">XMLSerializer</a> -</td><td><a class="external" href="http://www.mozilla.org/xmlextras/">Mozilla</a> -</td><td><a class="external" href="http://www.mozilla.org/xmlextras/">XML Extras</a> -</td></tr> -<tr> -<td><a href="cn/SOAP_in_Gecko-based_Browsers">SOAP</a> -</td><td><a class="external" href="http://www.w3.org/TR/SOAP/">W3C Note</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/webservices/">Web Services</a> -</td></tr> -<tr> -<td><a href="cn/XML-RPC">XML-RPC</a> -</td><td><a class="external" href="http://www.xmlrpc.com/spec">UserLand Software</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/xmlrpc/">XML-RPC</a> -</td></tr> -<tr> -<td><a href="cn/RDF">RDF</a> -</td><td><a class="external" href="http://www.w3.org/RDF/">W3C Recommendations</a> -</td><td><a href="cn/RDF">RDF</a> -</td></tr> -<tr> -<td><a href="cn/SVG">SVG</a> -</td><td><a class="external" href="http://www.w3.org/Graphics/SVG/">W3C Proposed Recommendation</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/svg/">SVG</a> -</td></tr> -<tr> -<td><a href="cn/MathML">MathML</a> -</td><td><a class="external" href="http://www.w3.org/Graphics/SVG/">W3C Recommendation</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/mathml/">MathML</a> -</td></tr> -<tr> -<td><a href="cn/P3P">P3P</a> -</td><td><a class="external" href="http://www.w3.org/TR/P3P/">W3C Recommendation</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/p3p/">P3P</a> -</td></tr> -<tr> -<td><a href="cn/Accessing_Web_Services_in_Mozilla_Using_WSDL_Proxying">WSDL</a> -</td><td><a class="external" href="http://www.w3.org/TR/wsdl">W3C Note</a> -</td><td><a class="external" href="http://www.mozilla.org/projects/webservices/">Web Services</a> -</td></tr> -<tr> -<td><a href="cn/XBL">XBL</a> -</td><td><a class="external" href="http://www.w3.org/TR/xbl/">W3C Note</a> (by Mozilla) -</td><td><a class="external" href="http://www.mozilla.org/projects/xbl/xbl.html">XBL</a> -</td></tr> -<tr> -<td><a href="cn/XUL">XUL</a> -</td><td><a class="external" href="http://www.mozilla.org/xpfe/xulref/">Mozilla</a> -</td><td><a class="external" href="http://www.mozilla.org/xpfe/">XPToolkit</a> -</td></tr> -</tbody></table> -<h3 id="Roadmap" name="Roadmap"> Roadmap </h3> -<p>Next big tasks would include support for XPointer <code>xpointer()</code> scheme (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=32832" title="Implement XPointer">bug 32832</a>), full XLink support (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=61664" title="Implement full XLink">bug 61664</a>), XInclude, XML Catalogs (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=98413" title="Implement XML Catalogs">bug 98413</a>), XForms (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=97806" title="Implement W3C XForms in browser and composer">bug 97806</a>), validating parser (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=196355" title="Implement validating XML parser (validate with DTDs)">bug 196355</a>), XML Schemas and incremental layout of XML document (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=18333" title="FIXED: XML Content Sink should be incremental">bug 18333</a>), and a <a href="cn/SAX">SAX</a> API (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=315825" title="NS_ERROR_FAILURE nsIDOMWindowInternal.focus in tabbrowser.xml">bug 315825</a>). -</p><p>To fully implement XLink, we need something called a link manager. See some initial <a class="external" href="http://www.mozilla.org/newlayout/xml/lmdesign.html">design documents</a>. -</p> -<h3 id="Testing_and_QA" name="Testing_and_QA"> Testing and QA </h3> -<p>We have a lot of testcases linked to from the <a class="external" href="http://www.mozilla.org/quality/browser_sc.html">browser standards compliance</a> QA page. -</p><p>Most of the core XML test documents on the CVS server are located in <code><a href="https://dxr.mozilla.org/mozilla-central/source/content/xml/tests" rel="custom">content/xml/tests</a></code>. We also have a couple online: the books demo and the IRS table of contents demo. Both of them demonstrate XML, Associating stylesheets with XML, displaying XML with CSS, Namespaces in XML, XHTML, simple XLinks, and manipulation of XML with scripts via DOM. -</p><p>There is an XML component in Bugzilla. -</p><p>We also have the "xhtml" keyword for XHTML bugs (these tend to be scattered across components). -</p><p>We have bugs open to make NIST DOM (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=51247" title="FIXED: Test harness for NIST DOM test suite does not work in Mozilla">bug 51247</a>) and NIST XML test suites to work in Mozilla - they currently do not work. -</p> -<h3 id="How_can_I_help.3F" name="How_can_I_help.3F">How can I help? </h3> -<p>If you can code, look for <a class="external" href="http://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Browser&component=XML&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&status_whiteboard=&status_whiteboard_type=substring&keywords=helpwanted&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&namedcmd=joki_not_fixed_not_future&newqueryname=&order=Reuse+same+sort+as+last+time">helpwanted keyword in XML bugs</a>. We don't use that always, so if you want to avoid doing duplicate work you could start working on bugs that have <a class="external" href="http://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Browser&component=XML&target_milestone=Future&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&status_whiteboard=&status_whiteboard_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&namedcmd=joki_not_fixed_not_future&newqueryname=&order=Reuse+same+sort+as+last+time">Future milestone</a>, or otherwise have a milestone that is set way into the future. -</p><p>You can always test our XML support. We'd really like to get tests that can be run automatically (this would require knowledge of web development; <code>document.load()</code> and/or XML Extras might be needed), but probably most of the bugs we get have just been found by normal people trying to do something that works in some other browser and does not work in Mozilla. -</p> -<div class="noinclude"> -</div> |