Skip to content

The 'xmlns' attribute is bound to the reserved namespace 'http://www.w3.org/2000/xmlns/' #8

@dgil-unedbarbastro

Description

@dgil-unedbarbastro

Hi,
I'm trying to use the ONIX-Data parser with ONIX files from a provider and I'm getting this exception:

  Message: 
    System.ArgumentException : The 'xmlns' attribute is bound to the reserved namespace 'http://www.w3.org/2000/xmlns/'.
  Stack Trace: 
    XmlTextWriter.WriteStartAttribute(String prefix, String localName, String ns)
    XmlDOMTextWriter.WriteStartAttribute(String prefix, String localName, String ns)
    XmlAttribute.WriteTo(XmlWriter w)
    XmlElement.WriteStartElement(XmlWriter w)
    XmlElement.WriteElementTo(XmlWriter writer, XmlElement el)
    XmlElement.WriteTo(XmlWriter w)
    XmlNode.get_OuterXml()
    OnixEnumerator.MoveNext()
    MyService.ParseOnixFile(String filePath) line 42
    MyServiceTests.ParseOnixFile_ShouldReturnOK() line 34
    GenericAdapter`1.GetResult()
    AsyncToSyncAdapter.Await(Func`1 invoke)
    TestMethodCommand.RunTestMethod(TestExecutionContext context)
    TestMethodCommand.Execute(TestExecutionContext context)
    SimpleWorkItem.PerformWork()

The ONIXMessage and all Product xml nodes have the namespace attribute xmlns="http://ns.editeur.org/onix/3.0/reference":

image

If I remove all the xmlns attributes from the file then the parsing works.

I there some way to get the parse working without modifying the original ONIX files?

Thanks in advance.
Best Regards,
Dani

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions