Link to home
Start Free TrialLog in
Avatar of Starr Duskk
Starr DuskkFlag for United States of America

asked on

XML: incomplete content error

I am looking at this tutorial:
http://www.codeproject.com/KB/aspnet/xmlguestbook.aspx

The very last line:
</NewDataSet>

Gives this error:
The element 'NewDataSet' h as incplete content. List of possible elements expected: 'guestbook'.

What is wrong with this example? How do I fix it?

thanks.

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
    <xs:schema id="NewDataSet" xmlns=""
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element name="NewDataSet" msdata:IsDataSet="true">
            <xs:complexType>
                <xs:choice maxOccurs="unbounded">
                    <xs:element name="guestbook">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="id" msdata:AutoIncrement="true"
                                msdata:AutoIncrementSeed="1" type="xs:int" />
                                <xs:element name="datetime" type="xs:dateTime"
                                minOccurs="0" />
                                <xs:element name="author" type="xs:string"
                                minOccurs="0" />
                                <xs:element name="subject" type="xs:string"
                                minOccurs="0" />
                                <xs:element name="comments" type="xs:string"
                                minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:choice>
            </xs:complexType>
            <xs:unique name="Constraint1" msdata:PrimaryKey="true">
                <xs:selector xpath=".//guestbook" />
                <xs:field xpath="id" />
            </xs:unique>
        </xs:element>
    </xs:schema>
</NewDataSet>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aaron Jabamani
Aaron Jabamani
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
had the question open during dinner,
too late in the show :-)
Avatar of Starr Duskk

ASKER

I tried both, now I'm getting the error:
 
Value cannot be null. Parameter name: url
It is in this function:
    Sub PopulateDataSet()
        myDataSet = New DataSet()
        myDataSet.ReadXml(strFilePath, XmlReadMode.ReadSchema)
    End Sub
on this line:
 myDataSet.ReadXml(strFilePath, XmlReadMode.ReadSchema)
 
I'm not understanding how it is finding my dataset anyway. In his code, there is no reference to "NewDataSet" anywhere.
What directory do I put the .xsd file in? I have it in app_code/xmlSchemas.
thanks.
 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The strFilePath already has the servermappath previously set.
 strFilePath = Server.MapPath("guestbook.xml")
 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Okay, I'm going to close this out and start a new ticket. I'm getting more errors. But different.
thanks!