XML a služby WWW

V dnešním stále více se propojujícím světě potřebuje stále více a více aplikací poskytovat podporu pro různé služby WWW. Někdy služby WWW jen přidávají nějakou funkcionalitu navíc, jindy jsou klíčové pro celou palikaci. Dokonce i aplikace, které po dlouhá léta fungovaly samostatně, našly nová inovativní použití služeb WWW.

Platforma GNOME poskytuje podporu pro použití služeb WWW ve vašich aplikacích a stejně tak kompletní knihovny pro zpracování, správu a transformaci XML, jazyk WWW.

4.5.1. SOAP

With the libsoup library, GNOME provides support for the SOAP, a widely-used protocol for passing XML messages over HTTP. SOAP allows developers to expose an interface over the web, which can then be used by applications to retrieve information, send data, make transactions, or use any number of other services provided.

SOAP can be used to search and retrieve information, to interact with an online store, to manage users' accounts on other systems, or for many other purposes. Web services are being used more and more to provide essential functionality for users, and applications using SOAP can provide a more integrated and featureful user experience.

The libsoup library contains an HTTP implementation and a set of API for constructing and consuming SOAP messages. It also allows for secure authentication, so you can use web services to access private accounts over a secure connection. Using libsoup makes it easy to use web services without manually parsing and interpreting the messages sent through SOAP.

Více informací o libsoup popisuje stránka libsoup Reference Manual.

4.5.2. XML Processing

Since its formal introduction in 1998, XML (eXtensible Markup Langauge) has been used in increasingly more applications. It is used for a wide variety of purposes, from document formats like XHMTL and DocBook to internet protocols like SOAP and Jabber. XML provides a clean and simple base syntax, allowing applications to focus on their particular needs.

GNOME ships with the libxml2 library, and uses it extensively throughout the desktop. The libxml2 library is a fast and fully standards-compliant XML processing library, providing everything you need to use XML in your application.

The libxml2 library provides a number of different APIs for working with XML, so you can use whatever best suits your application development needs. In addition to a native tree API, libxml2 also provides the callback-based SAX2 API, streaming XML reader and writer interfaces, and complete support for XPath.

In addition to DTD support, libxml2 also provides full support for validing documents using RELAX NG, which allows a more flexible validation model while remaining simple to use. There is also partial support for XML Schema, the new schema language produced by W3C.

You should use libxml2 whenever you need to work directly with XML in your application. Using libxml2 ensures that you have fully standards-compliant parsing, processing, and XML output. This means developers can stop worrying about incompatibilities between applications.

For more information on libxml2, see The Libxml Tutorial and The Reference Manual for libxml2.

4.5.3. Transforming XML with XSLT

XSLT is an XML-based language for transforming XML into other formats. XSLT is a template-based language, allowing you to match particular types of XML elements and create output accordingly. Based on XML and XPath, XSLT enables developers to create clean and modularized templates to convert an XML dialect into another format more suitable for the application.

GNOME ships with the libxslt library, a complete implementation of XSLT. The libxslt library is built on top of the XML and XPath support in libxml2, allowing it to be fast and fully standards-compliant.

You should use libxslt if you need to transform XML documents. Although XSLT is not always the right solution for XML processing, it can often simplify development. Since libxslt allows you to add extension elements and extension functions, you can customize it to fit your application.

Další informace o libxslt obsahuje referenční příručka The XSLT C library for Gnome.