Html 链接XSL和XML文件
我正在尝试链接这两个文件,以便显示代码(@name和callNo)中已有的属性和元素。由于某些原因,即使我检查了文件拼写和所有内容,这些文件也没有链接。如果我尝试运行XSL文件,页面将不会显示我试图检索的属性/元素。顺便说一下,据我所知没有错误 问题2.xml:Html 链接XSL和XML文件,html,xml,xslt,Html,Xml,Xslt,我正在尝试链接这两个文件,以便显示代码(@name和callNo)中已有的属性和元素。由于某些原因,即使我检查了文件拼写和所有内容,这些文件也没有链接。如果我尝试运行XSL文件,页面将不会显示我试图检索的属性/元素。顺便说一下,据我所知没有错误 问题2.xml: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="Question2.xsl"?> <!DOCTYP
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Question2.xsl"?>
<!DOCTYPE patron [
<!ELEMENT patron (item*)>
<!ATTLIST patron name CDATA #REQUIRED>
<!ELEMENT item (title,authors,callNo,due)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT authors (#PCDATA)>
<!ELEMENT callNo (#PCDATA)>
<!ELEMENT due (#PCDATA)>
]>
<patron name="John Smith">
<item>
<title>Wireless network security</title>
<authors>T. Wrightson</authors>
<callNo>212.12/56</callNo>
<due>25-12-2016</due>
</item>
<item>
<title>Analysis</title>
<authors>T. Tao</authors>
<callNo>515/305</callNo>
<due>23-12-2016</due>
</item>
<item>
<title>The art of computer programming</title>
<authors>D.E. Knuth</authors>
<callNo>005.1/300</callNo>
<due>25-11-2016</due>
</item>
<item>
<title>Python for dummies</title>
<authors>S. Maruch and A. Ranum</authors>
<callNo>145.3/157</callNo>
<due>01-10-2016</due>
</item>
</patron>
]>
无线网络安全
T.莱特森
212.12/56
25-12-2016
分析
陶哲轩
515/305
23-12-2016
计算机编程的艺术
D.E.克努斯
005.1/300
25-11-2016
傻瓜巨蟒
S.Maruch和A.Ranum
145.3/157
01-10-2016
问题2.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
<xsl:template match="/patron">
<html>
<head>
<title>Question2</title>
</head>
<body>
<h1>
<xsl:text>Patron record:</xsl:text>
<xsl:value-of select="@name" />
</h1>
<font size="6" color="green">
<xsl:value-of select="callNo" />
</font>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
问题2
用户记录:
检查此代码:-
<xsl:value-of select="callNo" />
to
<xsl:value-of select="item/callNo" />
到
为什么要复制您的问题?你问了一个问题。我不确定我是否还能在那里得到答案。不幸的是,你的行为违反了StackOverflow的规则。我不知道你问题的答案,但也许会对你有所帮助。我删除了另一个。链接对你有帮助吗?