Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2006

Tip: Looking for answers? Try searching our database.

add nillable element to IXMLDOMDocument

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DolceVita - 04 Apr 2006 10:49 GMT
Hi,

I code in C#

What I try to do is load a xml in string in a IXMLDOMDocument and that
make a validation error:

the attribute xsi:nil on "Date" element is not valid!

What I try to insert is a nillable element my schema in infopath accept
this no problem but if I try to load that in my IXMLDOMDocument I have
an error!

My code:

IXMLDOMDocument AVxml = (IXMLDOMDocument)thisXDocument.CreateDOM();
AVxml.loadXML("<AV xmlns=''
xmlns:tsd='http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition'

xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<AVel >
<Title>Statutendatum</Title>
<Date xsi:nil='true'/>
</AVel>
</AV>");

What I need to make for that don't make me this error of parsing?

Thanks a lot
S.Y.M. Wong-A-Ton - 04 Apr 2006 14:40 GMT
Not sure why it isn't working, but I suspect that it's a namespace issue. You
could try loading the XML without the attribute, and then afterwards use
"setAttribute" to set the attribute and its value. Do something like the
following after the loadXML:

((IXMLDOMElement)AVxml.selectSingleNode("//Date")).setAttribute("xsi:nil",
"true");
---
S.Y.M. Wong-A-Ton

> Hi,
>
[quoted text clipped - 25 lines]
>
> Thanks a lot
DolceVita - 10 Apr 2006 07:01 GMT
Hi,

Thanks for this!

++

Thierry
DolceVita - 18 Apr 2006 14:13 GMT
Hi,

Your idea is good but that don't satisfy me for a lot of reason!

I don't want to change my xml 20 times before and after the load in the
IXMLDOMDocument. It's not really good for the performance of my form.

I Have seen in debug mode (Visual studio 2005) when I try to load this
XMLDocument in my IXMLDOMDocument:

- parseError =
{Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMParseErrorWrapper}
    errorCode = -1072897995
    reason = "the xsi:nil attribut on the « Date » element isn't
valid.\r\n"

So how I can correct this? I need to declare a namespace in my
IXMLDOMDocument before load the other XML ?

Thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.