validate-website 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/README +15 -4
  2. data/Rakefile +6 -4
  3. data/bin/validate-website +33 -36
  4. data/lib/colorful_messages.rb +7 -10
  5. data/lib/validator.rb +37 -0
  6. data/lib/xhtml/xframes-1.xsd +166 -0
  7. data/lib/xhtml/xhtml-access-1.xsd +43 -0
  8. data/lib/xhtml/xhtml-applet-1.xsd +66 -0
  9. data/lib/xhtml/xhtml-attribs-1.xsd +67 -0
  10. data/lib/xhtml/xhtml-base-1.xsd +31 -0
  11. data/lib/xhtml/xhtml-basic-form-1.xsd +195 -0
  12. data/lib/xhtml/xhtml-basic-table-1.xsd +169 -0
  13. data/lib/xhtml/xhtml-basic10-model-1.xsd +385 -0
  14. data/lib/xhtml/xhtml-basic10-module-redefines-1.xsd +61 -0
  15. data/lib/xhtml/xhtml-basic10-modules-1.xsd +233 -0
  16. data/lib/xhtml/xhtml-basic10.xsd +99 -0
  17. data/lib/xhtml/xhtml-basic11-model-1.xsd +622 -0
  18. data/lib/xhtml/xhtml-basic11-modules-1.xsd +508 -0
  19. data/lib/xhtml/xhtml-basic11.xsd +105 -0
  20. data/lib/xhtml/xhtml-bdo-1.xsd +72 -0
  21. data/lib/xhtml/xhtml-blkphras-1.xsd +155 -0
  22. data/lib/xhtml/xhtml-blkpres-1.xsd +32 -0
  23. data/lib/xhtml/xhtml-blkstruct-1.xsd +44 -0
  24. data/lib/xhtml/xhtml-charent-1.xsd +38 -0
  25. data/lib/xhtml/xhtml-copyright-1.xsd +29 -0
  26. data/lib/xhtml/xhtml-csismap-1.xsd +91 -0
  27. data/lib/xhtml/xhtml-datatypes-1.xsd +177 -0
  28. data/lib/xhtml/xhtml-edit-1.xsd +34 -0
  29. data/lib/xhtml/xhtml-events-1.xsd +130 -0
  30. data/lib/xhtml/xhtml-form-1.xsd +321 -0
  31. data/lib/xhtml/xhtml-frames-1.xsd +113 -0
  32. data/lib/xhtml/xhtml-framework-1.xsd +62 -0
  33. data/lib/xhtml/xhtml-hypertext-1.xsd +47 -0
  34. data/lib/xhtml/xhtml-iframe-1.xsd +68 -0
  35. data/lib/xhtml/xhtml-image-1.xsd +40 -0
  36. data/lib/xhtml/xhtml-inlphras-1.xsd +158 -0
  37. data/lib/xhtml/xhtml-inlpres-1.xsd +34 -0
  38. data/lib/xhtml/xhtml-inlstruct-1.xsd +45 -0
  39. data/lib/xhtml/xhtml-inlstyle-1.xsd +22 -0
  40. data/lib/xhtml/xhtml-inputmode-1.xsd +35 -0
  41. data/lib/xhtml/xhtml-lat1.ent +196 -0
  42. data/lib/xhtml/xhtml-legacy-1.xsd +97 -0
  43. data/lib/xhtml/xhtml-link-1.xsd +45 -0
  44. data/lib/xhtml/xhtml-list-1.xsd +94 -0
  45. data/lib/xhtml/xhtml-meta-1.xsd +54 -0
  46. data/lib/xhtml/xhtml-metaAttributes-1.xsd +39 -0
  47. data/lib/xhtml/xhtml-misc-1.xsd +441 -0
  48. data/lib/xhtml/xhtml-nameident-1.xsd +63 -0
  49. data/lib/xhtml/xhtml-notations-1.xsd +69 -0
  50. data/lib/xhtml/xhtml-object-1.xsd +71 -0
  51. data/lib/xhtml/xhtml-param-1.xsd +46 -0
  52. data/lib/xhtml/xhtml-pres-1.xsd +46 -0
  53. data/lib/xhtml/xhtml-print-1.xsd +85 -0
  54. data/lib/xhtml/xhtml-print-model-1.xsd +604 -0
  55. data/lib/xhtml/xhtml-print-modules-1.xsd +422 -0
  56. data/lib/xhtml/xhtml-rdfa-1.dtd +438 -0
  57. data/lib/xhtml/xhtml-rdfa-1.xsd +116 -0
  58. data/lib/xhtml/xhtml-rdfa-model-1.xsd +461 -0
  59. data/lib/xhtml/xhtml-rdfa-modules-1.xsd +548 -0
  60. data/lib/xhtml/xhtml-ruby-1.xsd +170 -0
  61. data/lib/xhtml/xhtml-ruby-basic-1.xsd +84 -0
  62. data/lib/xhtml/xhtml-script-1.xsd +65 -0
  63. data/lib/xhtml/xhtml-special.ent +80 -0
  64. data/lib/xhtml/xhtml-ssismap-1.xsd +38 -0
  65. data/lib/xhtml/xhtml-struct-1.xsd +85 -0
  66. data/lib/xhtml/xhtml-style-1.xsd +47 -0
  67. data/lib/xhtml/xhtml-symbol.ent +237 -0
  68. data/lib/xhtml/xhtml-table-1.xsd +267 -0
  69. data/lib/xhtml/xhtml-target-1.xsd +49 -0
  70. data/lib/xhtml/xhtml-text-1.xsd +62 -0
  71. data/lib/xhtml/xhtml1-frameset.dtd +1235 -0
  72. data/lib/xhtml/xhtml1-frameset.xsd +2847 -0
  73. data/lib/xhtml/xhtml1-strict.dtd +978 -0
  74. data/lib/xhtml/xhtml1-strict.xsd +2211 -0
  75. data/lib/xhtml/xhtml1-transitional.dtd +1201 -0
  76. data/lib/xhtml/xhtml1-transitional.xsd +2755 -0
  77. data/lib/xhtml/xhtml11-model-1.xsd +715 -0
  78. data/lib/xhtml/xhtml11-module-redefines-1.xsd +335 -0
  79. data/lib/xhtml/xhtml11-modules-1.xsd +605 -0
  80. data/lib/xhtml/xhtml11.xsd +107 -0
  81. data/lib/xhtml/xhtml2.xsd +21 -0
  82. data/lib/xhtml/xml-events-1.xsd +73 -0
  83. data/lib/xhtml/xml-events-2.xsd +73 -0
  84. data/lib/xhtml/xml-events-attribs-1.xsd +73 -0
  85. data/lib/xhtml/xml-events-attribs-2.xsd +75 -0
  86. data/lib/xhtml/xml-events-copyright-1.xsd +34 -0
  87. data/lib/xhtml/xml-events-copyright-2.xsd +34 -0
  88. data/lib/xhtml/xml-handlers-1.xsd +136 -0
  89. data/lib/xhtml/xml-handlers-2.xsd +98 -0
  90. data/lib/xhtml/xml-script-1.xsd +38 -0
  91. data/lib/xhtml/xml.xsd +286 -0
  92. metadata +114 -8
  93. data/lib/spkspider.rb +0 -147
