Skip to content

Commit

Permalink
General fixes
Browse files Browse the repository at this point in the history
General fixes
  • Loading branch information
tviegut committed Feb 22, 2024
1 parent 0040764 commit bcc3e6e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 13 deletions.
24 changes: 24 additions & 0 deletions CIMToolPlugin/builders/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,29 @@
"style": "profile-doc-rtf",
"datetime": "2022-08-01T00:00:00Z",
"ext": "rtf"
},
"legacy-rdfs": {
"type": "TRANSFORM",
"style": "legacy-rdfs",
"datetime": "2024-01-29T00:00:00Z",
"ext": "legacy.rdfs"
},
"legacy-rdfs-augmented": {
"type": "TRANSFORM",
"style": "legacy-rdfs-augmented",
"datetime": "2024-01-29T00:00:00Z",
"ext": "legacy-augmented.rdfs"
},
"rdfs-augmented-cimcontextor": {
"type": "TRANSFORM",
"style": "rdfs-augmented-cimcontextor",
"datetime": "2024-01-29T00:00:00Z",
"ext": "augmented-cimcontextor.rdfs"
},
"rdfs-2020": {
"type": "TRANSFORM",
"style": "rdfs-2020",
"datetime": "2024-01-30T00:00:00Z",
"ext": "rdfs-2020.rdfs"
}
}
2 changes: 1 addition & 1 deletion CIMToolPlugin/builders/json-schema-draft-07-lite.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<!-- SimpleType(s) only contain a dataType attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@dataType"/>"</item>
</xsl:when>
<xsl:when test="self::a:EnumeratedType|self::a:ComplexType|self::a:Root">
<xsl:when test="self::a:EnumeratedType|self::a:CompoundType|self::a:ComplexType|self::a:Root">
<!-- ComplexType(s) and Root(s) only contain a baseClass attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@baseClass"/>"</item>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion CIMToolPlugin/builders/json-schema-draft-07.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<!-- SimpleType(s) only contain a dataType attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@dataType"/>"</item>
</xsl:when>
<xsl:when test="self::a:EnumeratedType|self::a:ComplexType|self::a:Root">
<xsl:when test="self::a:EnumeratedType|self::a:CompoundType|self::a:ComplexType|self::a:Root">
<!-- ComplexType(s) and Root(s) only contain a baseClass attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@baseClass"/>"</item>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion CIMToolPlugin/builders/json-schema-draft-2020-12-lite.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<!-- SimpleType(s) only contain a dataType attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@dataType"/>"</item>
</xsl:when>
<xsl:when test="self::a:EnumeratedType|self::a:ComplexType|self::a:Root">
<xsl:when test="self::a:EnumeratedType|self::a:CompoundType|self::a:ComplexType|self::a:Root">
<!-- ComplexType(s) and Root(s) only contain a baseClass attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@baseClass"/>"</item>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion CIMToolPlugin/builders/json-schema-draft-2020-12.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
<!-- SimpleType(s) only contain a dataType attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@dataType"/>"</item>
</xsl:when>
<xsl:when test="self::a:EnumeratedType|self::a:ComplexType|self::a:Root">
<xsl:when test="self::a:EnumeratedType|self::a:CompoundType|self::a:ComplexType|self::a:Root">
<!-- ComplexType(s) and Root(s) only contain a baseClass attribute representing modelReference -->
<item>"modelReference": "<xsl:value-of select="@baseClass"/>"</item>
</xsl:when>
Expand Down
30 changes: 21 additions & 9 deletions CIMToolPlugin/builders/profile-doc-rtf.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
</xsl:template>

