Skip to content

Commit

Permalink
removed 'html-version' since xhtml output is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtoroq committed Apr 17, 2022
1 parent 06fe847 commit b36590e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 25 deletions.
4 changes: 2 additions & 2 deletions schemas/xcst.rng
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,11 @@
<ann:documentation>Specifies whether to escape URI attributes in HTML documents.</ann:documentation>
<ref name="boolean"/>
</attribute>
<!--
<attribute name="html-version">
<ann:documentation>Specifies the HTML version.</ann:documentation>
<ref name="decimal"/>
</attribute>
<!--
<attribute name="include-content-type">
<ann:documentation>Specifies whether to include a meta element in the head of HTML documents, specifying the used character encoding.</ann:documentation>
<ref name="boolean"/>
Expand Down Expand Up @@ -1835,14 +1835,14 @@
<ref name="avt-expr"/>
</choice>
</attribute>
<!--
<attribute name="html-version">
<ann:documentation>Specifies the HTML version.</ann:documentation>
<choice>
<ref name="decimal"/>
<ref name="avt-expr"/>
</choice>
</attribute>
<!--
<attribute name="include-content-type">
<ann:documentation>Specifies whether to include a meta element in the head of HTML documents, specifying the used character encoding.</ann:documentation>
<choice>
Expand Down
13 changes: 0 additions & 13 deletions schemas/xcst.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,6 @@
<xs:documentation>Specifies whether to escape URI attributes in HTML documents.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="html-version" type="c:decimal">
<xs:annotation>
<xs:documentation>Specifies the HTML version.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="indent" type="c:boolean">
<xs:annotation>
<xs:documentation>Specifies whether to indent the output.</xs:documentation>
Expand Down Expand Up @@ -1810,14 +1805,6 @@
<xs:union memberTypes="c:boolean c:avt-expr"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="html-version">
<xs:annotation>
<xs:documentation>Specifies the HTML version. Attribute value template (decimal).</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="c:decimal c:avt-expr"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="indent">
<xs:annotation>
<xs:documentation>Specifies whether to indent the output. Attribute value template (boolean).</xs:documentation>
Expand Down
4 changes: 3 additions & 1 deletion src/Xcst.Compiler/CodeGeneration/_serialization.xcst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
{ "doctype-system", "DoctypeSystem" },
{ "encoding", "Encoding" },
{ "escape-uri-attributes", "EscapeUriAttributes" },
{ "html-version", "HtmlVersion" },
/*
{ "html-version", "HtmlVersion" },
{ "include-content-type", "IncludeContentType" },
*/
{ "indent", "Indent" },
Expand Down Expand Up @@ -343,12 +343,14 @@
</code:method-call>
</template>

<!--
<template match='XAttribute attr &amp;&amp; attr.Name == "html-version"' mode='src:output-parameter'>
<call-template name='src:decimal'>
<with-param name='val' value='xcst_decimal(attr, attr.Parent!.Name != c + "output")'/>
<with-param name='avt' value='attr'/>
</call-template>
</template>
-->

<template match='XAttribute attr &amp;&amp; attr.Name == "indent-spaces"' mode='src:output-parameter'>
<call-template name='src:integer'>
Expand Down
12 changes: 6 additions & 6 deletions src/Xcst.Runtime/OutputParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ public bool?
get => (bool?)this[StandardParameters.EscapeUriAttributes];
set => _parameters[StandardParameters.EscapeUriAttributes] = value;
}

/*
public decimal?
HtmlVersion {
get => (decimal?)this[StandardParameters.HtmlVersion];
set => _parameters[StandardParameters.HtmlVersion] = value;
}
/*
public bool?
IncludeContentType {
get => (bool?)this[StandardParameters.IncludeContentType];
Expand Down Expand Up @@ -214,7 +214,7 @@ internal void
internal decimal?
RequestedHtmlVersion() {

decimal? value = this.HtmlVersion;
decimal? value = null/*this.HtmlVersion*/;
decimal versionValue;

if (value != null
Expand Down Expand Up @@ -246,10 +246,10 @@ public static readonly QualifiedName

public static readonly QualifiedName
EscapeUriAttributes = new QualifiedName("escape-uri-attributes");

/*
public static readonly QualifiedName
HtmlVersion = new QualifiedName("html-version");
/*
public static readonly QualifiedName
IncludeContentType = new QualifiedName("include-content-type");
*/
Expand Down Expand Up @@ -296,8 +296,8 @@ public static QualifiedName
"doctype-system" => DoctypeSystem,
"encoding" => Encoding,
"escape-uri-attributes" => EscapeUriAttributes,
"html-version" => HtmlVersion,
/*
"html-version" => HtmlVersion,
"include-content-type" => IncludeContentType,
*/
"indent" => Indent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<c:module version='1.0' language='C#' xmlns:c='http://maxtoroq.github.io/XCST'>

<c:template name='foo'>
<c:serialize html-version='{5}'>
<c:serialize output-version='{5}'>
<foo>foo</foo>
</c:serialize>
</c:template>
Expand Down
4 changes: 2 additions & 2 deletions tests/Xcst.Tests/ValueTemplates/Attribute/decimal.c.xcst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<c:template name='c:initial-template'>
<c:set ref='Thread.CurrentThread.CurrentCulture' value='new CultureInfo("es")'/>
<c:variable name='htmlVersion' value='4.01m'/>
<c:serialize method='html' html-version='{htmlVersion}'/>
<c:result-document method='html' html-version='{htmlVersion}' output='TextWriter.Null'/>
<c:serialize method='html' output-version='{htmlVersion}'/>
<c:result-document method='html' output-version='{htmlVersion}' output='TextWriter.Null'/>
</c:template>

</c:module>

0 comments on commit b36590e

Please sign in to comment.