Closed ysavourel closed 5 years ago
I believe the issue is coming from the line below in XliffWriter.cs
if (!checkLocalOnly)
{
XmlConvert.VerifyNCName(prefix);
XmlConvert.VerifyName(ns); <-- issue
}
It should check for a valid URI rather than a valid XML name. See https://www.w3.org/TR/REC-xml-names/#concepts:
[Definition: An XML namespace is identified by a URI reference [RFC3986]; element and attribute names may be placed in an XML namespace using the mechanisms described in this specification.]
Thanks for reporting this issue. If you'd like to contribute a fix, please do so in your fork and create a pull request. Otherwise, we will log a bug and prioritize a fix appropriately.
When I read the file below, the Deserializer works fine. But if I try to serialize the document read, I get this error:
Unhandled Exception: Localization.Xliff.OM.Exceptions.InvalidXmlSpecifierException: A valid XML prefix, namespace, and local name must be specified for the entity named 'version'. ---> System.Xml.XmlException: The '/' character, hexadecimal value 0x2F, cannot be included in a name.
If I replace the '/' in the ITS namespace URI by '_' all works fine.
Here is the example file:
And here is the code: