Thank you again.-
I´m almost done, That works fine, but now I'm receiving an error message whe
try to do this:
XDocument.DOM.selectSingleNode("//my:group2/my:field1").text =
RefNodes[i].attributes[0].text;
The message is:
Element 'group2' is unexpected according to content of parent element
'{http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-15T04:09:05}myFields',
Expecting:{http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-15T04:09:05}group2.
myschema.xsd is:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema
targetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-15T04:09:05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-15T04:09:05"
xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="myFields">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:group2" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"
namespace="http://www.w3.org/XML/1998/namespace"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="group2">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:field1" minOccurs="0"/>
<xsd:element ref="my:field2" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="field1" type="xsd:string"/>
<xsd:element name="field2" type="xsd:string"/>
</xsd:schema>
What could be happend?
I don't see a difference.
> Instead of
>
[quoted text clipped - 71 lines]
> > > >
> > > > Could someboy help me with some code to resolve this?
S.Y.M. Wong-A-Ton - 17 Mar 2006 17:48 GMT
Not sure what might have gone wrong. I myself have never gotten an error like
that. The code looks fine to me. Perhaps you can search on Google and see if
you can find something on it?
---
S.Y.M. Wong-A-Ton
> Thank you again.-
>
[quoted text clipped - 121 lines]
> > > > >
> > > > > Could someboy help me with some code to resolve this?
S.Y.M. Wong-A-Ton - 19 Mar 2006 19:40 GMT
Encountered this error myself now. It occurs when you are trying to add an
XML node to the schema while the schema expects a node of a different type.
Are you trying to insert or add nodes anywhere in your code? Or did you
manually edit the form files? If you aren't or haven't, I would recommend
recreating your form from scratch, so start over with a new form.
---
S.Y.M. Wong-A-Ton
> Thank you again.-
>
[quoted text clipped - 121 lines]
> > > > >
> > > > > Could someboy help me with some code to resolve this?