16 private readonly
string encapsulatingNamespace;
17 private readonly
string language =
null;
18 private string normalizedXml =
null;
34 public XmlLiteral(IEnumerable
Value,
string EncapsulatingNamespace,
string Language)
37 this.encapsulatingNamespace = EncapsulatingNamespace;
38 this.language = Language;
41 private static string ToString(IEnumerable List)
43 StringBuilder sb =
new StringBuilder();
45 foreach (XmlNode N
in List)
46 sb.Append(N.OuterXml);
61 this.encapsulatingNamespace = EncapsulatingNamespace;
62 this.language = Language;
82 return Grade.NotAtAll;
123 if (this.normalizedXml is
null)
127 this.normalizedXml = State.
ToString();
130 return this.normalizedXml;
141 if (this.language != Typed.language)
144 s2 = Typed.NormalizedXml;
148 if (this.language != Custom.Language)
153 XmlDocument Doc =
XML.
ParseXml(
"<root>" + Custom.StringValue +
"</root>",
true);
174 Result ^= Result << 5 ^ (this.language?.GetHashCode() ?? 0);
181 StringBuilder sb =
new StringBuilder();
187 if (!
string.IsNullOrEmpty(this.language))
190 sb.Append(this.language);
194 sb.Append(this.StringType);
197 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..
static readonly string TypeUri
http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
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()
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.
static readonly Uri XMLLiteral
URI representing rdf:XMLLiteral
Helps with common XML-related tasks.
static string NormalizeXml(string Xml)
Normalizes XML in string form.
static XmlDocument ParseXml(string Xml)
Parses an XML Document from its string representation.
Current state of XML normalization process.
override string ToString()
XML output.
Interface for semantic literals.