From 5485b2574bf389867d7f9ab4b272b0c80f3bb878 Mon Sep 17 00:00:00 2001 From: Michael Ganss Date: Tue, 18 Jan 2022 18:09:41 +0100 Subject: [PATCH] Prevent creating properties from infinite recursive attribute group refs Prevent duplicate elements from multiple group refs in choices Add schema downloader script Add XBRL schema --- .gitignore | 1 + XmlSchemaClassGenerator.Tests/XmlTests.cs | 18 + .../tools/download.csx | 59 ++ .../tools/omnisharp.json | 6 + .../xbrl/xbrl-instance-2003-12-31-ixmod.xsd | 788 ++++++++++++++++++ .../xbrl/xbrl-linkbase-2003-12-31-ixmod.xsd | 488 +++++++++++ .../xsd/xbrl/xbrl/xl-2003-12-31.xsd | 248 ++++++ .../xsd/xbrl/xbrl/xlink-2003-12-31.xsd | 117 +++ .../xbrl/xhtml-inlinexbrl-1_1-definitions.xsd | 252 ++++++ .../xsd/xbrl/xhtml-inlinexbrl-1_1-model.xsd | 521 ++++++++++++ .../xsd/xbrl/xhtml-inlinexbrl-1_1-modules.xsd | 535 ++++++++++++ .../xsd/xbrl/xhtml-inlinexbrl-1_1.xsd | 40 + .../xsd/xbrl/xhtml/xhtml-attribs-1.xsd | 72 ++ .../xsd/xbrl/xhtml/xhtml-base-1.xsd | 36 + .../xsd/xbrl/xhtml/xhtml-bdo-1.xsd | 78 ++ .../xsd/xbrl/xhtml/xhtml-blkphras-1.xsd | 161 ++++ .../xsd/xbrl/xhtml/xhtml-blkpres-1.xsd | 37 + .../xsd/xbrl/xhtml/xhtml-blkstruct-1.xsd | 49 ++ .../xsd/xbrl/xhtml/xhtml-csismap-1.xsd | 96 +++ .../xsd/xbrl/xhtml/xhtml-datatypes-1.xsd | 128 +++ .../xsd/xbrl/xhtml/xhtml-edit-1.xsd | 39 + .../xsd/xbrl/xhtml/xhtml-events-1.xsd | 130 +++ .../xsd/xbrl/xhtml/xhtml-form-1.xsd | 326 ++++++++ .../xsd/xbrl/xhtml/xhtml-framework-1.xsd | 66 ++ .../xsd/xbrl/xhtml/xhtml-hypertext-1.xsd | 47 ++ .../xsd/xbrl/xhtml/xhtml-image-1.xsd | 45 + .../xsd/xbrl/xhtml/xhtml-inlphras-1.xsd | 163 ++++ .../xsd/xbrl/xhtml/xhtml-inlpres-1.xsd | 39 + .../xsd/xbrl/xhtml/xhtml-inlstruct-1.xsd | 50 ++ .../xsd/xbrl/xhtml/xhtml-inlstyle-1.xsd | 27 + .../xsd/xbrl/xhtml/xhtml-link-1.xsd | 45 + .../xsd/xbrl/xhtml/xhtml-list-1.xsd | 99 +++ .../xsd/xbrl/xhtml/xhtml-meta-1.xsd | 42 + .../xsd/xbrl/xhtml/xhtml-object-1.xsd | 76 ++ .../xsd/xbrl/xhtml/xhtml-param-1.xsd | 51 ++ .../xsd/xbrl/xhtml/xhtml-pres-1.xsd | 51 ++ .../xsd/xbrl/xhtml/xhtml-ruby-basic-1.xsd | 89 ++ .../xsd/xbrl/xhtml/xhtml-script-1.xsd | 70 ++ .../xsd/xbrl/xhtml/xhtml-ssismap-1.xsd | 43 + .../xsd/xbrl/xhtml/xhtml-struct-1.xsd | 112 +++ .../xsd/xbrl/xhtml/xhtml-style-1.xsd | 52 ++ .../xsd/xbrl/xhtml/xhtml-table-1.xsd | 272 ++++++ .../xsd/xbrl/xhtml/xhtml-text-1.xsd | 67 ++ XmlSchemaClassGenerator/ModelBuilder.cs | 19 +- XmlSchemaClassGenerator/TypeModel.cs | 19 +- 45 files changed, 5757 insertions(+), 12 deletions(-) create mode 100644 XmlSchemaClassGenerator.Tests/tools/download.csx create mode 100644 XmlSchemaClassGenerator.Tests/tools/omnisharp.json create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-instance-2003-12-31-ixmod.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-linkbase-2003-12-31-ixmod.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xl-2003-12-31.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xlink-2003-12-31.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-definitions.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-model.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-modules.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-attribs-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-base-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-bdo-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkphras-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkpres-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkstruct-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-csismap-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-datatypes-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-edit-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-events-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-form-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-framework-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-hypertext-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-image-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlphras-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlpres-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstruct-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstyle-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-link-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-list-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-meta-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-object-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-param-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-pres-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ruby-basic-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-script-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ssismap-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-struct-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-style-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-table-1.xsd create mode 100644 XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-text-1.xsd diff --git a/.gitignore b/.gitignore index b8ad003a..7244928b 100644 --- a/.gitignore +++ b/.gitignore @@ -299,3 +299,4 @@ __pycache__/ *.xsd.cs /coverage.xml /coverage.netcoreapp2.2.xml +.vscode diff --git a/XmlSchemaClassGenerator.Tests/XmlTests.cs b/XmlSchemaClassGenerator.Tests/XmlTests.cs index 5a93b3f2..09b88f95 100644 --- a/XmlSchemaClassGenerator.Tests/XmlTests.cs +++ b/XmlSchemaClassGenerator.Tests/XmlTests.cs @@ -105,6 +105,7 @@ private static IEnumerable ConvertXml(string name, string xsd, Generator const string DtsxPattern = "xsd/dtsx/dtsx2.xsd"; const string WfsPattern = "xsd/wfs/schemas.opengis.net/wfs/2.0/wfs.xsd"; const string EppPattern = "xsd/epp/*.xsd"; + const string XbrlPattern = "xsd/xbrl/xhtml-inlinexbrl-1_1.xsd"; // IATA test takes too long to perform every time @@ -523,6 +524,23 @@ public void TestEpp() TestSamples("epp", EppPattern); } + [Fact, TestPriority(1)] + [UseCulture("en-US")] + public void TestXbrl() + { + var output = new FileWatcherOutputWriter(Path.Combine("output", "xbrl")); + var generator = new Generator + { + OutputWriter = output, + GenerateInterfaces = false, + UniqueTypeNamesAcrossNamespaces = true, + }; + generator.NamespaceProvider.Add(new NamespaceKey("http://www.xbrl.org/2003/XLink"), "XbrlLink"); + var assembly = Compiler.Generate("xbrl", XbrlPattern, generator); + Assert.NotNull(assembly); + //TestSamples("xbrl", XbrlPattern); + } + private void TestSamples(string name, string pattern) { var assembly = Compiler.GetAssembly(name); diff --git a/XmlSchemaClassGenerator.Tests/tools/download.csx b/XmlSchemaClassGenerator.Tests/tools/download.csx new file mode 100644 index 00000000..a2b6b5ac --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/tools/download.csx @@ -0,0 +1,59 @@ +#! "net6.0" + +using System.Net.Http; +using System.Xml; +using System.Xml.Linq; + +var opts = Args.Where(a => a.StartsWith("-")); + +if (Args.Except(opts).Count() < 1) +{ + Console.WriteLine("Usage: dotnet script download.csx [-ddestination] URL..."); + return; +} + +XNamespace xs = "http://www.w3.org/2001/XMLSchema"; +var xsds = new HashSet(StringComparer.OrdinalIgnoreCase); +var client = new HttpClient(); +var destination = opts.FirstOrDefault(a => a.StartsWith("-d"))?[2..] ?? "."; + +void Download(string url, string destination) +{ + destination = Path.GetFullPath(destination); + + var key = $"{url}:{destination}"; + + if (xsds.Contains(key)) return; + + Console.WriteLine($"Downloading {url} to {destination}"); + + xsds.Add(key); + + var xsd = client.GetStringAsync(url).Result; + var document = XDocument.Parse(xsd); + var uri = new Uri(url); + var fileName = Path.GetFileName(uri.LocalPath); + var dir = new Uri(uri, "."); + var locations = document.Descendants(xs + "include") + .Concat(document.Descendants(xs + "import")) + .Concat(document.Descendants(xs + "redefine")) + .Select(e => e.Attribute("schemaLocation")?.Value) + .Where(a => a != null && !new Uri(a, UriKind.RelativeOrAbsolute).IsAbsoluteUri); + + Directory.CreateDirectory(destination); + File.WriteAllText(Path.Join(destination, fileName), xsd); + + foreach (var location in locations) + { + var locationUri = new Uri(dir, location).OriginalString; + var locationDest = Path.GetDirectoryName(Path.Join(destination, location)); + Download(locationUri, locationDest); + } +} + +foreach (var url in Args.Except(opts)) +{ + Download(url, destination); +} + +Console.WriteLine("Done."); \ No newline at end of file diff --git a/XmlSchemaClassGenerator.Tests/tools/omnisharp.json b/XmlSchemaClassGenerator.Tests/tools/omnisharp.json new file mode 100644 index 00000000..024e9cfc --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/tools/omnisharp.json @@ -0,0 +1,6 @@ +{ + "script": { + "enableScriptNuGetReferences": true, + "defaultTargetFramework": "net5.0" + } +} \ No newline at end of file diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-instance-2003-12-31-ixmod.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-instance-2003-12-31-ixmod.xsd new file mode 100644 index 00000000..61d28b4a --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-instance-2003-12-31-ixmod.xsd @@ -0,0 +1,788 @@ + + + + + + + Taxonomy schema for XBRL. This schema defines syntax relating to + XBRL instances. + + + + + + + + + Define the attributes to be used on XBRL concept definitions + + + + + + + The periodType attribute (restricting the period for XBRL items) + + + + + + + + + + + + + + The balance attribute (imposes calculation relationship restrictions) + + + + + + + + + + + + + Define the simple types used as a base for for item types + + + + + + + the monetary type serves as the datatype for those financial + concepts in a taxonomy which denote units in a currency. + Instance items with this type must have a unit of measure + from the ISO 4217 namespace of currencies. + + + + + + + + + This datatype serves as the datatype for share based + financial concepts. + + + + + + + + + This datatype serves as the type for dimensionless numbers + such as percentage change, growth rates, and other ratios + where the numerator and denominator have the same units. + + + + + + + + + As the name implies this is a decimal value that can not take + the value 0 - it is used as the type for the denominator of a + fractionItemType. + + + + + + + + + + + + + + + + + + + + This type is used to specify the value of the + precision attribute on numeric items. It consists + of the union of nonNegativeInteger and "INF" (used + to signify infinite precision or "exact value"). + + + + + + + + + + + + + + + This type is used to specify the value of the decimals attribute + on numeric items. It consists of the union of integer and "INF" + (used to signify that a number is expressed to an infinite number + of decimal places or "exact value"). + + + + + + + + + + + + + + + Attributes for all items and tuples. + + + + + + + + + + Group of attributes for tuples. + + + + + + + + + Attributes for all items. + + + + + + + + + + Attributes for all numeric items (fractional and non-fractional). + + + + + + + + + + Group of attributes for non-fractional numeric items + + + + + + + + + + + + + + + Group of attributes for non-numeric items + + + + + + + + General numeric item types - for use on concept element definitions + The following 3 numeric types are all based on the built-in + data types of XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XBRL domain numeric item types - for use on concept element definitions + The following 4 numeric types are all types that have been identified as + having particular relevance to the domain space addressed by XBRL and are + hence included in addition to the built-in types from XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 13 numeric types are all based on the XML Schema + built-in types that are derived by restriction from decimal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 17 non-numeric types are all based on the primitive built-in + data types of XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 5 non-numeric types are all based on the XML Schema + built-in types that are derived by restriction and/or list from string. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XML Schema components contributing to the context element + + + + + + + + + + + + + + + The type for the entity element, used to describe the reporting entity. + Note that the scheme attribute is required and cannot be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + The union of the date and dateTime simple types. + + + + + + + + + The type for the period element, used to describe the reporting date info. + + + + + + + + + + + + + + + + + + Used for the scenario under which fact have been reported. + + + + + + + + + + + Used for an island of context to which facts can be related. + + + + + + + + + + + + + + + XML Schema components contributing to the unit element + + + + + + + + + A collection of sibling measure elements + + + + + + + + + + + Element used to represent division in units + + + + + + + + + + + + + + Element used to represent units information about numeric items + + + + + + + + + + + + + + Elements to use for facts in instances + + + + + + + Abstract item element used as head of item substitution group + + + + + + + + Abstract tuple element used as head of tuple substitution group + + + + + + + + XBRL instance root element. + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-linkbase-2003-12-31-ixmod.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-linkbase-2003-12-31-ixmod.xsd new file mode 100644 index 00000000..9e1842cc --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xbrl-linkbase-2003-12-31-ixmod.xsd @@ -0,0 +1,488 @@ + + + + + + + XBRL simple and extended link schema constructs + + + + + + + + + + + + Concrete element to use for documentation of + extended links and linkbases. + + + + + + + + Concrete locator element. The loc element is the + XLink locator element for all extended links in XBRL. + + + + + + + + Concrete arc for use in label extended links. + + + + + + + + Concrete arc for use in reference extended links. + + + + + + + + Concrete arc for use in definition extended links. + + + + + + + + + Extension of the extended link arc type for presentation arcs. + Adds a preferredLabel attribute that documents the role attribute + value of preferred labels (as they occur in label extended links). + + + + + + + + + + + + + + + + + + + + + Extension of the extended link arc type for calculation arcs. + Adds a weight attribute to track weights on contributions to + summations. + + + + + + + + + + + + + + Concrete arc for use in footnote extended links. + + + + + + + + Definition of the label resource element. + + + + + + + + + + + + + + + + + + Definition of the reference part element - for use in reference resources. + + + + + + + + Definition of the reference resource element. + + + + + + + + + + + + + + + + + Definition of the reference resource element + + + + + + + + + + + + + + + + + + presentation extended link element definition. + + + + + + + + + + + + + + + + + + + + + definition extended link element definition + + + + + + + + + + + + + + + + + + + + + calculation extended link element definition + + + + + + + + + + + + + + + + + + + + + label extended link element definition + + + + + + + + + + + + + + + + + + + + + + reference extended link element definition + + + + + + + + + + + + + + + + + + + + + + footnote extended link element definition + + + + + + + + + + + + + + + + + + + + + + + Definition of the linkbase element. Used to + contain a set of zero or more extended link elements. + + + + + + + + + + + + + + + + + + Definition of the linkbaseRef element - used + to link to XBRL taxonomy extended links from + taxonomy schema documents and from XBRL + instances. + + + + + + + + + This attribute must have the value: + http://www.w3.org/1999/xlink/properties/linkbase + + + + + + + + + + + + + Definition of the schemaRef element - used + to link to XBRL taxonomy schemas from + XBRL instances. + + + + + + + + Definition of the roleRef element - used + to link to resolve xlink:role attribute values to + the roleType element declaration. + + + + + + + + + This attribute contains the role name. + + + + + + + + + + + + Definition of the roleRef element - used + to link to resolve xlink:arcrole attribute values to + the arcroleType element declaration. + + + + + + + + + This attribute contains the arc role name. + + + + + + + + + + + + The element to use for human-readable definition + of custom roles and arc roles. + + + + + + + + Definition of the usedOn element - used + to identify what elements may use a + taxonomy defined role or arc role value. + + + + + + + + The roleType element definition - used to define custom + role values in XBRL extended links. + + + + + + + + + + + + + + + + The arcroleType element definition - used to define custom + arc role values in XBRL extended links. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xl-2003-12-31.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xl-2003-12-31.xsd new file mode 100644 index 00000000..c531334e --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xl-2003-12-31.xsd @@ -0,0 +1,248 @@ + + + + + + + + + + A URI type with a minimum length of 1 character. + Used on role and arcrole and href elements. + + + + + + + + + + + + Element type to use for documentation of + extended links and linkbases. + + + + + + + + + + + + + Abstract element to use for documentation of + extended links and linkbases. + + + + + + + XBRL simple and extended link schema constructs + + + + + + + Type for the abstract title element - + used as a title element template. + + + + + + + + + + + + + Generic title element for use in extended link documentation. + Used on extended links, arcs, locators. + See http://www.w3.org/TR/xlink/#title-element for details. + + + + + + + + Generic locator type. + + + + + + + + + + + + + + + + + + + Abstract locator element to be used as head of locator substitution group + for all extended link locators in XBRL. + + + + + + + + Enumerated values for the use attribute on extended link arcs. + + + + + + + + + + + + basic extended link arc type - extended where necessary for specific arcs + Extends the generic arc type by adding use, priority and order attributes. + + + + + + + + + + + + + + + + + + + + + + + + + Abstract element to use as head of arc element substitution group. + + + + + + + + Generic type for the resource type element + + + + + + + + + + + + + + + + Abstract element to use as head of resource element substitution group. + + + + + + + + Generic extended link type + + + + + + + + + + + + + + + + + + + + + + + + Abstract extended link element at head of extended link substitution group. + + + + + + + + Type for the simple links defined in XBRL + + + + + + + + + + + + + + + + + + + The abstract element at the head of the simple link substitution group. + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xlink-2003-12-31.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xlink-2003-12-31.xsd new file mode 100644 index 00000000..12460335 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xbrl/xlink-2003-12-31.xsd @@ -0,0 +1,117 @@ + + + + + + + XLink attribute specification + + + + + + + + + Enumeration of values for the type attribute + + + + + + + + + + + + + + + + + + A URI with a minimum length of 1 character. + + + + + + + + + + + + + A URI with a minimum length of 1 character. + + + + + + + + + + + + + + + Enumeration of values for the show attribute + + + + + + + + + + + + + + + + + Enumeration of values for the actuate attribute + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-definitions.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-definitions.xsd new file mode 100644 index 00000000..17e80914 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-definitions.xsd @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-model.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-model.xsd new file mode 100644 index 00000000..e80b241f --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-model.xsd @@ -0,0 +1,521 @@ + + + + + + + + + + + + + This is the XML Schema module of common content models for XHTML11 + Inline XBRL + + + + + + + XHTML Document Model + This module describes the groupings of elements/attributes + that make up common content models for XHTML elements. + XHTML has following basic content models: + xhtml.Inline.mix; character-level elements + xhtml.Block.mix; block-like elements, e.g., paragraphs and lists + xhtml.Flow.mix; any block or inline elements + xhtml.HeadOpts.mix; Head Elements + xhtml.InlinePre.mix; Special class for pre content model + xhtml.InlineNoAnchor.mix; Content model for Anchor + + Any groups declared in this module may be used to create + element content models, but the above are considered 'global' + (insofar as that term applies here). XHTML has the + following Attribute Groups + xhtml.Core.extra.attrib + xhtml.I18n.extra.attrib + xhtml.Common.extra + + The above attribute Groups are considered Global + + + + + + Extended I18n attribute + + + + + "dir" Attribute from Bi Directional Text (bdo) Module + + + + + + + + Extended Common Attributes + + + + + "style" attribute from Inline Style Module + + + + + + + + Extend Core Attributes + + + + + + Extended Global Core Attributes + + + + + + Extended Global I18n attributes + + + + + + Extended Global Common Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-modules.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-modules.xsd new file mode 100644 index 00000000..828f70b1 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1-modules.xsd @@ -0,0 +1,535 @@ + + + + + + + + + + + + + This schema includes all modules for XHTML1.1 Document Type. + $Id: xhtml11-modules-1.xsd,v 1.3 2006/09/13 13:07:26 ahby Exp $ + + + + + + This schema includes all modules (and redefinitions) + for XHTML1.1 Document Type. + XHTML1.1 Document Type includes the following Modules + + XHTML Core modules (Required for XHTML Family Conformance) + + text + + hypertext + + lists + + structure + + Other XHTML modules + + Edit + + Bdo + + Presentational + + Link + + Meta + + Base + + Scripting + + Style + + Image + + Applet + + Object + + Param (Applet/Object modules require Param Module) + + Tables + + Forms + + Client side image maps + + Server side image maps + + + + + + + Schema Framework Component Modules: + + notations + + datatypes + + common attributes + + character entities + + + + + + + + Text module + + The Text module includes declarations for all core + text container elements and their attributes. + + + block phrasal + + block structural + + inline phrasal + + inline structural + + Elements defined here: + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + * div, p + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + * br, span + + + + + + + + Hypertext module + + Elements defined here: + * a + + + + + + + + + Redefinition by Client Side Image Map Module + + + + + + + Redefinition by XHTML Event Attribute Module + + + + + + + + + Lists module + + Elements defined here: + * dt, dd, dl, ol, ul, li + + + + + + + + Structural module + + Elements defined here: + * title, head, body, html + + + + + + + + + + + Original Body Attlist + + + + + + + Redefinition by XHTML Event Attribute Module + + + + + + + + + Edit module + + Elements defined here: + * ins, del + + + + + + + + Bidirectional element module + + Elements defined here: + * bdo + + + + + + + + Presentational module + + Elements defined here: + * hr, b, big, i, small,sub, sup, tt + + + + + + + + Link module + + Elements defined here: + * link + + + + + + + + Meta module + + Elements defined here: + * meta + + + + + + + + Base module + + Elements defined here: + * base + + + + + + + + Scripting module + + Elements defined here: + * script, noscript + + + + + + + + Style module + + Elements defined here: + * style + + + + + + + + Style attribute module + + Attribute defined here: + * style + + + + + + + + Image module + + Elements defined here: + * img + + + + + + + + Original Image Attributes (in Image Module) + + + + + + + Redefinition by Client Side Image Map Module + + + + + + + Redefinition by Server Side Image Module + + + + + + + + + Client-side mage maps module + + Elements defined here: + * area, map + + + + + + + + Original Area Attributes (in CSI Module) + + + + + + + Redefinition by Events Attribute Module + + + + + + + + + Server-side image maps module + + Attributes defined here: + * ismap on img + + + + + + + + Object module + + Elements defined here: + * object + + + + + + + + Original Object Attlist + + + + + + + Redefinition by Client Image Map Module + + + + + + + + + Param module + + Elements defined here: + * param + + + + + + + Tables module + + Elements defined here: + * table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td + + + + + + + + Forms module + + Elements defined here: + * form, label, input, select, optgroup, option, + * textarea, fieldset, legend, button + + + + + + + Changes to XHTML Form Attlist + + + + + + Original Form Attributes (declared in Forms Module) + + + + + + + XHTML Events Module - Attribute additions + + + + + + + + Changes to XHTML Form Input Element + + + + + + Original Input Attributes (in Forms Module) + + + + + + + Redefinition by Client Side Image Map Module + + + + + + + Redefinition by Server Side Image Map Module + + + + + + + Redefinition by Event Attribute Module + + + + + + + + + Original Label Attributes (in Forms Module) + + + + + + + Redefinition by Event Attribute Module + + + + + + + + + Original Select Attributes (in Forms Module) + + + + + + + Redefinition by Event Attribute Module + + + + + + + + + Original TextArea Attributes (in Forms Module) + + + + + + + Redefinition by Event Attribute Module + + + + + + + + + Original Button Attributes (in Forms Module) + + + + + + + Redefinition by Event Attribute Module + + + + + + + + + Ruby module + + Elements defined here: + * ruby, rbc, rtc, rb, rt, rp + + Note that either Ruby or Basic Ruby should be used but not both + + + + + + + + XHTML Events Modules + + Attributes defined here: + XHTML Event Types + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1.xsd new file mode 100644 index 00000000..e795a523 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml-inlinexbrl-1_1.xsd @@ -0,0 +1,40 @@ + + + + + This is the XML Schema driver for XHTML v1.1 + Inline XBRL v1.1 + + + + + + + + Schema that includes all modules (and redefinitions) + for XHTML1.1 and Inline XBRL Document Type. + + + + + + + + + Document Model module for the XHTML1.1 + Inline XBRL Document Type. + This schema file defines all named models used by Inline XBRL + Modularization Framework for Inline XBRL Document Type + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-attribs-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-attribs-1.xsd new file mode 100644 index 00000000..c61ca35e --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-attribs-1.xsd @@ -0,0 +1,72 @@ + + + + + + + This is the XML Schema common attributes module for XHTML + $Id: xhtml-attribs-1.xsd,v 1.6 2005/09/26 23:37:47 ahby Exp $ + + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-base-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-base-1.xsd new file mode 100644 index 00000000..a23df79d --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-base-1.xsd @@ -0,0 +1,36 @@ + + + + + + + Base element + This is the XML Schema Base Element module for XHTML + + * base + + This module declares the base element type and its attributes, + used to define a base URI against which relative URIs in the + document will be resolved. + + $Id: xhtml-base-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-bdo-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-bdo-1.xsd new file mode 100644 index 00000000..26e697a7 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-bdo-1.xsd @@ -0,0 +1,78 @@ + + + + + + Bidirectional Override (bdo) Element + This is the XML Schema BDO Element module for XHTML + + This modules declares the element 'bdo' and 'dir' attributes, + Used to override the Unicode bidirectional algorithm for selected + fragments of text. + Bidirectional text support includes both the bdo element and + the 'dir' attribute. + + $Id: xhtml-bdo-1.xsd,v 1.5 2005/09/26 23:37:47 ahby Exp $ + + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkphras-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkphras-1.xsd new file mode 100644 index 00000000..859c98e8 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkphras-1.xsd @@ -0,0 +1,161 @@ + + + + + + + + + This is the XML Schema Block Phrasal support module for XHTML + $Id: xhtml-blkphras-1.xsd,v 1.5 2005/09/26 23:37:47 ahby Exp $ + + + + + + Block Phrasal + This module declares the elements and their attributes used to + support block-level phrasal markup. + This is the XML Schema block phrasal elements module for XHTML + + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkpres-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkpres-1.xsd new file mode 100644 index 00000000..cf42303a --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkpres-1.xsd @@ -0,0 +1,37 @@ + + + + + + This is the XML SchemaBlock presentation element module for XHTML + $Id: xhtml-blkpres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + Block Presentational Elements + + * hr + + This module declares the elements and their attributes used to + support block-level presentational markup. + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkstruct-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkstruct-1.xsd new file mode 100644 index 00000000..1e658580 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-blkstruct-1.xsd @@ -0,0 +1,49 @@ + + + + + + Block Structural + + * div, p + + This module declares the elements and their attributes used to + support block-level structural markup. + + This is the XML Schema Block Structural module for XHTML + $Id: xhtml-blkstruct-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-csismap-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-csismap-1.xsd new file mode 100644 index 00000000..ac990661 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-csismap-1.xsd @@ -0,0 +1,96 @@ + + + + + + + Client-side Image Maps + This is the XML Schema Client-side Image Maps module for XHTML + + * area, map + + This module declares elements and attributes to support client-side + image maps. + + $Id: xhtml-csismap-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-datatypes-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-datatypes-1.xsd new file mode 100644 index 00000000..a924e3a1 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-datatypes-1.xsd @@ -0,0 +1,128 @@ + + + + + XHTML Datatypes + This is the XML Schema datatypes module for XHTML + + Defines containers for the XHTML datatypes, many of + these imported from other specifications and standards. + + $Id: xhtml-datatypes-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-edit-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-edit-1.xsd new file mode 100644 index 00000000..44380b23 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-edit-1.xsd @@ -0,0 +1,39 @@ + + + + + + + Editing Elements + This is the XML Schema Editing Markup module for XHTML + + * ins, del + + This module declares element types and attributes used to indicate + inserted and deleted content while editing a document. + + $Id: xhtml-edit-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-events-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-events-1.xsd new file mode 100644 index 00000000..381f6dd5 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-events-1.xsd @@ -0,0 +1,130 @@ + + + + + + + This is the XML Schema Intrinsic Events module for XHTML + $Id: xhtml-events-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + Intrinsic Event Attributes + These are the event attributes defined in HTML 4, + Section 18.2.3 "Intrinsic Events". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-form-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-form-1.xsd new file mode 100644 index 00000000..a46003b1 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-form-1.xsd @@ -0,0 +1,326 @@ + + + + + + + Forms + This is the XML Schema Forms module for XHTML + + * form, label, input, select, optgroup, option, + textarea, fieldset, legend, button + + This module declares markup to provide support for online + forms, based on the features found in HTML 4.0 forms. + + + $Id: xhtml-form-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-framework-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-framework-1.xsd new file mode 100644 index 00000000..05b906d4 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-framework-1.xsd @@ -0,0 +1,66 @@ + + + + + This is the XML Schema Modular Framework support module for XHTML + $Id: xhtml-framework-1.xsd,v 1.5 2005/09/26 23:37:47 ahby Exp $ + + + + + + XHTML Modular Framework + This required module instantiates the necessary modules + needed to support the XHTML modularization framework. + + The Schema modules instantiated are: + + notations + + datatypes + + common attributes + + character entities + + + + + + + + This module defines XHTML Attribute DataTypes + + + + + + + + This module defines Common attributes for XHTML + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-hypertext-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-hypertext-1.xsd new file mode 100644 index 00000000..2f4c81bc --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-hypertext-1.xsd @@ -0,0 +1,47 @@ + + + + + + + Hypertext Module + This is the XML Schema Hypertext module for XHTML + + * a + + This module declares the anchor ('a') element type, which + defines the source of a hypertext link. The destination + (or link 'target') is identified via its 'id' attribute + rather than the 'name' attribute as was used in HTML. + + $Id: xhtml-hypertext-1.xsd,v 1.4 2005/09/26 23:37:47 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-image-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-image-1.xsd new file mode 100644 index 00000000..cd16bc9b --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-image-1.xsd @@ -0,0 +1,45 @@ + + + + + + + Images + This is the XML Schema Images module for XHTML + + * img + + This module provides markup to support basic image embedding. + + To avoid problems with text-only UAs as well as to make + image content understandable and navigable to users of + non-visual UAs, you need to provide a description with + the 'alt' attribute, and avoid server-side image maps. + + + $Id: xhtml-image-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlphras-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlphras-1.xsd new file mode 100644 index 00000000..919c59de --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlphras-1.xsd @@ -0,0 +1,163 @@ + + + + + + + This is the XML Schema Inline Phrasal support module for XHTML + $Id: xhtml-inlphras-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Phrasal. + This module declares the elements and their attributes used to + support inline-level phrasal markup. + This is the XML Schema Inline Phrasal module for XHTML + + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + $Id: xhtml-inlphras-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlpres-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlpres-1.xsd new file mode 100644 index 00000000..a053447c --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlpres-1.xsd @@ -0,0 +1,39 @@ + + + + + + This is the XML Schema Inline Presentation element module for XHTML + $Id: xhtml-inlpres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Presentational Elements + + * b, big, i, small, sub, sup, tt + + This module declares the elements and their attributes used to + support inline-level presentational markup. + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstruct-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstruct-1.xsd new file mode 100644 index 00000000..635eb5f1 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstruct-1.xsd @@ -0,0 +1,50 @@ + + + + + + This is the XML Schema Inline Structural support module for XHTML + $Id: xhtml-inlstruct-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Structural. + This module declares the elements and their attributes + used to support inline-level structural markup. + This is the XML Schema Inline Structural element module for XHTML + + * br, span + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstyle-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstyle-1.xsd new file mode 100644 index 00000000..ef93c2dc --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-inlstyle-1.xsd @@ -0,0 +1,27 @@ + + + + + + Inline Style module + This is the XML Schema Inline Style module for XHTML + + * styloe attribute + + This module declares the 'style' attribute, used to support inline + style markup. + + $Id: xhtml-inlstyle-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-link-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-link-1.xsd new file mode 100644 index 00000000..f210d84a --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-link-1.xsd @@ -0,0 +1,45 @@ + + + + + + This is the XML Schema Link Element module for XHTML + $Id: xhtml-link-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Link element + + * link + + This module declares the link element type and its attributes, + which could (in principle) be used to define document-level links + to external resources. + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-list-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-list-1.xsd new file mode 100644 index 00000000..cc22ba88 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-list-1.xsd @@ -0,0 +1,99 @@ + + + + + + List Module + This is the XML Schema Lists module for XHTML + List Module Elements + + * dl, dt, dd, ol, ul, li + + This module declares the list-oriented element types + and their attributes. + $Id: xhtml-list-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-meta-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-meta-1.xsd new file mode 100644 index 00000000..2ad6dc55 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-meta-1.xsd @@ -0,0 +1,42 @@ + + + + + + + This is the XML Schema Metainformation module for XHTML + $Id: xhtml-meta-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Meta Information + + * meta + + This module declares the meta element type and its attributes, + used to provide declarative document metainformation. + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-object-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-object-1.xsd new file mode 100644 index 00000000..a32efb0f --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-object-1.xsd @@ -0,0 +1,76 @@ + + + + + + + This is the XML Schema Embedded Object module for XHTML + $Id: xhtml-object-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + This module declares the object element type and its attributes, + used to embed external objects as part of XHTML pages. In the + document, place param elements prior to the object elements + that require their content. + + Note that use of this module requires instantiation of the + Param Element Module prior to this module. + + Elements defined here: + + * object (param) + + + + + + + Param module + + Elements defined here: + * param + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-param-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-param-1.xsd new file mode 100644 index 00000000..ba34ff41 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-param-1.xsd @@ -0,0 +1,51 @@ + + + + + + This is the XML Schema Param Element module for XHTML + $Id: xhtml-param-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + Parameters for Java Applets and Embedded Objects + + * param + + This module provides declarations for the param element, + used to provide named property values for the applet + and object elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-pres-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-pres-1.xsd new file mode 100644 index 00000000..bc36fc48 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-pres-1.xsd @@ -0,0 +1,51 @@ + + + + + + This is the XML Schema Presentation module for XHTML + This is a REQUIRED module. + $Id: xhtml-pres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Presentational Elements + + This module defines elements and their attributes for + simple presentation-related markup. + + Elements defined here: + + * hr + * b, big, i, small, sub, sup, tt + + + + + + + Block Presentational module + Elements defined here: + + * hr + + + + + + + Inline Presentational module + Elements defined here: + + * b, big, i, small, sub, sup, tt + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ruby-basic-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ruby-basic-1.xsd new file mode 100644 index 00000000..436a242c --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ruby-basic-1.xsd @@ -0,0 +1,89 @@ + + + + + + This is the XML Schema module for Ruby Basic. + $Id: xhtml-ruby-basic-1.xsd,v 1.6 2005/09/26 22:54:53 ahby Exp $ + + + + + + "Ruby" are short runs of text alongside the base text, typically + used in East Asian documents to indicate pronunciation or to + provide a short annotation. The full specification for Ruby is here: + + http://www.w3.org/TR/2001/REC-ruby-20010531/ + + This module defines "Ruby Basic" or "simple Ruby" as described + in the specification: + + http://www.w3.org/TR/ruby/#simple-ruby1 + + This module declares the elements and their attributes used to + support simple ruby annotation markup. Elements defined here are + * ruby, rb, rt, rp + Ruby Basic does not use the rbc or rtc elements. + The content of the ruby element for Ruby Basic + uses the rp element for fallback purposes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-script-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-script-1.xsd new file mode 100644 index 00000000..382cf987 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-script-1.xsd @@ -0,0 +1,70 @@ + + + + + + This is the XML Schema Scripting module for XHTML + $Id: xhtml-script-1.xsd,v 1.4 2005/09/26 23:37:47 ahby Exp $ + + + + + + Scripting + + * script, noscript + + This module declares element types and attributes used to provide + support for executable scripts as well as an alternate content + container where scripts are not supported. + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ssismap-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ssismap-1.xsd new file mode 100644 index 00000000..4e120107 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-ssismap-1.xsd @@ -0,0 +1,43 @@ + + + + + + This is the XML Schema Server-side Image Maps module for XHTML + $Id: xhtml-ssismap-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + Server-side Image Maps + + This adds the 'ismap' attribute to the img element to + support server-side processing of a user selection. + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-struct-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-struct-1.xsd new file mode 100644 index 00000000..dfc711ec --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-struct-1.xsd @@ -0,0 +1,112 @@ + + + + + + This is the XML Schema Document Structure module for XHTML + Document Structure + + * title, head, body, html + + The Structure Module defines the major structural elements and + their attributes. + + $Id: xhtml-struct-1.xsd,v 1.6 2005/10/20 14:14:39 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-style-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-style-1.xsd new file mode 100644 index 00000000..3fc1d224 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-style-1.xsd @@ -0,0 +1,52 @@ + + + + + + + This is the XML Schema Stylesheets module for XHTML + $Id: xhtml-style-1.xsd,v 1.4 2005/09/26 23:37:47 ahby Exp $ + + + + + + Stylesheets + + * style + + This module declares the style element type and its attributes, + used to embed stylesheet information in the document head element. + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-table-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-table-1.xsd new file mode 100644 index 00000000..ec76db3c --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-table-1.xsd @@ -0,0 +1,272 @@ + + + + + + + This is the XML Schema Tables module for XHTML + $Id: xhtml-table-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + Tables + + * table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td + + This module declares element types and attributes used to provide + table markup similar to HTML 4.0, including features that enable + better accessibility for non-visual user agents. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-text-1.xsd b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-text-1.xsd new file mode 100644 index 00000000..432bdad7 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/xbrl/xhtml/xhtml-text-1.xsd @@ -0,0 +1,67 @@ + + + + + + Textual Content + This is the XML Schema Text module for XHTML + + The Text module includes declarations for all core + text container elements and their attributes. + + + block phrasal + + block structural + + inline phrasal + + inline structural + + $Id: xhtml-text-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + Block Phrasal module + Elements defined here: + + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + + + + + + Block Structural module + Elements defined here: + + * div, p + + + + + + + Inline Phrasal module + Elements defined here: + + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + + + + + + Inline Structural module + Elements defined here: + + * br,span + + + + diff --git a/XmlSchemaClassGenerator/ModelBuilder.cs b/XmlSchemaClassGenerator/ModelBuilder.cs index 8d0e28e2..1ada8db7 100644 --- a/XmlSchemaClassGenerator/ModelBuilder.cs +++ b/XmlSchemaClassGenerator/ModelBuilder.cs @@ -744,8 +744,12 @@ private static List EnsureEnumValuesUnique(List return enumModelValues; } - private IEnumerable CreatePropertiesForAttributes(Uri source, TypeModel typeModel, IEnumerable items) + private IEnumerable CreatePropertiesForAttributes(Uri source, TypeModel typeModel, IEnumerable items, + List processedItems = null) { + processedItems ??= new(); + processedItems.AddRange(items); + var properties = new List(); foreach (var item in items) @@ -831,8 +835,8 @@ private IEnumerable CreatePropertiesForAttributes(Uri source, Typ CreateTypeModel(AttributeGroups[attributeGroupRef.RefName], attributeGroupRef.RefName); } - var groupItems = AttributeGroups[attributeGroupRef.RefName].Attributes; - var groupProperties = CreatePropertiesForAttributes(source, typeModel, groupItems.Cast()); + var groupItems = AttributeGroups[attributeGroupRef.RefName].Attributes.Cast().Except(processedItems).ToList(); + var groupProperties = CreatePropertiesForAttributes(source, typeModel, groupItems, processedItems); properties.AddRange(groupProperties); } } @@ -841,11 +845,14 @@ private IEnumerable CreatePropertiesForAttributes(Uri source, Typ } private IEnumerable CreatePropertiesForElements(Uri source, TypeModel typeModel, Particle particle, IEnumerable items, - Substitute substitute = null, int order = 0) + Substitute substitute = null, int order = 0, List processedItems = null) { var properties = new List(); var xmlParticle = particle.XmlParticle; + processedItems ??= new(); + processedItems.AddRange(items); + foreach (var item in items) { PropertyModel property = null; @@ -938,8 +945,8 @@ private IEnumerable CreatePropertiesForElements(Uri source, TypeM CreateTypeModel(group, groupRef.RefName); } - var groupItems = GetElements(group.Particle); - var groupProperties = CreatePropertiesForElements(source, typeModel, item, groupItems, order: order).ToList(); + var groupItems = GetElements(group.Particle).Where(p => !processedItems.Any(q => p.XmlParticle == q.XmlParticle)).ToList(); + var groupProperties = CreatePropertiesForElements(source, typeModel, item, groupItems, order: order, processedItems: processedItems).ToList(); if (_configuration.EmitOrder) { order += groupProperties.Count; diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index 408f4045..e0713f47 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -237,16 +237,21 @@ public override CodeTypeDeclaration Generate() return interfaceDeclaration; } - public IEnumerable AllDerivedReferenceTypes() + public IEnumerable AllDerivedReferenceTypes(List processedTypeModels = null) { - foreach (var interfaceModelDerivedType in DerivedTypes) + processedTypeModels ??= new(); + + foreach (var interfaceModelDerivedType in DerivedTypes.Except(processedTypeModels)) { yield return interfaceModelDerivedType; + + processedTypeModels.Add(interfaceModelDerivedType); + switch (interfaceModelDerivedType) { case InterfaceModel derivedInterfaceModel: { - foreach (var referenceTypeModel in derivedInterfaceModel.AllDerivedReferenceTypes()) + foreach (var referenceTypeModel in derivedInterfaceModel.AllDerivedReferenceTypes(processedTypeModels)) { yield return referenceTypeModel; } @@ -578,10 +583,12 @@ public void AddInterfaces(IEnumerable interfaces) { foreach (var interfaceModel in interfaces) { - Interfaces.Add(interfaceModel); - interfaceModel.DerivedTypes.Add(this); + if (!Interfaces.Contains(interfaceModel) && interfaceModel != this) + { + Interfaces.Add(interfaceModel); + interfaceModel.DerivedTypes.Add(this); + } } - } }