data/README CHANGED
@@ -2,17 +2,28 @@
2
2
 
3
3
  == DESCRIPTION
4
4
 
5
- Web crawler that print if the page is valid with the dtd.
6
- compatible ruby 1.9
5
+ Web crawler for checking the validity of your documents.
6
+
7
+ == INSTALLATION
8
+
9
+ gem install validate-website --source http://gemcutter.org
7
10
 
8
11
  == SYNOPSIS
9
12
 
10
13
  validate-website --help
11
- validate-website -s "http://localhost:4567/" -u "Mozilla 5.0" -f not-well-formed.txt --auth=user,pass -e 'redirect|news'
14
+ validate-website -s "http://localhost:4567/" -u "Mozilla 5.0" \
15
+ -f not-well-formed.txt --auth=user,pass -e 'redirect|news'
12
16
 
13
17
  == REQUIREMENTS:
14
18
 
15
- libxml-ruby >= 1.1.3
19
+ spk-anemone >= 0.2.4 (forked from chriskite/anemone,
20
+ add auth support and html body)
21
+ rainbow >= 1.0.4 (for console color)
22
+
23
+ == CREDITS:
24
+
25
+ Thanks tenderlove for Nokogiri,
26
+ this library is inspired from markup_validity
16
27
 
17
28
  == LICENSE
18
29
  (The MIT License)
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'find'
7
7
  # Globals
8
8
 
9
9
  PKG_NAME = 'validate-website'
10
- PKG_VERSION = '0.1'
10
+ PKG_VERSION = '0.2'
11
11
 
12
12
  PKG_FILES = ['README', 'Rakefile']
13
13
  Find.find('lib/', 'bin/') do |f|
@@ -54,15 +54,17 @@ spec = Gem::Specification.new do |s|
54
54
  s.author = 'spk'
55
55
  s.email = 'spk@tuxfamily.org'
56
56
  s.platform = Gem::Platform::RUBY
57
- s.summary = "Web crawler for testing webpage validity"
57
+ s.summary = 'Web crawler for checking the validity of your documents'
58
58
  s.name = PKG_NAME
59
59
  s.version = PKG_VERSION
60
- s.requirements << 'libxml-ruby'
60
+ s.requirements << 'spk-anemone' << 'rainbow'
61
+ s.add_dependency('spk-anemone', '>= 0.2.4')
62
+ s.add_dependency('rainbow', '>= 1.0.4')
61
63
  s.require_path = 'lib'
62
64
  s.bindir = 'bin'
63
65
  s.executables << 'validate-website'
64
66
  s.files = PKG_FILES
65
- s.description = "Web crawler that print if the page is valid with the dtd"
67
+ s.description = 'Web crawler for checking the validity of your documents'
66
68
  end
67
69
 
68
70
  Rake::GemPackageTask.new(spec) do |pkg|
data/bin/validate-website CHANGED
@@ -1,20 +1,21 @@
1
1
  #!/usr/bin/env ruby
2
- $:.unshift '../lib'
3
- require 'spkspider'
2
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ developer_mode = false
5
+ developer_mode = true if __FILE__ == $0
6
+ require 'rubygems' if developer_mode
7
+
8
+ require 'validator'
9
+ require 'anemone'
4
10
  require 'colorful_messages'
5
- require 'open-uri'
6
- require 'xml'
7
11
  require 'optparse'
8
12
 
9
13
  include ColorfulMessages
10
14
 
11
- XML.default_validity_checking = true
12
- XML.default_load_external_dtd = true
13
-
14
15
  # default options
15
16
  OPTIONS = {
16
17
  :site => 'http://localhost:3000/',
17
- :useragent => '',
18
+ :useragent => Anemone::Core::DEFAULT_OPTS[:user_agent],
18
19
  :exclude => nil,
19
20
  :file => nil,
20
21
  :auth => nil,
@@ -24,54 +25,50 @@ ARGV.options do |o|
24
25
  script_name = File.basename($0)
25
26
  o.set_summary_indent(' ')
26
27
  o.banner = "Usage: #{script_name} [OPTIONS]"
27
- o.define_head "validate website"
28
+ o.define_head "#{script_name} - Web crawler for checking the validity of " +
29
+ 'your documents'
28
30
  o.separator ""
29
31
 
30
32
  o.on("-s", "--site=val", String,
31
- "Default: #{OPTIONS[:site]}") { |OPTIONS[:site]| }
33
+ "Default: #{OPTIONS[:site]}") { |v| OPTIONS[:site] = v }
34
+
32
35
  o.on("-u", "--useragent=val", String,
33
- "Default: #{OPTIONS[:useragent]}") { |OPTIONS[:useragent]| }
36
+ "Default: #{OPTIONS[:useragent]}") { |v| OPTIONS[:useragent] = v }
34
37
  o.on("-e", "--exclude=val", String,
35
- "Url to exclude") { |OPTIONS[:exclude]| }
38
+ "Url to exclude") { |v| OPTIONS[:exclude] = v }
36
39
  o.on("-f", "--file=val", String,
37
- "save not well formed urls") { |OPTIONS[:file]| }
40
+ "save not well formed urls") { |v| OPTIONS[:file] = v }
38
41
  o.on("--auth=[user,pass]", Array,
39
- "Basic http authentification") { |OPTIONS[:auth]| }
42
+ "Basic http authentification") { |v| OPTIONS[:auth] = v }
40
43
 
