P
PeterB
When attempting to remove the xsi:nil attribute in IP2003, I receive the
following error:
System.Runtime.InteropServices.COMException
Exception from HRESULT: 0x80043001
at
Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMap.removeNamedItem(String name)
at
Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMapWrapper.removeNamedItem(String name)
at
ProductExpiryMaintenance.ProductExpiryMaintenance.ReplaceMainProductListWithSecondary()
at
ProductExpiryMaintenance.ProductExpiryMaintenance.OnLoad(DocReturnEvent e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)
This is the piece of code causing the issue:
IXMLDOMNode productListMain =
thisXDocument.DOM.selectSingleNode("//products/retail");
if (productListMain.attributes.getNamedItem("xsi:nil") != null)
{
productListMain.attributes.removeNamedItem("xsi:nil");
}
This is an example of XML:
<ns1roductExpiryMaintenance
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="http://Schemas.Company.productExpiryMaintenance"
xmlnsl="http://Schemas.DataServices.ProductList"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-09-04T09-41-22" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">
<companyLegalName></companyLegalName>
<contactName xsi:nil="true"></contactName>
<plroductList>
<companyCode></companyCode>
<documentRefNo xsi:nil="true"></documentRefNo>
<contractNo xsi:nil="true"></contractNo>
<products>
<retail xsi:nil="true"></retail>
<foodservice xsi:nil="true"></foodservice>
</products>
</plroductList>
...
</ns1roductExpiryMaintenance>
Anyone got any ideas what causes this?
(I've attempted to provide the selectionNamespaces for the "pl" namespace
prefix but with no luck).
Thanks.
following error:
System.Runtime.InteropServices.COMException
Exception from HRESULT: 0x80043001
at
Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMap.removeNamedItem(String name)
at
Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMapWrapper.removeNamedItem(String name)
at
ProductExpiryMaintenance.ProductExpiryMaintenance.ReplaceMainProductListWithSecondary()
at
ProductExpiryMaintenance.ProductExpiryMaintenance.OnLoad(DocReturnEvent e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)
This is the piece of code causing the issue:
IXMLDOMNode productListMain =
thisXDocument.DOM.selectSingleNode("//products/retail");
if (productListMain.attributes.getNamedItem("xsi:nil") != null)
{
productListMain.attributes.removeNamedItem("xsi:nil");
}
This is an example of XML:
<ns1roductExpiryMaintenance
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="http://Schemas.Company.productExpiryMaintenance"
xmlnsl="http://Schemas.DataServices.ProductList"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-09-04T09-41-22" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">
<companyLegalName></companyLegalName>
<contactName xsi:nil="true"></contactName>
<plroductList>
<companyCode></companyCode>
<documentRefNo xsi:nil="true"></documentRefNo>
<contractNo xsi:nil="true"></contractNo>
<products>
<retail xsi:nil="true"></retail>
<foodservice xsi:nil="true"></foodservice>
</products>
</plroductList>
...
</ns1roductExpiryMaintenance>
Anyone got any ideas what causes this?
(I've attempted to provide the selectionNamespaces for the "pl" namespace
prefix but with no luck).
Thanks.