Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

XML w Mozilli

UWAGA: Tłumaczenie tej strony nie zostało zakończone.
Może być ona niekompletna lub wymagać korekty.
Chcesz pomóc? | Dokończ tłumaczenie | Sprawdź ortografię | Więcej takich stron+.


Mozilla posiada dobre wsparcie XML-a. Wspieranych jest wiele Rekomendacji i szkiców Konsorcjum World Wide Web (W3C), jak również innych spokrewnionych technologii.

This page is outdated. Please help updating it with current information.

Wspierane Podstawowe Rekomendacje W3C dot. XML

Podstawowe wsparcie XML-a obejmuje parsowanie dokumentów XML bez walidacji (stosujemy w tym celu parser Expat), wyświetlanie dokumentów XML wraz z arkuszami CSS, manipulowanie dokumentami XML poprzez DOM, kojarzenie arkuszami stylów z dokumentami XML, oraz przestrzenie nazw w XML-u. Podstawowe wsparcie jest bardzo dobre, z kilkoma błędami.

DTD i inne encje zewnętrzne

Mozilla nie wczytuje zewnętrznych encji z sieci Web.

Mozilla może wczytywać encje zewnętrzne których identyfikator systemu stosuje protokół chrome. Funkcjonalność ta jest stosowana głównie podczas lokalizacji Mozilli do różnych języków (ciągi znaków dla UI przechowywane są w zewnętrznych plikach DTD). Kolejnym wyjątkiem jest encja której identyfikator systemu jest relatywną ścieżką, a parametr standalone dokumentu nie został ustawiony w deklaracji XML (domyślnie), w takim wypadku Mozilla będzie szukać takiej encji w katalogu <bin>/res/dtd.

Mozilla może również robić wyjątki dla dokumentów XHTML, zobacz poniżej.

Mozilla czyta podzbiory wewnętrzne (DTD), i w specjalnych przypadkach zewnętrzne DTD jak opisane powyżej, i użyje tych informacji w celu rozpoznania typu atrybutów ID, domyślnych wartości atrybutów, i generalnych encji.

Dodatkowe informacje

Duża część Obiektowego modelu dokumentu (DOM, Rekomendacje i szkice W3C) dotyczy się XML-a. Podobnie, Kaskadowe arkusze stylów (CSS, Rekomendacje i szkice W3C) mogą zostać zastosowane w celu stylizacji dokumentów XML.

Kod większości podstawowego wsparcia dla XML-a może zostać znaleziony w następujących katalogach serwera CVS Mozilli: content/xml/, parser/expat/oraz parser/htmlparser/.

Wybór grupy dyskusyjnej Mozilli dot. XML-a zalezy od natury pytania. Dla przykładu, pytania związane z technologią DOM powinny być zadawane na grupie mozilla.dev.tech.dom, pytania dotyczące stylów - na mozilla.dev.tech.css, i tak dalej. Grupa obejmująca dyskusje dotyczące ogólnie XML-a to mozilla.dev.tech.xml.

Specyfikacja lub technologia Status i/lub szersza dokumentacja
XML Rekomendacja W3C
Przestrzenie nazw w XML Rekomendacja W3C
Kojarzenie arkuszy stylów z dokumentami XML Rekomendacja W3C
Stylizacja dokumentów XML z zastosowaniem CSS  
Manipulowanie dokumentami XML z zastosowaniem skryptów i DOM  

Inne wspierane Rekomendacje W3C ws. XML

Specyfikacja lub Technologia Dokumentacja
XHTML Rekomendacja W3C
XML Base (tylko łącza, nie stosowane z właściwościami :visited etc. CSS) Rekomendacja W3C
XLink (tylko proste XLink-i) Rekomendacja W3C
FIXptr "propozycja" W3C
XPointer Framework Rekomendacja W3C
Schemat element() technologii XPointer Rekomendacja W3C
Schemat xmlns() technologii XPointer Rekomendacja W3C
Schemat fixptr() technologii XPointer Ten schemat jest po prostu obiektem opakowującym FIXptr
Schemat xpath1() technologii XPointer Internet-Draft
document.load(), document.async Część modułu DOM Level 3 Load & Save, "Working Draft" W3C

XHTML

