这个Feed(它的snippit)需要看起来像这样:
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
我将如何添加到此C#代码中以添加额外的xmlns,xsi junk:
writer.WriteStartDocument(); writer.WriteStartElement("AmazonEnvelope");
没有它就拒绝这个饲料 –
解决方法
试试这个:
writer.WriteStartElement("AmazonEnvelope"); writer.WriteAttributeString( "xmlns","xsi",null,"http://www.w3.org/2001/XMLSchema-instance"); writer.WriteAttributeString( "xsi","noNamespaceSchemaLocation","amzn-envelope.xsd"); ... writer.WriteEndElement();