[Mono-docs-list] xml schema validator for ecma provider docs
John Luke
John Luke <john.luke@gmail.com>
Tue, 24 Aug 2004 23:20:10 -0400
------=_Part_52_6712975.1093404010041
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello,
I wrote a little validator for the ecma-provider style docs using xsd.
I am not quite finished perfecting the schema, so there are surely
some bugs in it. But it should work for checking Gtk# docs before
committing, and it helped me find several typos and other
non-displaying parts of the docs. It cannot quite make it through
monodoc/class as they have some elements not found in the Gtk# docs.
Currently you can use it like this (after applying the patch):
monodoc --validate <provider> <files_or_dir>
ex. monodoc --validate ecma gtk-sharp/doc
Eventually, additional schemas could be made for the other formats as well.
For completeness sake, I am aware of the old valdoc but it uses
relaxng and the older format, and I was in the process of learning
xsd.
Last, it could be interesting for editing to use some sort of
validation, but I have not looked into that or if validating fragments
are possible.
------=_Part_52_6712975.1093404010041
Content-Type: text/x-patch; name="validate.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="validate.patch"
Index: monodoc.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/monodoc/monodoc.in,v
retrieving revision 1.12
diff -u -r1.12 monodoc.in
--- monodoc.in=093 Jun 2004 11:08:14 -0000=091.12
+++ monodoc.in=0925 Aug 2004 01:59:56 -0000
@@ -28,6 +28,10 @@
=09shift;
=09exec mono $monodocdir/updater.exe "$@"
=09;;
+ x--validate)
+ shift;
+ exec mono $monodocdir/validate.exe "$@"
+ ;;
x--help)
=09echo "Usage is:"
=09echo "monodoc [options]"
@@ -41,6 +45,7 @@
=09echo " --make-index=09=09create the index"
=09echo " --merge-changes CHANGE_FILE [TARGET_DIR]"
=09echo " --normalize=09=09format a documentation file consistently"
+=09echo " --validate=09=09validate the xml file(s)"
=09echo " TOPIC=09=09=09display the browser at TOPIC (ex. N:System)"
=09exit 0
=09;;
Index: browser/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/monodoc/browser/Makefile.am,v
retrieving revision 1.63
diff -u -r1.63 Makefile.am
--- browser/Makefile.am=093 Aug 2004 04:24:00 -0000=091.63
+++ browser/Makefile.am=0925 Aug 2004 01:59:56 -0000
@@ -1,7 +1,7 @@
assemblydir =3D $(libdir)
-monodoc_DATA =3D browser.exe assembler.exe normalize.exe monodoc.xml mod.e=
xe
+monodoc_DATA =3D browser.exe assembler.exe normalize.exe monodoc.xml mod.e=
xe validate.exe
noinst_DATA =3D monodoc.dll monodoc.dll.config
-CLEANFILES =3D monodoc.dll assembler.exe browser.exe normalize.exe mod.exe
+CLEANFILES =3D monodoc.dll assembler.exe browser.exe normalize.exe mod.exe=
validate.exe
DISTCLEANFILE =3D AssemblyInfo.cs
CSC=3Dmcs
=20
@@ -42,17 +42,21 @@
=09$(srcdir)/admin.cs=09=09\
=09$(srcdir)/Contributions.cs
=20
+validate_sources =3D \
+=09$(srcdir)/validate.cs
+
browser_assemblies =3D -pkg:gtkhtml-sharp -pkg:glade-sharp -r:System.Web.S=
ervices
=20
EXTRA_DIST =3D \
=09$(monodoc_sources) $(assembler_sources) \
=09$(dump_sources) $(browser_sources) =09\
+=09$(validate_sources)=09=09=09\
=09browser.glade monodoc.xml mono-ecma.xsl=09\
=09normalize.cs monodoc.dll.config.in=09\
=09ecmaspec-html.xsl mod.cs=09=09\
=09AssemblyInfo.cs.in
=20
-monodoc_FILES =3D browser.exe assembler.exe normalize.exe admin.exe
+monodoc_FILES =3D browser.exe assembler.exe normalize.exe admin.exe valida=
te.exe
=20
assembler.exe: $(assembler_sources) monodoc.dll
=09$(CSC) /debug /out:assembler.exe $(assembler_sources) -r:ICSharpCode.Sh=
arpZipLib.dll -r:./monodoc.dll
@@ -68,6 +72,9 @@
=20
normalize.exe: normalize.cs
=09$(CSC) $(srcdir)/normalize.cs -out:normalize.exe
+
+validate.exe: validate.cs monodoc-ecma.xsd
+=09$(CSC) $(srcdir)/validate.cs -out:validate.exe /resource:$(srcdir)/mono=
doc-ecma.xsd,monodoc-ecma.xsd
=20
mono.pub: $(top_srcdir)/mono.pub
=09cp $(top_srcdir)/mono.pub .
Index: browser/monodoc-ecma.xsd
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: browser/monodoc-ecma.xsd
diff -N browser/monodoc-ecma.xsd
--- /dev/null=091 Jan 1970 00:00:00 -0000
+++ browser/monodoc-ecma.xsd=0925 Aug 2004 01:59:56 -0000
@@ -0,0 +1,627 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!--
+Author: John Luke <john.luke@gmail.com>
+This is a (not very strict) schema for the monodoc
+ecma-provider format.
+TODO:
+make base type for summary, remarks, returns, etc
+alias duplicate attributes
+make stricter in order and occurance
+add masterdoc support?
+-->
+<xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema">
+
+ <!-- define attributes -->
+ <xs:attribute name=3D"argnames" type=3D"xs:string" />
+ <xs:attribute name=3D"cref" type=3D"xs:string" />
+ <xs:attribute name=3D"Deprecated" type=3D"xs:boolean" />
+ <xs:attribute name=3D"FullName" type=3D"xs:string" />
+ <xs:attribute name=3D"FullNameSP" type=3D"xs:string" />
+ <xs:attribute name=3D"inherited" type=3D"xs:string" />
+ <xs:attribute name=3D"language" type=3D"xs:string" />
+ <xs:attribute name=3D"Language" type=3D"xs:string" />
+ <xs:attribute name=3D"lang" type=3D"xs:string" />
+ <xs:attribute name=3D"langword" type=3D"xs:string" />
+ <xs:attribute name=3D"location" type=3D"xs:string" />
+ <xs:attribute name=3D"Maintainer" type=3D"xs:string" />
+ <xs:attribute name=3D"MemberName" type=3D"xs:string" />
+ <xs:attribute name=3D"name" type=3D"xs:string" />
+ <xs:attribute name=3D"Name" type=3D"xs:string" />
+ <xs:attribute name=3D"namespace" type=3D"xs:string" />
+ <xs:attribute name=3D"propertytype" type=3D"xs:string" />
+ <xs:attribute name=3D"qualify" type=3D"xs:boolean" />
+ <xs:attribute name=3D"RefType" type=3D"xs:string" />
+ <xs:attribute name=3D"returntype" type=3D"xs:string" />
+ <xs:attribute name=3D"source" type=3D"xs:string" />
+ <xs:attribute name=3D"subset" type=3D"xs:string" />
+ <xs:attribute name=3D"Value" type=3D"xs:string" />
+ <xs:attribute name=3D"type" type=3D"xs:string" />
+ <xs:attribute name=3D"Type" type=3D"xs:string" />
+
+ <!-- define simple elements -->
+ <xs:element name=3D"AssemblyName" type=3D"xs:string" />
+ <xs:element name=3D"AssemblyPublicKey" type=3D"xs:string" />
+ <xs:element name=3D"AssemblyVersion" type=3D"xs:string" />
+ <xs:element name=3D"AssemblyCulture" type=3D"xs:string" />
+ <xs:element name=3D"AttributeName" type=3D"xs:string" />
+ <xs:element name=3D"BaseTypeName" type=3D"xs:string" />
+ <xs:element name=3D"Excluded" type=3D"xs:string" />
+ <xs:element name=3D"ExcludedLibrary" type=3D"xs:string" />
+ <xs:element name=3D"ExcludedLibraryName" type=3D"xs:string" />
+ <xs:element name=3D"ExcludedTypeName" type=3D"xs:string" />
+ <xs:element name=3D"InterfaceName" type=3D"xs:string" />
+ <xs:element name=3D"li" type=3D"xs:string" />
+ <xs:element name=3D"MemberOfLibrary" type=3D"xs:string" />
+ <xs:element name=3D"MemberType" type=3D"xs:string" />
+ <xs:element name=3D"MemberValue" type=3D"xs:string" />
+ <xs:element name=3D"onequarter" type=3D"xs:string" />
+ <xs:element name=3D"ReturnType" type=3D"xs:string" />
+ <xs:element name=3D"sub" type=3D"xs:string" />
+ <xs:element name=3D"sup" type=3D"xs:string" />
+ <xs:element name=3D"TypeExcluded" type=3D"xs:string" />
+
+ <!-- define complex elements -->
+ <xs:element name=3D"altmember">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base=3D"xs:string">
+ <xs:attribute ref=3D"cref" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"AssemblyInfo">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"AssemblyName" minOccurs=3D"0" />
+ <xs:element ref=3D"AssemblyPublicKey" minOccurs=3D"0" />
+ <xs:element ref=3D"AssemblyVersion" minOccurs=3D"0" />
+ <xs:element ref=3D"AssemblyCulture" minOccurs=3D"0" />
+ <xs:element ref=3D"Attributes" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Attribute">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"AttributeName" />
+ <xs:element ref=3D"Excluded" minOccurs=3D"0" />
+ <xs:element ref=3D"ExcludedTypeName" minOccurs=3D"0" />
+ <xs:element ref=3D"ExcludedLibraryName" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Attributes">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Attribute" minOccurs=3D"0" maxOccurs=3D"unbound=
ed" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Base">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"BaseTypeName" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"block">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"list" />
+ </xs:choice>
+ <xs:attribute ref=3D"subset" />
+ <xs:attribute ref=3D"type" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"c">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"para" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"class">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"constructor" />
+ <xs:element ref=3D"property" />
+ <xs:element ref=3D"method" />
+ <xs:element ref=3D"field" />
+ <xs:element ref=3D"operator" />
+ <xs:element ref=3D"event" />
+ <xs:element ref=3D"enum" />
+ <xs:element ref=3D"class" />
+ <xs:element ref=3D"struct" />
+ <xs:element ref=3D"interface" />
+ <xs:element ref=3D"delegate" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"namespace" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"code">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base=3D"xs:string">
+ <xs:attribute ref=3D"lang" />
+ <xs:attribute ref=3D"language" />
+ <xs:attribute ref=3D"source" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"constructor">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"argnames" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"delegate">
+ <xs:complexType>
+ <xs:choice maxOccurs=3D"unbounded">
+ <xs:element ref=3D"constructor" />
+ <xs:element ref=3D"method" />
+ <xs:element ref=3D"property" />
+ <xs:element ref=3D"operator" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"namespace" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"description">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"para" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Docs">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"summary" />
+ <xs:element ref=3D"param" />
+ <xs:element ref=3D"exception" />
+ <xs:element ref=3D"returns" />
+ <xs:element ref=3D"remarks" />
+ <xs:element ref=3D"example" />
+ <xs:element ref=3D"value" />
+ <xs:element ref=3D"permission" />
+ <xs:element ref=3D"altmember" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"enum">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"field" />
+ <xs:element ref=3D"method" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"namespace" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"event">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"inherited" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"example">
+ <xs:complexType>
+ <xs:choice maxOccurs=3D"unbounded">
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"code" />
+ <xs:element ref=3D"c" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"exception">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ </xs:choice>
+ <xs:attribute ref=3D"cref" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"field">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"inherited" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"interface">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"constructor" />
+ <xs:element ref=3D"property" />
+ <xs:element ref=3D"method" />
+ <xs:element ref=3D"field" />
+ <xs:element ref=3D"event" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"namespace" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Interface">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"InterfaceName" />
+ <xs:element ref=3D"Excluded" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Interfaces">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Interface" minOccurs=3D"0" maxOccurs=3D"unbound=
ed" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"item">
+ <xs:complexType>
+=09<xs:sequence>
+ <xs:element ref=3D"term" minOccurs=3D"1" maxOccurs=3D"1" />
+ <xs:element ref=3D"description" minOccurs=3D"0" maxOccurs=3D"unb=
ounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"link">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base=3D"xs:string">
+ <xs:attribute ref=3D"location" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"list">
+ <xs:complexType>
+=09<xs:sequence>
+ <xs:element ref=3D"listheader" minOccurs=3D"0" maxOccurs=3D"1" /=
>
+ <xs:element ref=3D"item" minOccurs=3D"0" maxOccurs=3D"unbounded"=
/>
+ </xs:sequence>
+ <xs:attribute name=3D"type" type=3D"xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"listheader">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"term" />
+ <xs:element ref=3D"description" maxOccurs=3D"unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"masterdoc">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"class" />
+ <xs:element ref=3D"delegate" />
+ <xs:element ref=3D"interface" />
+ <xs:element ref=3D"struct" />
+ <xs:element ref=3D"enum" />
+ </xs:choice>
+ <xs:attribute name=3D"assembly" type=3D"xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"MemberSignature">
+ <xs:complexType>
+ <xs:attribute ref=3D"Language" />
+ <xs:attribute ref=3D"Value" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Member">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"MemberSignature" maxOccurs=3D"2" />
+ <xs:element ref=3D"MemberType" maxOccurs=3D"1" />
+ <xs:element ref=3D"Attributes" minOccurs=3D"0" maxOccurs=3D"1" />
+ <xs:element ref=3D"ReturnValue" minOccurs=3D"0" maxOccurs=3D"1" />
+ <xs:element ref=3D"Parameters" minOccurs=3D"0" maxOccurs=3D"1" />
+ <xs:element ref=3D"MemberValue" minOccurs=3D"0" maxOccurs=3D"1" />
+ <xs:element ref=3D"Docs" maxOccurs=3D"1" />
+ <xs:element ref=3D"Excluded" minOccurs=3D"0" maxOccurs=3D"1" />
+ <xs:element ref=3D"ExcludedLibrary" minOccurs=3D"0" maxOccurs=3D"5=
" />
+ </xs:sequence>
+ <xs:attribute ref=3D"MemberName" />
+ <xs:attribute ref=3D"Deprecated" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Members">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Member" minOccurs=3D"0" maxOccurs=3D"unbounded"=
/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"method">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"argnames" />
+ <xs:attribute ref=3D"inherited" />
+ <xs:attribute ref=3D"returntype" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Namespace">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Docs" maxOccurs=3D"1" />
+ </xs:sequence>
+ <xs:attribute ref=3D"Name" />
+ <xs:attribute ref=3D"FullName" />
+ <xs:attribute ref=3D"FullNameSP" />
+ <xs:attribute ref=3D"Maintainer" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"operator">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"argnames" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"para">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"block" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"list" />
+ <xs:element ref=3D"link" />
+ <xs:element ref=3D"ul" />
+ <xs:element ref=3D"example" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"c" />
+ <xs:element ref=3D"onequarter" />
+ <xs:element ref=3D"sub" />
+ <xs:element ref=3D"sup" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"param">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"block" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"para" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" use=3D"required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"paramref">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" use=3D"required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Parameter">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Attributes" minOccurs=3D"0" maxOccurs=3D"1" />
+ </xs:sequence>
+ <xs:attribute ref=3D"Name" />
+ <xs:attribute ref=3D"Type" />
+ <xs:attribute ref=3D"RefType" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Parameters">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"Parameter" minOccurs=3D"0" maxOccurs=3D"unbound=
ed" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"permission">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"see" />
+ </xs:choice>
+ <xs:attribute ref=3D"cref" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"property">
+ <xs:complexType>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"inherited" />
+ <xs:attribute ref=3D"propertytype" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"remarks">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"block" />
+ <xs:element ref=3D"code" />
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"ul" />
+ <xs:element ref=3D"example" />
+ <xs:element ref=3D"list" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"returns">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"list" />
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"ul" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"ReturnValue">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"ReturnType" minOccurs=3D"0" maxOccurs=3D"1" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"see">
+ <xs:complexType>
+ <xs:attribute ref=3D"cref" />
+ <xs:attribute ref=3D"langword" />
+ <xs:attribute ref=3D"qualify" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"struct">
+ <xs:complexType>
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"constructor" />
+ <xs:element ref=3D"property" />
+ <xs:element ref=3D"method" />
+ <xs:element ref=3D"field" />
+ <xs:element ref=3D"operator" />
+ <xs:element ref=3D"struct" />
+ <xs:element ref=3D"class" />
+ </xs:choice>
+ <xs:attribute ref=3D"name" />
+ <xs:attribute ref=3D"namespace" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"summary">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"block" />
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"ul" />
+ <xs:element ref=3D"list" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"term">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"param" />
+ <xs:element ref=3D"paramref" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"ThreadingSafetyStatement">
+ <xs:complexType mixed=3D"true">
+ <xs:sequence>
+ <xs:element ref=3D"link" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"ThreadSafetyStatement">
+ <xs:complexType mixed=3D"true">
+ <xs:sequence>
+ <xs:element ref=3D"link" minOccurs=3D"0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"Type">
+ <xs:complexType>
+ <xs:choice maxOccurs=3D"unbounded">
+ <xs:element ref=3D"TypeSignature" minOccurs=3D"1" />
+ <xs:element ref=3D"MemberOfLibrary" minOccurs=3D"0" />
+ <xs:element ref=3D"AssemblyInfo" minOccurs=3D"1" />
+ <xs:element ref=3D"ThreadingSafetyStatement" minOccurs=3D"0" />
+ <xs:element ref=3D"ThreadSafetyStatement" minOccurs=3D"0" />
+ <xs:element ref=3D"Docs" minOccurs=3D"1" />
+ <xs:element ref=3D"Base" minOccurs=3D"1" />
+ <xs:element ref=3D"Interfaces" minOccurs=3D"1" />
+ <xs:element ref=3D"Attributes" minOccurs=3D"1" />
+ <xs:element ref=3D"Members" minOccurs=3D"1" />
+ <xs:element ref=3D"Parameters" minOccurs=3D"0" />
+ <xs:element ref=3D"ReturnValue" minOccurs=3D"0" />
+ <xs:element ref=3D"TypeExcluded" minOccurs=3D"0" />
+ </xs:choice>
+ <xs:attribute ref=3D"Name" use=3D"required" />
+ <xs:attribute ref=3D"FullName" use=3D"required" />
+ <xs:attribute ref=3D"FullNameSP" />
+ <xs:attribute ref=3D"Maintainer" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"TypeSignature">
+ <xs:complexType>
+ <xs:attribute ref=3D"Language" use=3D"required" />
+ <xs:attribute ref=3D"Value" use=3D"required" />
+ <xs:attribute ref=3D"Maintainer" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"ul">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref=3D"li" minOccurs=3D"1" maxOccurs=3D"unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name=3D"value">
+ <xs:complexType mixed=3D"true">
+ <xs:choice minOccurs=3D"0" maxOccurs=3D"unbounded">
+ <xs:element ref=3D"block" />
+ <xs:element ref=3D"para" />
+ <xs:element ref=3D"paramref" />
+ <xs:element ref=3D"see" />
+ <xs:element ref=3D"ul" />
+ <xs:element ref=3D"example" />
+ <xs:element ref=3D"list" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
+
Index: browser/validate.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: browser/validate.cs
diff -N browser/validate.cs
--- /dev/null=091 Jan 1970 00:00:00 -0000
+++ browser/validate.cs=0925 Aug 2004 01:59:56 -0000
@@ -0,0 +1,112 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace MonoDoc
+{
+=09public class Validate
+=09{
+=09=09static XmlValidatingReader reader;
+=09=09static XmlSchema schema;
+=09=09static long errors =3D 0;
+=09=09static bool IsValid =3D true;
+=09
+=09=09public static void Main (string[] args)
+=09=09{
+=09=09=09if (args.Length < 2) {
+=09=09=09=09PrintUsage ();
+=09=09=09}
+
+=09=09=09Stream s =3D null;
+
+=09=09=09switch (args[0]) {
+=09=09=09=09case "ecma":
+=09=09=09=09=09s =3D Assembly.GetExecutingAssembly ().GetManifestResourceS=
tream ("monodoc-ecma.xsd");
+=09=09=09=09=09break;
+=09=09=09=09default:
+=09=09=09=09=09Console.WriteLine ("Unknown provider: {0}", args[0]);
+=09=09=09=09=09Environment.Exit (0);
+=09=09=09=09=09break;
+=09=09=09}
+
+=09=09=09if (s =3D=3D null) {
+=09=09=09=09Console.WriteLine ("ERROR: schema for {0} was not found", args=
[0]);
+=09=09=09=09Environment.Exit (1);
+=09=09=09}
+
+=09=09=09schema =3D XmlSchema.Read (s, null);
+=09=09=09schema.Compile (null);
+
+=09=09=09// skip args[0] because it is the provider name
+=09=09=09for (int i =3D 1; i < args.Length; i++) {
+=09=09=09=09string arg =3D args[i];
+=09=09=09=09if (IsMonodocFile (arg))
+=09=09=09=09=09ValidateFile (arg);
+
+=09=09=09=09if (Directory.Exists (arg))
+=09=09=09=09{
+=09=09=09=09=09RecurseDirectory (arg);
+=09=09=09=09}
+=09=09=09}
+
+=09=09=09Console.WriteLine ("Total validation errors: {0}", errors);
+=09=09}
+
+=09=09static void PrintUsage ()
+=09=09{
+=09=09=09Console.WriteLine ("usage: normalize.exe <provider> <files>");
+=09=09=09Environment.Exit (0);
+=09=09}
+
+=09=09static void ValidateFile (string file)
+=09=09{
+=09=09=09IsValid =3D true;
+=09=09=09Console.WriteLine ("Checking {0}", file);
+=09=09=09reader =3D new XmlValidatingReader (new XmlTextReader (file));
+=09=09=09reader.ValidationType =3D ValidationType.Schema;
+=09=09=09reader.Schemas.Add (schema);
+=09=09=09reader.ValidationEventHandler +=3D new ValidationEventHandler (On=
ValidationEvent);
+=09=09=09while (reader.Read ()) {
+=09=09=09=09// do nothing
+=09=09=09}
+=09=09=09reader.Close ();
+
+=09=09=09if (IsValid)
+=09=09=09=09Console.WriteLine ("{0} is valid.", file);
+=09=09}
+
+=09=09static void RecurseDirectory (string dir)
+=09=09{
+=09=09=09string[] files =3D Directory.GetFiles (dir, "*.xml");
+=09=09=09foreach (string f in files)
+=09=09=09{
+=09=09=09=09if (IsMonodocFile (f))
+=09=09=09=09=09ValidateFile (f);
+=09=09=09}
+
+=09=09=09string[] dirs =3D Directory.GetDirectories (dir);
+=09=09=09foreach (string d in dirs)
+=09=09=09=09RecurseDirectory (d);
+=09=09}
+
+=09=09static void OnValidationEvent (object sender, ValidationEventArgs a)
+=09=09{
+=09=09=09if (IsValid)
+=09=09=09=09IsValid =3D false;
+=09=09=09errors ++;
+=09=09=09Console.WriteLine (a.Message);
+=09=09}
+
+=09=09static bool IsMonodocFile (string file)
+=09=09{
+=09=09=09=09if (File.Exists (file) && Path.GetExtension (file).ToLower () =
=3D=3D ".xml")
+=09=09=09=09=09return true;
+=09=09=09=09else
+=09=09=09=09=09return false;
+=09=09=09
+=09=09}
+=09}
+}
+
------=_Part_52_6712975.1093404010041--