Mamy rozsądne wsparcie XHTML-a, większość rzeczy powinna działać. Dokumenty XHTML traktujemy różnie w zależności od ich typu mime (lub rozszerzenia jeśli pliki są ładowane z dysków lokalnych). Pliki, które przechodzą przez code path HTML-a nie wymagają sprawdzenia poprawności składni. Jak zauważysz, nie wszystkie właściwości XHTML-a są wspierane gdy wykonujesz code path HTML-a.

Typ MIME Rozszerzenie pliku Code Path
text/xml
application/xml
application/xhtml+xml
xml
xht
xhtml
XML
text/html html
htm
HTML

Dokument nie musi być w całkości w języku XHTML. Można używać elementów XHTML-a w dowolnym dokumencie XML wykorzystując przestrzeń nazw XHTML. Przykłady można znaleźć w sekcji Testing and QA. Właściwa przestrzeń nazw dla XHTML-a znajduje się na stronie https://www.w3.org/1999/xhtml.

Weź pod uwagę, iż obiekty XHTML-a, takie jak &auml; działają jedynie w dokumentach zgodnych z XHTML-em z prawidłowym Formalnym Identyfikatorem Publicznym (lub innymi słowy, sekcją DOCTYPE z identyfikatorem PUBLIC). Obiekty XHTML-a nie będą działać w dowolnym dokumencie XML, nawet jeśli zostanie użyta przestrzeń nazw XHTML. Publiczne identyfikatory, które są rozpoznawane to:

-//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

Linkowanie i Wskazywanie XML

Wsparcie Linkowania w XML składa się z XML Base (wykorzystywanego jedynie, gdy najedziesz myszką na link lub klikniesz link) oraz prostego XLinks. Możesz także wykorzystywać elementy linkujące z przestrzeni nazw XHTML. Przykłady znajdziesz w sekcji Testing and QA.

For pointing into resources in XML documents Mozilla also supports FIXptr, 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 dom/public/idl/core/nsIDOMXMLDocument.idl interface. There is test case for FIXptr links and a scripting example.

Since 1.4alpha, Mozilla also supports XPointer Framework, XPointer element() scheme, XPointer xmlns() scheme, XPointer fixptr() scheme and XPointer xpath1() scheme. The XPointer processor is extensible and it is easy to implement support for other schemes - have a look at the API. The xpath1() scheme was implemented using this extensible mechanism. There is also a proprietary API from scripts to the XPointer processor. There is a testcase for XPointers that you can also study.

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:

pref("layout.selectanchor", true);

DOM Load and Save Methods

document.load() is a part of an old version of the W3C DOM Level 3 Load & Save module. Mozilla currently implements only the load() method and the async property. Since 1.4alpha it has been possible to load documents synchronously, before that it was only asynchronous. See the load sample 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.)

Outside Supported XML W3C Recommendations

Specification or Technology Documentation Mozilla Project
XSLT W3C Recommendation XSLT
XPath W3C Recommendation XSLT
XMLHttpRequest W3C Draft XML Extras
DOMParser and XMLSerializer Mozilla XML Extras
SAX https://www.saxproject.org/  
SOAP W3C Note Web Services
XML-RPC UserLand Software XML-RPC
RDF W3C Recommendations RDF
SVG W3C Proposed Recommendation SVG
MathML W3C Recommendation MathML
P3P W3C Recommendation P3P
WSDL W3C Note Web Services
XBL Mozilla's XBL reference  
XUL Dokumentacja XUL Mozilli  

Roadmap

Next big tasks would include support for XPointer xpointer() scheme (błąd 32832), XInclude (błąd 201754), XML Catalogs (błąd 98413), XForms (błąd 97806; work being done on implementing this as an extension), validating parser (błąd 196355), XML Schemas, and incremental layout of XML document (błąd 18333).

To fully implement XLink, we need something called a link manager. See some initial design documents.

Testing and QA

We have a lot of testcases linked to from the browser standards compliance QA page.

Most of the core XML test documents on the CVS server are located in content/xml/tests. 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.

There is an XML component in Bugzilla.

We also have the "xhtml" keyword for XHTML bugs (these tend to be scattered across components).

How can I help?

If you can code, look for helpwanted keyword in XML bugs. We don't use that always, so if you want to avoid doing duplicate work you could start working on bugs that have Future milestone, or otherwise have a milestone that is set way into the future.

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; document.load() 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.

Autorzy i etykiety dokumentu

 Autorzy tej strony: Mefiu, VooEak, Bedi
 Ostatnia aktualizacja: Mefiu,