Revision 34652 of XML Extras

  • Slug da revisão: Extras_XML
  • Título da revisão: XML Extras
  • ID da revisão: 34652
  • Criado:
  • Autor: maicon
  • É revisão atual? Não
  • Comentário 144 words added, 122 words removed; page display name changed to 'XML Extras'
Etiquetas: 

Conteúdo da revisão

 

O módulo XML Extras contém inúmeras features que permitem que os desenvolvedores tratem XML como dados e não somente como um outro formato de documento. O módulo é estruturado como um componente drop-in e expõe suas features XML-as-data tanto para usuários de JavaScript como para usuários de C++/XPCOM. O módulo XML Extras é construído por padrão em todas as plataformas e é incluído no installer do browser, de modo que, ele está disponível no nightly builds.

Status das Features

Feature Status
XMLSerializer Disponível
XMLHttpRequest Disponível
DOMParser (string and stream input source) Disponível
Web Services with SOAP and WSDL Disponível desde a versão 1.4alpha. Movida para o módulo Web Services durante a versão 1.4beta.
XML Persistence  
FIXptr and XPointer Disponível desde a versão 1.4alpha no core Mozilla. Movida para o XMLExtras durante a versão 1.4beta.

Veja também:

Perguntas Respostas e Testes

Existem alguns testes online principalmente para o exercício do método HTTP GET através do XMLHttpRequest.

Other test cases for each of the implemented components listed above exist in {{ Source("extensions/xmlextras/tests/") }}. More exhaustive test suites need to be created, however. If you'd like to help out with QA, you can do one of the following:

  • Sign up as the QA owner for any of the implemented components. The QA owner will manage the tests associated with their component, act as QA contact for related bugs and help with regression testing.
  • Contribute a test suite or individual tests that use the implemented components. File bugs for new test you have, and/or check them into {{ Source("extensions/xmlextras/tests/") }}.
  • File bugs against the implemented components. Bugs should be filed against the XML component in the Browser product.

Documentação

Provavelmente a melhor maneira de aprender a usar estas tecnologias é através de exemplos. Existem vários em {{ Source("extensions/xmlextras/tests/") }}. If you follow that link to look at the examples you will need to look at page source for the HTML documents.

For XMLHttpRequest object you can mostly rely on the Microsoft XMLHttpRequest documentation, with some caveats: all functions and property names begin with a lower case letter and the object creation is different. Some properties are not implemented.

Thad Hoffman has written a document that shows how you can mimic XML Data Islands in Mozilla. Edmond Woychowsky has also written articles on XML Data Islands in Mozilla: "Make XML data islands work in Mozilla", "Build cross-browser XML paging code" and "Implement a flexible shopping cart with XML and ASP". The Mozilla Developer Center has several pages for XMLHttpRequest.

Below are some key differencies in "XML Extras" between Mozilla and Microsoft software:

Diferença Microsoft Mozilla
Member names Case insensitive? Begins with lower case letter
XMLHttpRequest Creation new ActiveXObject("Msxml2.XMLHTTP") new XMLHttpRequest()
XMLHttpRequest.send("some string") ok ok starting with milestone 0.9.7 (actually nightly 2001-11-28). With older builds, passing strings to send() works only in chrome, see {{ Named-source("extensions/xmlextras/tests/post.html", "post.html") }} sample. The "workaround" is to use DOMParser object's parseFromString() method to create a document from string, and pass the temporary document into send().
XMLHttpRequest.open("aHost") ok file:// documents can access http:// documents but you need to enable UniversalBrowserRead privilege in your scripts - see the JavaScript Security: Signed Scripts document for more details. Normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either). Additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. You cannot open a connection to a different host.
DOMParser Creation not available new DOMParser()
XMLSerializer Creation not available new XMLSerializer()

Minimal documentation for the components listed above can be found using Mozilla documentation generated by Doxygen. File new bugs for additional documentation contributions, either specifically aimed at JavaScript developers or to complete & clarify the JavaDoc-style comments in the IDL files.

  • nsIDOMSerializer (Currently, the JavaScript constructor is XMLSerializer())
  • nsIDOMParser (Currently, the JavaScript constructor is DOMParser())
  • nsIXMLHttpRequest

Please see the XML Linking and Pointing section in XML in Mozilla document for FIXptr and XPointer documentation.

Como eu posso ajudar?

  • Help with testing the components contained within the module.
  • Contribute {{ Anch("Documentation") }} to the module.
  • Help at the code level, contributing code patches for bug fixes or feature completion.

Categorias

Interwiki Language Links

{{ languages( { "en": "en/XML_Extras", "fr": "fr/XML_Extras" } ) }}

