如何使用新标记重新定义 xHTML 架构
How to redefine xHTML schema with new markup
我正在尝试使用我自己的 xml 标记和 xHTML 标记。
也许是这样的:
<my:root xmlns:my="myXSD.xsd" xmlns="http://www.w3.org/1999/xhtml">
<html my:name="myName">
</html>
</my:root>
我找到了一个(简单的)例子:
http://www.w3schools.com/schema/el_redefine.asp
但该示例使用 local
文件。
我想使用已经定义的 xHTML 。
所以我把这个简单的例子改为:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
</xs:redefine>
</xs:schema>
然后我得到多个错误:
"can't resolve schemalocation"(当我点击它时我会转到)
文件:xhtml1-strict.xsd
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
为什么会出现此错误?为什么当我转到:“http://www.w3.org/2001/xml.xsd”时看到 HTML 而不是 XSD 文件?
互联网上有关于这个主题的好例子吗?
提前致谢...
"can't resolve schemalocation" Why do i get this error ?
URL 指向文件扩展名为 .xsd
的 HTML 文档。
And why do i see HTML and NOT a XSD file when i goto:"http://www.w3.org/2001/xml.xsd" ?
此文件的来源是HTML。标题解释了它的用途:
<title>Schema document for namespace http://www.w3.org/XML/1998/namespace</title>
W3C 并未在 URL 处托管架构源代码本身,以避免 excessive bandwidth and traffic。
我正在尝试使用我自己的 xml 标记和 xHTML 标记。 也许是这样的:
<my:root xmlns:my="myXSD.xsd" xmlns="http://www.w3.org/1999/xhtml">
<html my:name="myName">
</html>
</my:root>
我找到了一个(简单的)例子: http://www.w3schools.com/schema/el_redefine.asp
但该示例使用 local
文件。
我想使用已经定义的 xHTML 。
所以我把这个简单的例子改为:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
</xs:redefine>
</xs:schema>
然后我得到多个错误:
"can't resolve schemalocation"(当我点击它时我会转到)
文件:xhtml1-strict.xsd
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
为什么会出现此错误?为什么当我转到:“http://www.w3.org/2001/xml.xsd”时看到 HTML 而不是 XSD 文件?
互联网上有关于这个主题的好例子吗?
提前致谢...
"can't resolve schemalocation" Why do i get this error ?
URL 指向文件扩展名为 .xsd
的 HTML 文档。
And why do i see HTML and NOT a XSD file when i goto:"http://www.w3.org/2001/xml.xsd" ?
此文件的来源是HTML。标题解释了它的用途:
<title>Schema document for namespace http://www.w3.org/XML/1998/namespace</title>
W3C 并未在 URL 处托管架构源代码本身,以避免 excessive bandwidth and traffic。