<xsl:template match="a:Message">
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:value-of select="@name"/>}{\fs24 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:apply-templates mode="annotate-type" /><xsl:apply-templates />
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:apply-templates select="a:Stereotype"/><xsl:value-of select="@name"/>}{\fs24 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:apply-templates mode="annotate-type" /><xsl:apply-templates />
</xsl:template>

<xsl:template match="a:Root">
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:value-of select="@name"/>}{\fs24 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:call-template name="complex_type" />
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:apply-templates select="a:Stereotype"/><xsl:value-of select="@name"/>}{\fs24 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:call-template name="type_definition" />
</xsl:template>
<xsl:template name="complex_type"><xsl:apply-templates mode="annotate-type" />

<xsl:template name="type_definition"><xsl:if test="a:SuperType">\par\fs20 Inheritance path = <xsl:apply-templates select="a:SuperType" mode="inheritance_hierarchy" /></xsl:if><xsl:apply-templates mode="annotate-type" />
\par\pard\plain \sb120\qj\fs20\lang1033
<xsl:if test="a:Domain|a:Simple|a:Instance|a:Reference|a:Enumerated">{\par\b\fs20 Native Members\par}
\par
Expand Down Expand Up @@ -101,6 +101,10 @@
</xsl:if>
</xsl:template>

<xsl:template match="a:SuperType" mode="inheritance_hierarchy">{\field{\*\fldinst {\fs20 HYPERLINK \\l "<xsl:value-of select="@name"/>"}}{\fldrslt {\fs20\ul\cf1 <xsl:value-of select="@name"/>}}}
<xsl:variable name="supertype_name" select="@name"/><xsl:if test="/*/node()[@name = $supertype_name]/a:SuperType"> :: <xsl:apply-templates select="/*/node()[@name = $supertype_name]/a:SuperType" mode="inheritance_hierarchy"/></xsl:if>
</xsl:template>

<xsl:template match="a:Instance|a:Reference|a:Enumerated|a:Domain">
{
\trowd \trgaph70
Expand All @@ -112,7 +116,7 @@
\cellx4125
\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs
\cellx9500
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/><xsl:call-template name="process-attribute-stereotypes"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@minOccurs"/>..<xsl:choose><xsl:when test="@maxOccurs = 'unbounded'"><item>* </item></xsl:when><xsl:otherwise><xsl:value-of select="@maxOccurs"/></xsl:otherwise></xsl:choose> \cell}
{\pard \intbl \sb120\sa120\fs16 {\field{\*\fldinst {\fs16 HYPERLINK \\l "<xsl:value-of select="@type"/>"}}{\fldrslt {\fs16\ul\cf1 <xsl:value-of select="@type"/>}}} \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:apply-templates mode="annotate-table-row" /> \cell}
Expand All @@ -131,7 +135,7 @@
\cellx4125
\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs
\cellx9500
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/><xsl:call-template name="process-attribute-stereotypes"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@minOccurs"/>..<xsl:value-of select="@maxOccurs"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@xstype"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:apply-templates mode="annotate-table-row" /> \cell}
Expand Down Expand Up @@ -160,7 +164,7 @@
\cellx4125
\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs
\cellx9500
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/><xsl:call-template name="process-attribute-stereotypes"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@minOccurs"/>..<xsl:value-of select="@maxOccurs"/> \cell}
{\pard \intbl \sb120\sa120\fs16 {\field{\*\fldinst {\fs16 HYPERLINK \\l "<xsl:value-of select="@type"/>"}}{\fldrslt {\fs16\ul\cf1 <xsl:value-of select="@type"/>}}} \cell}
{\pard \intbl \sb120\sa120\fs16 see {\field{\*\fldinst {\fs16 HYPERLINK \\l "<xsl:value-of select="../@name"/>"}}{\fldrslt {\fs16\ul\cf1 <xsl:value-of select="../@name"/>}}} \cell}
Expand All @@ -179,7 +183,7 @@
\cellx4125
\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs
\cellx9500
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@name"/><xsl:call-template name="process-attribute-stereotypes"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@minOccurs"/>..<xsl:value-of select="@maxOccurs"/> \cell}
{\pard \intbl \sb120\sa120\fs16 <xsl:value-of select="@xstype"/> \cell}
{\pard \intbl \sb120\sa120\fs16 see {\field{\*\fldinst {\fs16 HYPERLINK \\l "<xsl:value-of select="../@name"/>"}}{\fldrslt {\fs16\ul\cf1 <xsl:value-of select="../@name"/>}}} \cell}
Expand All @@ -188,7 +192,7 @@
</xsl:template>

<xsl:template match="a:ComplexType">
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:value-of select="@name"/>}{\fs32 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:call-template name="complex_type" />
{\par\b\fs24 {\*\bkmkstart <xsl:value-of select="@name"/>}<xsl:value-of select="@name"/>}{\fs32 {\*\bkmkend <xsl:value-of select="@name"/>}}<xsl:call-template name="type_definition" />
</xsl:template>

<xsl:template match="a:CompoundType">
Expand Down Expand Up @@ -255,6 +259,14 @@
</xsl:template>

<!-- Templates for annotations supporting complex types... -->
<xsl:template match="a:Stereotype">
<xsl:if test="contains(., '#description')"><xsl:value-of select="concat('(', @label, ') ')"/></xsl:if>
</xsl:template>

<xsl:template name="process-attribute-stereotypes">
<xsl:if test="count(a:Stereotype[not(contains(., '#attribute')) and not(contains(., '#byreference'))]) > 0"> (<xsl:for-each select="a:Stereotype[not(contains(., '#attribute')) and not(contains(., '#byreference'))]"><xsl:value-of select="@label"/><xsl:if test="position()!=last()"><xsl:value-of select="', '"/></xsl:if></xsl:for-each>)</xsl:if>
</xsl:template>

<xsl:template match="a:Comment" mode="annotate-type">
{\par\pard\plain \sb120\qj\fs20\lang1033 <xsl:call-template name="replace-non-ascii"><xsl:with-param name="text" select="." /></xsl:call-template>}
</xsl:template>
Expand Down

0 comments on commit bcc3e6e

Please sign in to comment.