41
44
  o.separator ""
42
45
  o.on_tail("-h", "--help", "Show this help message.") { puts o; exit }
43
46
  o.parse!
44
47
  end
45
48
 
46
- spider = SpkSpider.new(OPTIONS[:site])
47
- spider.user_agent = OPTIONS[:useragent]
48
- spider.exclude = Regexp.new(OPTIONS[:exclude]) if OPTIONS[:exclude]
49
- spider.basic_auth = OPTIONS[:auth]
50
-
51
49
  if OPTIONS[:file]
52
50
  file = OPTIONS[:file]
53
51
  open(file, 'w').write('')
54
52
  end
55
53
 
56
- spider.crawl do |url, document|
57
- begin
58
- xp = XML::Parser.string(document)
59
- exception = nil
60
- XML::Error.set_handler do |error|
61
- exception = error
62
- end
54
+ Anemone.crawl(OPTIONS[:site],
55
+ :user_agent => OPTIONS[:useragent],
56
+ :authorization => OPTIONS[:auth]) do |anemone|
57
+
58
+ anemone.skip_links_like Regexp.new(OPTIONS[:exclude]) if OPTIONS[:exclude]
63
59
 
64
- doc = xp.parse
60
+ anemone.on_every_page { |page|
61
+ next unless page.html?
62
+ url = page.url.to_s
63
+ print info(url)
65
64
 
66
- msg = " well formed? %s" % xp.context.well_formed?
67
- if xp.context.well_formed?
68
- print success(msg)
65
+ validator = Validator.new(page)
66
+ msg = " well formed? %s" % validator.valid?
67
+ if validator.valid?
68
+ puts success(msg)
69
69
  else
70
- print error(msg)
71
- open(file, 'a').write(url+"\n") if OPTIONS[:file]
70
+ puts error(msg)
71
+ open(file, 'a').write("#{url}\n") if OPTIONS[:file]
72
72
  end
73
- rescue
74
- print error(msg)
75
- open(file, 'a').write(url+"\n") if OPTIONS[:file]
76
- end
73
+ }
77
74
  end
@@ -1,30 +1,27 @@
1
+ require 'rainbow'
2
+
1
3
  module ColorfulMessages
2
4
 
3
- # red
4
5
  def error(message)
5
- "\033[1;31m#{message}\033[0m"
6
+ message.to_s.foreground(:red)
6
7
  end
7
8
 
8
- # yellow
9
9
  def warning(message)
10
- "\033[1;33m#{message}\033[0m"
10
+ message.to_s.foreground(:yellow)
11
11
  end
12
12
 
13
- # green
14
13
  def success(message)
15
- "\033[1;32m#{message}\033[0m"
14
+ message.to_s.foreground(:green)
16
15
  end
17
16
 
18
17
  alias_method :message, :success
19
18
 
20
- # magenta
21
19
  def note(message)
22
- "\033[1;35m#{message}\033[0m"
20
+ message.to_s.foreground(:magenta)
23
21
  end
24
22
 
25
- # blue
26
23
  def info(message)
27
- "\033[1;34m#{message}\033[0m"
24
+ message.to_s.foreground(:blue)
28
25
  end
29
26
 
30
27
  end
