2using System.Collections;
15 private readonly
string encapsulatingNamespace;
16 private readonly
string language =
null;
17 private string normalizedXml =
null;
33 public XmlLiteral(IEnumerable
Value,
string EncapsulatingNamespace,
string Language)
36 this.encapsulatingNamespace = EncapsulatingNamespace;
37 this.language = Language;
40 private static string ToString(IEnumerable List)
42 StringBuilder sb =
new StringBuilder();
44 foreach (XmlNode N
in List)
45 sb.Append(N.OuterXml);
60 this.encapsulatingNamespace = EncapsulatingNamespace;
61 this.language = Language;
67 public const string TypeUri =
"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral";
81 return Grade.NotAtAll;
105 XmlDocument Doc =
new XmlDocument()
107 PreserveWhitespace =
true
127 if (this.normalizedXml is
null)
131 this.normalizedXml = State.
ToString();
134 return this.normalizedXml;
145 if (this.language != Typed.language)
148 s2 = Typed.NormalizedXml;
152 if (this.language != Custom.Language)
157 XmlDocument Doc =
new XmlDocument()
159 PreserveWhitespace =
true
161 Doc.LoadXml(
"<root>" + Custom.StringValue +
"</root>");
182 Result ^= Result << 5 ^ (this.language?.GetHashCode() ?? 0);
189 StringBuilder sb =
new StringBuilder();
195 if (!
string.IsNullOrEmpty(this.language))
198 sb.Append(this.language);
202 sb.Append(this.StringType);
205 return sb.ToString();
Helps with common JSON-related tasks.
static string Encode(string s)
Encodes a string for inclusion in JSON.
Represents a custom literal.
override string StringType
Type name
Represents a string literal.
Represents an XML literal.
override ISemanticLiteral Parse(string Value, string DataType, string Language)
Tries to parse a string value of the type supported by the class..
override Grade Supports(Type ValueType)
How well the type supports a given value type.
XmlLiteral(XmlNodeList Value, string EncapsulatingNamespace, string StringValue, string Language)
Represents a Uri literal.
XmlLiteral()
Represents an XML literal.
override string StringType
Type name
override int GetHashCode()
const string TypeUri
http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
override string ToString()
override ISemanticLiteral Encapsulate(object Value)
Encapsulates an object value as a semantic literal value.
XmlLiteral(IEnumerable Value, string EncapsulatingNamespace, string Language)
Represents an XML literal.
string NormalizedXml
Normalized XML
override bool Equals(object obj)
Abstract base class for semantic literal values.
string StringValue
String representation of value.
object Value
Parsed value.
Helps with common XML-related tasks.
static string NormalizeXml(XmlNodeList Xml)
Normalizes a list of XML nodes.
Current state of XML normalization process.
override string ToString()
XML output.
Interface for semantic literals.