With CSS (Cascading Style Sheets) you can add display information to an XML document.
Displaying your XML Files with CSS?

It is possible to use CSS to format an XML document.

Below is an example of how to use a CSS style sheet to format an XML document:

Take a look at this XML file: The CD catalog

Then look at this style sheet: The CSS file

Finally, view: The CD catalog formatted with the CSS file

Below is a fraction of the XML file. The second line links the XML file to the CSS file:

Empire Burlesque
Bob Dylan

10.90 1985

Hide your heart
Bonnie Tyler
CBS Records

9.90 1988


Formatting XML with CSS is not the most common method.

W3C recommend using XSLT instead. See the next chapter
Dari Wikipedia Indonesia, ensiklopedia bebas berbahasa Indonesia.
Langsung ke: navigasi, cari

Cascading Style Sheets (CSS) adalah suatu bahasa stylesheet yang digunakan untuk mengatur tampilan suatu dokumen yang ditulis dalam bahasa markup. Penggunaan yang paling umum dari CSS adalah untuk memformat halaman web yang ditulis dengan HTML dan XHTML. Walaupun demikian, bahasanya sendiri dapat dipergunakan untuk semua jenis dokumen XML termasuk SVG dan XUL. Spesifikasi CSS diatur oleh World Wide Web Consortium (W3C).

CSS digunakan oleh penulis maupun pembaca halaman web untuk menentukan warna, jenis huruf, tata letak, dan berbagai aspek tampilan dokumen. CSS digunakan terutama untuk memisahkan antara isi dokumen (yang ditulis dengan HTML atau bahasa markup lainnya) dengan presentasi dokumen (yang ditulis dengan CSS). Pemisahan ini dapat meningkatkan aksesibilitas isi, memberikan lebih banyak keleluasaan dan kontrol terhadap tampilan, dan mengurangi kompleksitas serta pengulangan pada stuktur isi.

CSS memungkinkan halaman yang sama untuk ditampilkan dengan cara yang berbeda untuk metode presentasi yang berbeda, seperti melalui layar, cetak, suara (sewaktu dibacakan oleh browser basis-suara atau pembaca layar), dan juga alat pembaca braille. Halaman HTML atau XML yang sama juga dapat ditampilkan secara berbeda, baik dari segi gaya tampilan atau skema warna dengan menggunakan CSS.

[sunting] Pranala luarW3Schools

home HOME

XML Basic
XML Introduction
XML How to use
XML Tree
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Validator
XML Viewing

XML JavaScript
XML Parser
XML HTTP Request
XML Application

XML Advanced
XML Namespaces
XML Encoding
XML Server
XML DOM Advanced
XML Don’t
XML Technologies
XML in Real Life
XML Editors
XML Summary

XML Examples
XML Quiz

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Forum

Helping W3Schools

Displaying XML with XSLT
previous next

With XSLT you can transform an XML document into HTML.
Displaying XML with XSLT

XSLT is the recommended style sheet language of XML.

XSLT (eXtensible Stylesheet Language Transformations) is far more sophisticated than CSS.

One way to use XSLT is to transform XML into HTML before it is displayed by the browser as demonstrated in these examples:

View the XML file, the XSLT style sheet, and View the result.

Below is a fraction of the XML file. The second line links the XML file to the XSLT file:

Belgian Waffles

two of our famous Belgian Waffles

If you want to learn more about XSLT, find our XSLT tutorial on our homepage.
Transforming XML with XSLT on the Server

In the example above, the XSLT transformation is done by the browser, when the browser reads the XML file.

Different browsers may produce different result when transforming XML with XSLT. To reduce this problem the XSLT transformation can be done on the server.

View the result.

Note that the result of the output is exactly the same, either the transformation is done by the web server or by the web browser.
previous next
Altova® XMLSpy® – The world’s best-selling XML editor!

Whether you’re new to XML or already an advanced user, the user-friendly views and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to meet your XML and Web services development needs from start to finish.

* XML editor
* Graphical XML Schema / DTD editors
* XSLT 1.0/2.0 editor, debugger, profiler
* XQuery editor, debugger, profiler
* Support for Office Open XML (OOXML)
* Graphical WSDL editor & SOAP debugger
* Java, C#, C++ code generation
* And much more!

Download a free 30-day trial today!

Click to see a demo!

Learn what’s new in v2008

Get Your Diploma!

W3Schools’ Online Certification Program is the perfect solution for busy professionals who need to balance work, family, and career building.

The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.

The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.

Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2008 by Refsnes Data. All Rights Reserved.
Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999


About W3Schools
W3Schools Forum
Web charting
Web based charting
$15 Domain Name
Save $20 / year!
UK Domain Names
UK Web Hosting
Alojamiento Web
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
Domain Name Registration
PHP MySQL Hosting
Top 10 Web Hosting
Web Hosting Company
UK Reseller Hosting
Web Hosting
Website Templates
Flash Templates
Website Builder
Internet Business Opportunity
Custom Programming
FREE Trial or Demo
Web Content Manager
Forms,Web Alerts,RSS
Ecommerce Software
XMLSpy XML Editor
Azbuz Blog
UK Wholesalers
UK Wholesale
UAE Dubai Property
Private Student Loans
UK Dropshippers & Wholesalers Directory