Schema validation found non-data type errors

E

erugalatha

Hello,

I have a form with 4 dropdowns on it. I want the first 3 to filter the 4th
when items are selected in them. I am looking up to a SharePoint List and I
can get the List Items to come back into an SPListItemCollection.

I'm stuck on getting the SPListItemCollection ListItems to populate into my
Dropdown list box. I can see my list items are populated into the questions
SPListItemCollection from my function called PopulateQuestions. On the first
step through of the code it works but when it steps into the second ListItem
in questions I get the following error in debug:

NOTE: the dropdown is a string datatype.

System.InvalidOperationException was caught
Message="Schema validation found non-data type errors."
Source="Microsoft.Office.InfoPath.Client.Internal.Host.Interop"
StackTrace:
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromMsxmlInteropError(MsxmlInteropError eError)
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromHresult(Int32 hrError)
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.InsertBefore(String
strXml, MsxmlNode refChild)
at Microsoft.Office.InfoPath.MsxmlWriter.Close()
at System.Xml.XmlWellFormedWriter.Close()
at System.Xml.XPath.XPathNavigator.InsertAfter(XmlReader newSibling)
at System.Xml.XPath.XPathNavigator.InsertAfter(XPathNavigator
newSibling)
at GlanbiaGIIAuditForm.FormCode.InternalStartup() in
C:\Projects\Form\Form\FormCode.cs:line 71

Here is my code:

try
{
//CALL THE FUNCTION TO POPULATE THE QUESTIONS DROPDOWN
SPListItemCollection questions =
PopulateQuestions(nodeLocation.Value.ToString(), nodeArea.Value.ToString(),
nodeType.Value.ToString());

//SET UP NODE TO ALLOW CLONE OF THE nodeQuestions NODE
XPathNavigator nodeQClone = null;

//FILL THE QUESTIONS DROPDOWN WITH THE DATA RETURNED
if (questions != null)
{
foreach (SPListItem ListItem in questions)
{

nodeQClone = nodeQuestionList.Clone();

nodeQClone.SelectSingleNode("/my:thing/my:questions/my:question",
this.NamespaceManager).SetValue(Convert.ToString(ListItem["Title"]));

nodeQuestionList.InsertAfter(nodeQClone);

if (questions.Count > 0)
//DELETE THE PARENT NODE TO REMOVE DUPLICATE ENTRY
nodeQuestionList.DeleteSelf();
}
}
}

Do you know where I'm going wrong?
 
E

erugalatha

Hi Anuma,

The best way I've found to do this is the following:

http://www.sharepoint-tips.com/2007/01/infopath-form-services-implementing.html

Both those other methods did not work for me and the Microsoft supplied
GETLISTITEMS() web service is useless.

Regards,
Joe

Anuma(GGK Tech) said:
Hi,

Can you verify these links.

http://www.bizsupportonline.net/inf...populate-drop-down-list-box-infopath-2007.htm

http://blueinfopath.blogspot.com/2008/11/cascading-drop-downs-in-infopath-web.html


--
Anuma Reddy/ http://www.GGKTech.com



erugalatha said:
Hello,

I have a form with 4 dropdowns on it. I want the first 3 to filter the 4th
when items are selected in them. I am looking up to a SharePoint List and I
can get the List Items to come back into an SPListItemCollection.

I'm stuck on getting the SPListItemCollection ListItems to populate into my
Dropdown list box. I can see my list items are populated into the questions
SPListItemCollection from my function called PopulateQuestions. On the first
step through of the code it works but when it steps into the second ListItem
in questions I get the following error in debug:

NOTE: the dropdown is a string datatype.

System.InvalidOperationException was caught
Message="Schema validation found non-data type errors."
Source="Microsoft.Office.InfoPath.Client.Internal.Host.Interop"
StackTrace:
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromMsxmlInteropError(MsxmlInteropError eError)
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromHresult(Int32 hrError)
at
Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.InsertBefore(String
strXml, MsxmlNode refChild)
at Microsoft.Office.InfoPath.MsxmlWriter.Close()
at System.Xml.XmlWellFormedWriter.Close()
at System.Xml.XPath.XPathNavigator.InsertAfter(XmlReader newSibling)
at System.Xml.XPath.XPathNavigator.InsertAfter(XPathNavigator
newSibling)
at GlanbiaGIIAuditForm.FormCode.InternalStartup() in
C:\Projects\Form\Form\FormCode.cs:line 71

Here is my code:

try
{
//CALL THE FUNCTION TO POPULATE THE QUESTIONS DROPDOWN
SPListItemCollection questions =
PopulateQuestions(nodeLocation.Value.ToString(), nodeArea.Value.ToString(),
nodeType.Value.ToString());

//SET UP NODE TO ALLOW CLONE OF THE nodeQuestions NODE
XPathNavigator nodeQClone = null;

//FILL THE QUESTIONS DROPDOWN WITH THE DATA RETURNED
if (questions != null)
{
foreach (SPListItem ListItem in questions)
{

nodeQClone = nodeQuestionList.Clone();

nodeQClone.SelectSingleNode("/my:thing/my:questions/my:question",
this.NamespaceManager).SetValue(Convert.ToString(ListItem["Title"]));

nodeQuestionList.InsertAfter(nodeQClone);

if (questions.Count > 0)
//DELETE THE PARENT NODE TO REMOVE DUPLICATE ENTRY
nodeQuestionList.DeleteSelf();
}
}
}

Do you know where I'm going wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top