@@ -11,31 +11,51 @@ internal class IfcSchema_DocumentationGenerator
11
11
{
12
12
internal static string Execute ( Dictionary < string , typeMetadata > dataTypeDictionary )
13
13
{
14
- StringBuilder sb = new StringBuilder ( ) ;
15
14
var schemas = new string [ ] { "Ifc2x3" , "Ifc4" , "Ifc4x3" } ;
16
15
16
+ StringBuilder sbDataTypes = new StringBuilder ( ) ;
17
17
foreach ( var dataType in dataTypeDictionary . Values . OrderBy ( x=> x . Name ) )
18
18
{
19
19
var checks = schemas . Select ( x => dataType . Schemas . Contains ( x ) ? "✔️ " : "❌ " ) ;
20
+ sbDataTypes . AppendLine ( $ "| { dataType . Name , - 45 } | { string . Join ( " | " , checks ) , - 24 } | { dataType . XmlBackingType , - 21 } |") ;
21
+ }
22
+
20
23
21
- sb . AppendLine ( $ "| { dataType . Name , - 45 } | { string . Join ( " | " , checks ) , - 24 } | { dataType . XmlBackingType , - 21 } |") ;
24
+ StringBuilder sbXmlTypes = new StringBuilder ( ) ;
25
+ var xmlTypes = dataTypeDictionary . Values . Select ( x => x . XmlBackingType ) . Where ( str => ! string . IsNullOrWhiteSpace ( str ) ) . Distinct ( ) ;
26
+ foreach ( var dataType in xmlTypes . OrderBy ( x => x ) )
27
+ {
28
+ sbXmlTypes . AppendLine ( $ "| { dataType , - 11 } |") ;
22
29
}
23
-
30
+
24
31
var source = stub ;
25
- source = source . Replace ( $ "<PlaceHolderTable>", sb . ToString ( ) ) ;
32
+ source = source . Replace ( $ "<PlaceHolderDataTypes>", sbDataTypes . ToString ( ) . TrimEnd ( '\r ' , '\n ' ) ) ;
33
+ source = source . Replace ( $ "<PlaceHolderXmlTypes>", sbXmlTypes . ToString ( ) . TrimEnd ( '\r ' , '\n ' ) ) ;
26
34
return source ;
27
35
// Program.Message($"no change.", ConsoleColor.Green);
28
36
}
29
37
30
- private const string stub = @"# DataTypes
38
+ private const string stub = @"# Type constraining
39
+
40
+ ## DataTypes
31
41
32
42
Property dataTypes can be set to any values according to the following table.
33
43
34
44
Columns of the table determine the validity of the type depending on the schema version and the required `xs:base` type for any `xs:restriction` constraint.
35
45
36
46
| dataType | Ifc2x3 | Ifc4 | Ifc4x3 | Restriction base type |
37
47
| --------------------------------------------- | ------ | ------ | ------ | --------------------- |
38
- <PlaceHolderTable>
48
+ <PlaceHolderDataTypes>
49
+
50
+ ## XML base types
51
+
52
+ The list of valid XML base types for the `base` attribute of `xs:restriction` is:
53
+
54
+ | Base type |
55
+ | ----------- |
56
+ <PlaceHolderXmlTypes>
57
+
58
+ ## Notes
39
59
40
60
Please note, this document has been automatically generated via the IDS Audit Tool repository, any changes should be initiated there.
41
61
" ;
0 commit comments