Skip to content

Commit 850abe5

Browse files
committed
Added list of XML base types to DataTypes.md
1 parent 8e9d212 commit 850abe5

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

ids-lib.codegen/IfcSchema_DocumentationGenerator.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,51 @@ internal class IfcSchema_DocumentationGenerator
1111
{
1212
internal static string Execute(Dictionary<string, typeMetadata> dataTypeDictionary)
1313
{
14-
StringBuilder sb = new StringBuilder();
1514
var schemas = new string[] { "Ifc2x3", "Ifc4", "Ifc4x3" };
1615

16+
StringBuilder sbDataTypes = new StringBuilder();
1717
foreach (var dataType in dataTypeDictionary.Values.OrderBy(x=>x.Name))
1818
{
1919
var checks = schemas.Select(x => dataType.Schemas.Contains(x) ? "✔️ " : "❌ ");
20+
sbDataTypes.AppendLine($"| {dataType.Name,-45} | {string.Join(" | ", checks),-24} | {dataType.XmlBackingType,-21} |");
21+
}
22+
2023

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} |");
2229
}
23-
30+
2431
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'));
2634
return source;
2735
// Program.Message($"no change.", ConsoleColor.Green);
2836
}
2937

30-
private const string stub = @"# DataTypes
38+
private const string stub = @"# Type constraining
39+
40+
## DataTypes
3141
3242
Property dataTypes can be set to any values according to the following table.
3343
3444
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.
3545
3646
| dataType | Ifc2x3 | Ifc4 | Ifc4x3 | Restriction base type |
3747
| --------------------------------------------- | ------ | ------ | ------ | --------------------- |
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
3959
4060
Please note, this document has been automatically generated via the IDS Audit Tool repository, any changes should be initiated there.
4161
";

ids-lib.codegen/buildingSMART/DataTypes.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# DataTypes
1+
# Type constraining
2+
3+
## DataTypes
24

35
Property dataTypes can be set to any values according to the following table.
46

@@ -399,5 +401,21 @@ Columns of the table determine the validity of the type depending on the schema
399401
| IFCWORKSCHEDULETYPEENUM || ✔️ | ✔️ | xs:string |
400402
| IFCYEARNUMBER | ✔️ ||| xs:integer |
401403

404+
## XML base types
405+
406+
The list of valid XML base types for the `base` attribute of `xs:restriction` is:
407+
408+
| Base type |
409+
| ----------- |
410+
| xs:boolean |
411+
| xs:date |
412+
| xs:dateTime |
413+
| xs:double |
414+
| xs:duration |
415+
| xs:integer |
416+
| xs:string |
417+
| xs:time |
418+
419+
## Notes
402420

403421
Please note, this document has been automatically generated via the IDS Audit Tool repository, any changes should be initiated there.

0 commit comments

Comments
 (0)