Write the procedure to link a style-sheet with an XML document.

Q14. Write the procedure to link a style-sheet with an XML document.

Ans. To link a CSS style-sheet with an XML document, we need to use the PI statement in the XML document.

We need to perform the following steps to link a style-sheet with an XML document:

  1. Create an XML document and save it as a file with the .xml extension.
  2. Create a style-sheet and save it as a file with the .css extension.
  3. Link both the files in the XML document by using the PI, as shown in the following code snippet:

<?xml-stylesheethref=”Name of style-sheet file”  type=”text/css”?>

Leave a Reply

Your email address will not be published. Required fields are marked *