Where is the W3C XML Schema for XHTML 1.1?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:50:02

问题


There is an old W3C recommendation containing an XML schema for XHTML 1.0, and claiming that schema for 1.1 will be forthcoming. Where is the a W3C XML Schema for XHTML 1.1?


回答1:


Here's the official hosted version:

http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd




回答2:


Edit: XHTML 1.1 XML Schema Definition

http://www.w3.org/TR/2009/PER-xhtml11-20090507/xhtml11_schema.html




回答3:


The XML schema (XSD) for XHTML 1.1 is modularized into multiple files, thus, for validating you need following files available in a local directory:

http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml11-model-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml11-modules-1.xsd

With those files (and network access) you can validate a XHTML 1.1 file like this:

$ xmllint -noout -schema xhtml11.xsd foo.xml

Without network access you also need following files:

http://www.w3.org/2001/xml.xsd
http://www.w3.org/2009/01/xml.xsd # -> xml_2009_01.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-attribs-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-base-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-bdo-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-blkphras-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-blkpres-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-blkstruct-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-charent-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-csismap-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-datatypes-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-datatypes-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-edit-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-events-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-form-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-framework-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-hypertext-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-image-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-inlphras-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-inlpres-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-inlstruct-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-inlstyle-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-link-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-list-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-meta-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-notations-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-object-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-param-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-param-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-pres-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-ruby-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-script-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-ssismap-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-struct-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-style-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-table-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-target-1.xsd
http://www.w3.org/MarkUp/SCHEMA/xhtml-text-1.xsd

Then adjust the schema locations with something like:

$ sed -i 's@schemaLocation="http://www.w3.org/2009/01/xml.xsd"@schemaLocation="xml_2009_01.xsd"@' *.xsd
$ sed -i 's@schemaLocation="[^"]\+/\([^"]\+\)"@schemaLocation="\1"@' *.xsd

With the resulting files you can locally validate a XHTML 1.1 file like this:

$ xmllint -noout -schema xhtml11.xsd -nonet foo.xml

For browsing, there is the XHTML 1.1 XML Schema Defintion appendix that contains the modules inline.



来源:https://stackoverflow.com/questions/3470473/where-is-the-w3c-xml-schema-for-xhtml-1-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!