Associating a Stylesheet

The xml-stylesheet processing instruction is used to associate an XML document with a CSS style sheet or with an XSLT stylesheet of the type you saw in earlier chapters.

Tip

Place the xml-stylesheet processing instruction in the prolog of the XML document, in the line immediately after the XML declaration, if you used one.



The general form of the necessary processing instruction is as follows:

<?xml-stylesheet href="CSSStyleSheet.css" type="text/css" ?> 

The second part of the xml-stylesheet processing instruction consists of two pseudoattributes (these aren’t true attributes because they aren’t associated with an element)—the href and type pseudoattributes.

An XML processor can use this information to recognize that there is a CSS file of type text/css, named CSSStyleSheet.css, which is associated with the XML document.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset