PhoenixmlDb.XSLT
XmlSourceReader
Reads an XML file as text, honouring the encoding it declares.
#XmlSourceReader
Namespace: PhoenixmlDb.Xslt
Reads an XML file as text, honouring the encoding it declares.
File.ReadAllText assumes UTF-8. An XML file that declares another encoding — and the W3C XSLT corpus has many in ISO-8859-1 — decodes to U+FFFD replacement characters, after which the parser reports something unrelated:
Error: Name cannot begin with the '�' character, hexadecimal value 0xFFFD.
That is what the xslt tool did with any non-UTF-8 stylesheet or source, so a perfectly valid document failed to transform with a message pointing at its own mangling. The conformance harness has always done this correctly, which is why the corpus ran and the shipped tool did not.
This lives in the engine rather than the CLI so there is ONE implementation. A second copy of an engine behaviour drifting from the first has been the most expensive class of bug in this codebase.
#Methods
#Decode(Byte[])
Decodes XML bytes per their BOM or declaration. Exposed for callers holding bytes.
#ReadAsync(String,Threading.CancellationToken)
Reads
, decoding it per its BOM or XML declaration.