跳转到内容

XML - 数据交换管理/CSS/答案

来自维基教科书,开放书籍,开放世界

以下是一种方法

为了将外部样式表与 XML 文档连接起来,您需要编写以下代码:
<?xml-stylesheet type="text/css" href="excercise1.css"?>
将其放在文档开头,位于以下代码之下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

如下所示

<?xml version="1.0" encoding="UTF-8"  standalone="yes"?>
<?xml-stylesheet type="text/css" href="exercise1.css"?>
<!DOCTYPE inventory[
  <!ELEMENT inventory (book+)>
  <!ELEMENT book (isbn,title,titel?,author+,publisher,price)>
  <!ELEMENT isbn (#PCDATA)>
  <!ELEMENT title (#PCDATA)>
  <!ELEMENT author (#PCDATA)>
  <!ELEMENT publisher (#PCDATA)>
  <!ELEMENT price (#PCDATA)> 
  <!ENTITY gyl "Gylden, Oslo Norway">    <!-- example of publisher -->
  <!ENTITY sybex "SYBEX Inc. San Francisco California"> <!-- example of publisher -->
]>

<inventory>
 <book>
  <isbn>91-1-300875-7</isbn>
  <title>Here you put in a title</title>
  <author>Here you put in a author</author>
  <publisher>&gyl;</publisher>
  <price>$30</price>
 </book>
 <book> 
  <isbn>91-2-705229-X</isbn>
  <title>Title of second book</title>
  <author>Author of second book </author>
  <publisher>&sybex;</publisher>
  <price>$30</price>
 </book>
</inventory>
华夏公益教科书