data/lib/validator.rb ADDED
@@ -0,0 +1,37 @@
1
+ class Validator
2
+ XHTML_PATH = File.join(File.dirname(__FILE__), '..', 'lib', 'xhtml')
3
+
4
+ attr_accessor :page
5
+ attr_accessor :dtd
6
+ attr_accessor :namespace
7
+ attr_accessor :xsd
8
+ attr_accessor :errors
9
+
10
+ def initialize(page)
11
+ @page = page
12
+ if @page.doc.internal_subset.system_id
13
+ @dtd = URI.parse(@page.doc.internal_subset.system_id)
14
+ # http://www.w3.org/TR/xhtml1/#dtds
15
+ @namespace = File.basename(@dtd.path, '.dtd')
16
+ fixed_dtd = @page.body.sub(@dtd.to_s, @namespace + '.dtd')
17
+ doc = Dir.chdir(XHTML_PATH) do
18
+ Nokogiri::XML(fixed_dtd) { |cfg|
19
+ cfg.noent.dtdload.dtdvalid
20
+ }
21
+ end
22
+ # http://www.w3.org/TR/xhtml1-schema/
23
+ @xsd = Dir.chdir(XHTML_PATH) do
24
+ if File.exists?(@namespace + '.xsd')
25
+ Nokogiri::XML::Schema(File.read(@namespace + '.xsd'))
26
+ end
27
+ end
28
+ @errors = @xsd ? @xsd.validate(doc) : ["Don't have this xsd"]
29
+ else
30
+ @errors = ['No DTD set !']
31
+ end
32
+ end
33
+
34
+ def valid?
35
+ @errors.length == 0
36
+ end
37
+ end
@@ -0,0 +1,166 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ targetNamespace="http://www.w3.org/2002/06/xframes/"
5
+ xmlns="http://www.w3.org/2002/06/xframes/"
6
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
7
+ elementFormDefault="qualified">
8
+
9
+ <xs:annotation>
10
+ <xs:documentation xml:lang="en">
11
+ This is XFrames - an XML application for composing documents together.
12
+ URI: http://www.w3.org/MarkUp/SCHEMA/xframes-1.xsd
13
+
14
+ Copyright ©2002-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
15
+
16
+ Editor: Masayasu Ishikawa (mimasa@w3.org)
17
+ Revision: $Id: xframes-1.xsd,v 1.9 2005/10/05 23:56:45 mimasa Exp $
18
+
19
+ Permission to use, copy, modify and distribute this XML Schema for
20
+ XFrames and its accompanying documentation for any purpose and without
21
+ fee is hereby granted in perpetuity, provided that the above copyright
22
+ notice and this paragraph appear in all copies. The copyright holders
23
+ make no representation about the suitability of this XML Schema
24
+ for any purpose.
25
+
26
+ It is provided "as is" without expressed or implied warranty.
27
+ </xs:documentation>
28
+ </xs:annotation>
29
+
30
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace"
31
+ schemaLocation="http://www.w3.org/2001/xml.xsd">
32
+ <xs:annotation>
33
+ <xs:documentation xml:lang="en">
34
+ Get access to the XML namespace
35
+ </xs:documentation>
36
+ </xs:annotation>
37
+ </xs:import>
38
+
39
+ <xs:annotation>
40
+ <xs:documentation xml:lang="en">
41
+ Datatypes
42
+ </xs:documentation>
43
+ </xs:annotation>
44
+
45
+ <xs:simpleType name="ContentType.datatype">
46
+ <xs:annotation>
47
+ <xs:documentation xml:lang="en">
48
+ media type, as per [RFC2045]
49
+ </xs:documentation>
50
+ </xs:annotation>
51
+ <xs:restriction base="xs:string"/>
52
+ </xs:simpleType>
53
+
54
+ <xs:simpleType name="MediaDesc.datatype">
55
+ <xs:annotation>
56
+ <xs:documentation>
57
+ A comma-separated list of media descriptors as described by [CSS2].
58
+ The default is all.
59
+ </xs:documentation>
60
+ </xs:annotation>
61
+ <xs:restriction base="xs:string">
62
+ <xs:pattern value="[^,]+(,\s*[^,]+)*"/>
63
+ </xs:restriction>
64
+ </xs:simpleType>
65
+
66
+ <xs:simpleType name="QName.datatype">
67
+ <xs:annotation>
68
+ <xs:documentation>
69
+ An [XMLNS]-qualified name.
70
+ </xs:documentation>
71
+ </xs:annotation>
72
+ <xs:restriction base="xs:QName"/>
73
+ </xs:simpleType>
74
+
75
+ <xs:simpleType name="URI.datatype">
76
+ <xs:annotation>
77
+ <xs:documentation xml:lang="en">
78
+ An Internationalized Resource Identifier Reference, as defined
79
+ by [IRI].
80
+ </xs:documentation>
81
+ </xs:annotation>
82
+ <xs:restriction base="xs:anyURI"/>
83
+ </xs:simpleType>
84
+
85
+ <xs:attributeGroup name="Common.attrib">
86
+ <xs:annotation>
87
+ <xs:documentation xml:lang="en">
88
+ Common attributes
89
+ </xs:documentation>
90
+ </xs:annotation>
91
+ <xs:attribute name="class" type="xs:NMTOKENS"/>
92
+ <xs:attribute ref="xml:id"/>
93
+ <xs:attribute name="title" type="xs:string"/>
94
+ </xs:attributeGroup>
95
+
96
+ <xs:element name="frames">
97
+ <xs:complexType>
98
+ <xs:sequence>
99
+ <xs:element minOccurs="0" maxOccurs="1" ref="head"/>
100
+ <xs:choice>
101
+ <xs:element ref="group"/>
102
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="frame"/>
103
+ </xs:choice>
104
+ </xs:sequence>
105
+ <xs:attributeGroup ref="Common.attrib"/>
106
+ <xs:attribute ref="xml:base"/>
107
+ </xs:complexType>
108
+ </xs:element>
109
+
110
+ <xs:element name="head">
111
+ <xs:complexType>
112
+ <xs:sequence>
113
+ <xs:element ref="title"/>
114
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="style"/>
115
+ </xs:sequence>
116
+ <xs:attributeGroup ref="Common.attrib"/>
117
+ </xs:complexType>
118
+ </xs:element>
119
+
120
+ <xs:element name="title">
121
+ <xs:complexType mixed="true">
122
+ <xs:attributeGroup ref="Common.attrib"/>
123
+ </xs:complexType>
124
+ </xs:element>
125
+
126
+ <xs:element name="style">
127
+ <xs:complexType mixed="true">
128
+ <xs:attributeGroup ref="Common.attrib"/>
129
+ <xs:attribute name="type" type="ContentType.datatype" use="required"/>
130
+ <xs:attribute name="media" type="MediaDesc.datatype"/>
131
+ <xs:attribute name="source" type="URI.datatype"/>
132
+ </xs:complexType>
133
+ </xs:element>
134
+
135
+ <xs:element name="group">
136
+ <xs:complexType>
137
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
138
+ <xs:element ref="group"/>
139
+ <xs:element ref="frame"/>
140
+ </xs:choice>
141
+ <xs:attributeGroup ref="Common.attrib"/>
142
+ <xs:attribute name="compose" default="vertical">
143
+ <xs:simpleType>
144
+ <xs:union memberTypes="QName.datatype">
145
+ <xs:simpleType>
146
+ <xs:restriction base="xs:token">
147
+ <xs:enumeration value="vertical"/>
148
+ <xs:enumeration value="horizontal"/>
149
+ <xs:enumeration value="single"/>
150
+ <xs:enumeration value="free"/>
151
+ </xs:restriction>
152
+ </xs:simpleType>
153
+ </xs:union>
154
+ </xs:simpleType>
155
+ </xs:attribute>
156
+ </xs:complexType>
157
+ </xs:element>
158
+
159
+ <xs:element name="frame">
160
+ <xs:complexType>
161
+ <xs:attributeGroup ref="Common.attrib"/>
162
+ <xs:attribute name="source" type="URI.datatype"/>
163
+ </xs:complexType>
164
+ </xs:element>
165
+
166
+ </xs:schema>
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ elementFormDefault="qualified"
5
+ xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/"
6
+ >
7
+ <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/"
8
+ schemaLocation="xhtml-datatypes-1.xsd" />
9
+
10
+ <xs:annotation>
11
+ <xs:documentation>
12
+ This is the XML Schema module for XHTML Access
13
+ $Id: xhtml-access-1.xsd,v 1.1 2008/05/17 16:21:57 smccarro Exp $
14
+ </xs:documentation>
15
+ <xs:documentation source="xhtml-copyright-1.xsd"/>
16
+ <xs:documentation source="http://www.w3.org/TR/xhtml-role#A_role"/>
17
+ </xs:annotation>
18
+ <xs:attributeGroup name="xhtml.access.attlist">
19
+ <xs:attributeGroup ref="xhtml.Common.attrib"/>
20
+ <xs:attribute name="activate" default="no">
21
+ <xs:simpleType>
22
+ <xs:restriction base="xs:NMTOKEN">
23
+ <xs:enumeration value="yes"/>
24
+ <xs:enumeration value="no"/>
25
+ </xs:restriction>
26
+ </xs:simpleType>
27
+ </xs:attribute>
28
+ <xs:attribute name="key" type="xh11d:Character"/>
29
+ <xs:attribute name="targetid">
30
+ <xs:simpleType>
31
+ <xs:list itemType="xs:IDREF"/>
32
+ </xs:simpleType>
33
+ </xs:attribute>
34
+ <xs:attribute name="targetrole" type="xh11d:CURIEs"/>
35
+ </xs:attributeGroup>
36
+ <xs:group name="xhtml.access.content">
37
+ <xs:sequence/>
38
+ </xs:group>
39
+ <xs:complexType name="xhtml.access.type">
40
+ <xs:group ref="xhtml.access.content"/>
41
+ <xs:attributeGroup ref="xhtml.access.attlist"/>
42
+ </xs:complexType>
43
+ </xs:schema>
@@ -0,0 +1,66 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ elementFormDefault="qualified"
5
+ xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/"
6
+ >
7
+ <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" schemaLocation="xhtml-datatypes-1.xsd" />
8
+
9
+ <xs:annotation>
10
+ <xs:documentation>
11
+ Java Applets
12
+ This is the XML Schema module for Java Applets in XHTML
13
+
14
+ * applet (param)
15
+
16
+ This module declares the applet element type and its attributes,
17
+ used to provide support for Java applets. The 'alt' attribute
18
+ is now required (as it is on images). One of either code or
19
+ object attributes must be present. In the document, place param
20
+ elements before the object elements that require their content.
21
+
22
+ Note that use of this module also instantiates of the
23
+ Param Element Module.
24
+
25
+ $Id: xhtml-applet-1.xsd,v 1.3 2005/09/26 22:54:52 ahby Exp $
26
+ </xs:documentation>
27
+ <xs:documentation source="xhtml-copyright-1.xsd"/>
28
+ <xs:documentation
29
+ source="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/abstract_modules.html#s_appletmodule"/>
30
+ </xs:annotation>
31
+
32
+ <xs:include schemaLocation="xhtml-param-1.xsd">
33
+ <xs:annotation>
34
+ <xs:documentation>
35
+ Param module
36
+ Include Param Module
37
+ </xs:documentation>
38
+ </xs:annotation>
39
+ </xs:include>
40
+
41
+ <xs:attributeGroup name="xhtml.applet.attlist">
42
+ <xs:attributeGroup ref="xhtml.Core.attrib"/>
43
+ <xs:attribute name="alt" type="xh11d:Text" use="required"/>
44
+ <xs:attribute name="archive" type="xh11d:CDATA"/>
45
+ <xs:attribute name="code" type="xh11d:CDATA"/>
46
+ <xs:attribute name="codebase" type="xh11d:URI"/>
47
+ <xs:attribute name="object" type="xh11d:CDATA"/>
48
+ <xs:attribute name="width" type="xh11d:Length" use="required"/>
49
+ <xs:attribute name="height" type="xh11d:Length" use="required"/>
50
+ </xs:attributeGroup>
51
+
52
+ <xs:group name="xhtml.applet.content">
53
+ <xs:sequence>
54
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
55
+ <xs:element ref="param" />
56
+ <xs:group ref="xhtml.Flow.mix"/>
57
+ </xs:choice>
58
+ </xs:sequence>
59
+ </xs:group>
60
+
61
+ <xs:complexType name="xhtml.applet.type" mixed="true">
62
+ <xs:group ref="xhtml.applet.content"/>
63
+ <xs:attributeGroup ref="xhtml.applet.attlist"/>
64
+ </xs:complexType>
65
+
66
+ </xs:schema>
@@ -0,0 +1,67 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/">
3
+ <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" schemaLocation="xhtml-datatypes-1.xsd"/>
4
+
5
+ <xs:annotation>
6
+ <xs:documentation>
7
+ This is the XML Schema common attributes module for XHTML
8
+ $Id: xhtml-attribs-1.xsd,v 1.7 2008/07/05 04:11:00 ahby Exp $
9
+ </xs:documentation>
10
+ <xs:documentation source="xhtml-copyright-1.xsd"/>
11
+ <xs:documentation source="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_commonatts"/>
12
+ </xs:annotation>
13
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
14
+ <xs:annotation>
15
+ <xs:documentation>
16
+ This import brings in the XML namespace attributes
17
+ The module itself does not provide the schemaLocation
18
+ and expects the driver schema to provide the
19
+ actual SchemaLocation.
20
+ </xs:documentation>
21
+ </xs:annotation>
22
+ </xs:import>
23
+ <xs:attributeGroup name="xhtml.id">
24
+ <xs:attribute name="id" type="xs:ID"/>
25
+ </xs:attributeGroup>
26
+ <xs:attributeGroup name="xhtml.class">
27
+ <xs:attribute name="class" type="xs:NMTOKENS"/>
28
+ </xs:attributeGroup>
29
+ <xs:attributeGroup name="xhtml.title">
30
+ <xs:attribute name="title" type="xs:string"/>
31
+ </xs:attributeGroup>
32
+ <xs:attributeGroup name="xhtml.Core.attrib">
33
+ <xs:attribute ref="xml:space"/>
34
+ <xs:attributeGroup ref="xhtml.id"/>
35
+ <xs:attributeGroup ref="xhtml.class"/>
36
+ <xs:attributeGroup ref="xhtml.title"/>
37
+ <xs:attributeGroup ref="xhtml.Core.extra.attrib"/>
38
+ </xs:attributeGroup>
39
+ <xs:attributeGroup name="xhtml.I18n.attrib">
40
+ <xs:attribute ref="xml:lang"/>
41
+ <xs:attributeGroup ref="xhtml.I18n.extra.attrib"/>
42
+ </xs:attributeGroup>
43
+ <xs:attributeGroup name="xhtml.Common.attrib">
44
+ <xs:attributeGroup ref="xhtml.Core.attrib"/>
45
+ <xs:attributeGroup ref="xhtml.I18n.attrib"/>
46
+ <xs:attributeGroup ref="xhtml.Common.extra"/>
47
+ </xs:attributeGroup>
48
+ <!-- Global attributes -->
49
+ <xs:attribute name="id" type="xs:ID"/>
50
+ <xs:attribute name="class" type="xs:NMTOKENS"/>
51
+ <xs:attribute name="title" type="xs:string"/>
52
+ <xs:attributeGroup name="xhtml.Global.core.attrib">
53
+ <xs:attribute ref="id"/>
54
+ <xs:attribute ref="class"/>
55
+ <xs:attribute ref="title"/>
56
+ <xs:attributeGroup ref="xhtml.Global.core.extra.attrib"/>
57
+ </xs:attributeGroup>
58
+ <xs:attributeGroup name="xhtml.Global.i18n.attrib">
59
+ <xs:attribute ref="xml:lang"/>
60
+ <xs:attributeGroup ref="xhtml.Global.I18n.extra.attrib"/>
61
+ </xs:attributeGroup>
62
+ <xs:attributeGroup name="xhtml.Global.common.attrib">
63
+ <xs:attributeGroup ref="xhtml.Global.core.attrib"/>
64
+ <xs:attributeGroup ref="xhtml.Global.i18n.attrib"/>
65
+ <xs:attributeGroup ref="xhtml.Global.Common.extra"/>
66
+ </xs:attributeGroup>
67
+ </xs:schema>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/">
3
+ <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" schemaLocation="xhtml-datatypes-1.xsd"/>
4
+
5
+ <xs:annotation>
6
+ <xs:documentation>
7
+ Base element
8
+ This is the XML Schema Base Element module for XHTML
9
+
10
+ * base
11
+
12
+ This module declares the base element type and its attributes,
13
+ used to define a base URI against which relative URIs in the
14
+ document will be resolved.
15
+
16
+ $Id: xhtml-base-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $
17
+ </xs:documentation>
18
+ <xs:documentation source="xhtml-copyright-1.xsd"/>
19
+ <xs:documentation source="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/abstract_modules.html#s_basemodule"/>
20
+ </xs:annotation>
21
+ <xs:attributeGroup name="xhtml.base.attlist">
22
+ <xs:attribute name="href" type="xh11d:URI" use="required"/>
23
+ </xs:attributeGroup>
24
+ <xs:group name="xhtml.base.content">
25
+ <xs:sequence/>
26
+ </xs:group>
27
+ <xs:complexType name="xhtml.base.type">
28
+ <xs:group ref="xhtml.base.content"/>
29
+ <xs:attributeGroup ref="xhtml.base.attlist"/>
30
+ </xs:complexType>
31
+ </xs:schema>