Fonte da revisão

<p> </p>
<p>O módulo XML Extras contém inúmeras <em>features</em> que permitem que os desenvolvedores tratem XML como dados e não somente como um outro formato de documento. O módulo é estruturado como um componente <em>drop-in </em>e expõe suas <em>features</em> XML-as-data tanto para usuários de <a href="/pt/JavaScript" title="pt/JavaScript">JavaScript</a> como para usuários de C++/<a href="/pt/XPCOM" title="pt/XPCOM">XPCOM</a>. O módulo XML Extras é construído por padrão em todas as plataformas e é incluído no <em>installer </em>do browser, de modo que, ele está disponível no nightly builds.</p>
<h3 name="Feature_Status">Status das Features</h3>
<table class="standard-table"> <tbody> <tr> <td class="header">Feature</td> <td class="header">Status</td> </tr> <tr> <td><a href="/pt/XMLSerializer" title="pt/XMLSerializer">XMLSerializer</a></td> <td>Disponível</td> </tr> <tr> <td><a href="/pt/XMLHttpRequest" title="pt/XMLHttpRequest">XMLHttpRequest</a></td> <td>Disponível</td> </tr> <tr> <td><a href="/pt/DOMParser" title="pt/DOMParser">DOMParser</a> (string and stream input source)</td> <td>Disponível</td> </tr> <tr> <td>Web Services with <a href="/pt/SOAP_in_Gecko-based_Browsers" title="pt/SOAP_in_Gecko-based_Browsers">SOAP</a> and <a href="/pt/Accessing_Web_Services_in_Mozilla_Using_WSDL_Proxying" title="pt/Accessing_Web_Services_in_Mozilla_Using_WSDL_Proxying">WSDL</a></td> <td>Disponível desde a versão 1.4alpha. Movida para o módulo Web Services durante a versão 1.4beta.</td> </tr> <tr> <td>XML Persistence</td> <td> </td> </tr> <tr> <td>FIXptr and XPointer</td> <td>Disponível desde a versão 1.4alpha no core Mozilla. Movida para o XMLExtras durante a versão 1.4beta.</td> </tr> </tbody>
</table>
<p>Veja também:</p>
<ul> <li>{{ Named-source("extensions/xml-rpc/", "XML-RPC") }}</li> <li><a href="/pt/XML_in_Mozilla" title="pt/XML_in_Mozilla">XML em Mozilla</a></li> <li><a href="/pt/XML_in_Mozilla#DOM_Load_and_Save_Methods" title="pt/XML_in_Mozilla#DOM_Load_and_Save_Methods">document.load()</a></li> <li><a class="external" href="http://kb.mozillazine.org/Category:XML_in_JavaScript">Alguns exemplos de como lidar com XML</a> da Base de Conhecimento MozillaZine Knowledge Base.</li>
</ul>
<h3 name="QA_and_Testing">Perguntas Respostas e Testes</h3>
<p>Existem alguns <a class="external" href="http://www.mozilla.org/xmlextras/tests.html">testes online</a> principalmente para o exercício do método HTTP GET através do <a href="/pt/XMLHttpRequest" title="pt/XMLHttpRequest">XMLHttpRequest</a>.</p>
<p>Other test cases for each of the implemented components listed above exist in {{ Source("extensions/xmlextras/tests/") }}. More exhaustive test suites need to be created, however. If you'd like to help out with QA, you can do one of the following:</p>
<ul> <li>Sign up as the QA owner for any of the implemented components. The QA owner will manage the tests associated with their component, act as QA contact for related bugs and help with regression testing.</li> <li>Contribute a test suite or individual tests that use the implemented components. File bugs for new test you have, and/or check them into {{ Source("extensions/xmlextras/tests/") }}.</li> <li>File bugs against the implemented components. Bugs should be filed against the XML component in the Browser product.</li>
</ul>
<h3 name="Documentation">Documentação</h3>
<p>Provavelmente a melhor maneira de aprender a usar estas tecnologias é através de exemplos. Existem vários em {{ Source("extensions/xmlextras/tests/") }}. If you follow that link to look at the examples you will need to look at page source for the HTML documents.</p>
<p>For <a href="/pt/XMLHttpRequest" title="pt/XMLHttpRequest">XMLHttpRequest</a> object you can mostly rely on the <a class="external" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/63409298-0516-437d-b5af-68368157eae3.asp">Microsoft XMLHttpRequest documentation</a>, with some caveats: all functions and property names begin with a lower case letter and the object creation is different. Some properties are not implemented.</p>
<p>Thad Hoffman has written a document that shows how you can mimic <a href="/pt/Using_XML_Data_Islands_in_Mozilla" title="pt/Using_XML_Data_Islands_in_Mozilla">XML Data Islands in Mozilla</a>. Edmond Woychowsky has also written articles on XML Data Islands in Mozilla: "<a class="external" href="http://builder.com.com/article.jhtml?id=u00220030515woy01.htm">Make XML data islands work in Mozilla</a>", "<a class="external" href="http://builder.com.com/5100-6371-5085227.html">Build cross-browser XML paging code</a>" and "<a class="external" href="http://builder.com.com/article.jhtml?id=u00320030718woy01.htm">Implement a flexible shopping cart with XML and ASP</a>". The Mozilla Developer Center has several pages for <a href="/pt/XMLHttpRequest" title="pt/XMLHttpRequest">XMLHttpRequest</a>.</p>
<p>Below are some key differencies in "XML Extras" between Mozilla and Microsoft software:</p>
<table class="standard-table"> <tbody> <tr> <td class="header">Diferença</td> <td class="header">Microsoft</td> <td class="header">Mozilla</td> </tr> <tr> <td>Member names</td> <td>Case insensitive?</td> <td>Begins with lower case letter</td> </tr> <tr> <td><a href="/pt/XMLHttpRequest" title="pt/XMLHttpRequest">XMLHttpRequest</a> Creation</td> <td><code>new ActiveXObject("Msxml2.XMLHTTP")</code></td> <td><code>new XMLHttpRequest()</code></td> </tr> <tr> <td><code>XMLHttpRequest.send("some string")</code></td> <td>ok</td> <td>ok starting with milestone 0.9.7 (actually nightly 2001-11-28). With older builds, passing strings to send() works only in chrome, see {{ Named-source("extensions/xmlextras/tests/post.html", "post.html") }} sample. The "workaround" is to use DOMParser object's <code>parseFromString()</code> method to create a document from string, and pass the temporary document into <code>send()</code>.</td> </tr> <tr> <td><code>XMLHttpRequest.open("aHost")</code></td> <td>ok</td> <td><code><a class=" external" href="file://" rel="freelink">file://</a></code> documents can access <code><a class=" external" href="http://" rel="freelink">http://</a></code> documents but you need to enable <code>UniversalBrowserRead</code> privilege in your scripts - see the <a class="external" href="http://www.mozilla.org/projects/security/components/signed-scripts.html#privs">JavaScript Security: Signed Scripts</a> document for more details. Normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either). Additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. You cannot open a connection to a different host.</td> </tr> <tr> <td><a href="/pt/DOMParser" title="pt/DOMParser">DOMParser</a> Creation</td> <td>not available</td> <td><code>new DOMParser()</code></td> </tr> <tr> <td><a href="/pt/XMLSerializer" title="pt/XMLSerializer">XMLSerializer</a> Creation</td> <td>not available</td> <td><code>new XMLSerializer()</code></td> </tr> </tbody>
</table>
<p>Minimal documentation for the components listed above can be found using Mozilla documentation generated by <a class="external" href="http://www.doxygen.org/">Doxygen</a>. File new bugs for additional documentation contributions, either specifically aimed at JavaScript developers or to complete &amp; clarify the JavaDoc-style comments in the IDL files.</p>
<ul> <li>nsIDOMSerializer (Currently, the JavaScript constructor is <code>XMLSerializer()</code>)</li> <li>nsIDOMParser (Currently, the JavaScript constructor is <code>DOMParser()</code>)</li> <li>nsIXMLHttpRequest</li>
</ul>
<p>Please see the <a href="/pt/XML_in_Mozilla#XML_Linking_and_Pointing" title="pt/XML_in_Mozilla#XML_Linking_and_Pointing">XML Linking and Pointing</a> section in <a href="/pt/XML_in_Mozilla" title="pt/XML_in_Mozilla">XML in Mozilla</a> document for FIXptr and XPointer documentation.</p>
<h3 name="How_can_I_help.3F">Como eu posso ajudar?</h3>
<ul> <li>Help with <a href="/pt/XML_in_Mozilla#Testing_and_QA" title="pt/XML_in_Mozilla#Testing_and_QA">testing</a> the components contained within the module.</li> <li>Contribute {{ Anch("Documentation") }} to the module.</li> <li>Help at the code level, contributing code patches for bug fixes or feature completion.</li>
</ul>
<p><span class="comment">Categorias</span></p>
<p><span class="comment">Interwiki Language Links</span></p>
<p>{{ languages( { "en": "en/XML_Extras", "fr": "fr/XML_Extras" } ) }}</p>
Reverter para esta revisão