Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - RE: Validating XML Validating XMLTo: NULL Date: 1/2/2005 5:53:00 PM Hi, I am a an XML novice and have been trying to create an XSD to validate my XML file. I have used the VS.NET auto-generate feature but keep getting errors. I have an invalid element error for the AnalysisImport element and "The element cannot contain text or white space. Content model is empty" for the Analysis elements. I have included the original XML and generated XSD. Thanks Linda XML <?xml version="1.0" encoding="UTF-8" ?> <DataRoot xmlns:xsi="http://tempuri.org/JournalImport.xsd" xmlns="http://tempuri.org/JournalImport.xsd"> <JournalImport> <Description>over all desc</Description> <DateTransaction>2004-11-22</DateTransaction> <Reference>MAIN ENGINE REPAIRS</Reference> <Hyperlink>F:\Jobs\23\invoice72635.jpeg</Hyperlink> <DateEntered>2004-11-13</DateEntered> <LedgerImport> <Account>4000</Account> <DateTransaction>2004-11-22</DateTransaction> <Reference>Inv 72635</Reference> <Amount>100</Amount> <Description>specific Contractor ABS w/e</Description> <TransactionTypeID>JNL</TransactionTypeID> <Hyperlink>F:\Jobs\23\invoice72635.jpeg</Hyperlink> <Period>200401</Period> <AnalysisImport> <Analysis TypeID="Branch">Wollongong</Analysis> <Analysis TypeID="Client">ABC Pty Ltd</Analysis> <Analysis TypeID="Consultant">A N Consultant</Analysis> <Analysis TypeID="Contractor">T H Contractor</Analysis> <Analysis TypeID="Job">23</Analysis> <Analysis TypeID="Week">22</Analysis> </AnalysisImport> <AmountFX>100.0</AmountFX> <FX>USD</FX > </LedgerImport> </JournalImport> </DataRoot> XSD <?xml version="1.0" ?> <xs:schema id="JournalImportSchema" targetNamespace="http://tempuri.org/JournalImport.xsd" xmlns:mstns="http://tempuri.org/JournalImport.xsd" xmlns="http://tempuri.org/JournalImport.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified"> <xs:complexType name="DataRootType"> <xs:sequence> <xs:element name="JournalImport" type="mstns:JournalImportType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="JournalImportType"> <xs:sequence> <xs:element name="Description" type="xs:string" /> <xs:element name="DateTransaction" type="xs:date" /> <xs:element name="Reference" type="xs:string" /> <xs:element name="Hyperlink" type="xs:string" /> <xs:element name="DateEntered" type="xs:date" /> <xs:element name="LedgerImport" type="mstns:LedgerImportType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="LedgerImportType"> <xs:sequence> <xs:element name="Account" type="xs:string" /> <xs:element name="Period" type="xs:string" /> <xs:element name="DateTransaction" type="xs:date" /> <xs:element name="Reference" type="xs:string" /> <xs:element name="Amount" type="xs:decimal" /> <xs:element name="Description" type="xs:string" /> <xs:element name="TransactionTypeID" type="xs:string" /> <xs:element name="AmountFX" type="xs:string" /> <xs:element name="FX" type="xs:string" minOccurs="1" /> <xs:element name="Hyperlink" type="xs:string" /> <xs:element name="AnalysisImport" type="mstns:AnalysisImportType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="AnalysisImportType"> <xs:sequence> <xs:element name="Analysis" type="mstns:AnalysisType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="AnalysisType" mixed="true"> <xs:sequence></xs:sequence> <xs:attribute name="TypeID" form="unqualified" type="xs:string" /> </xs:complexType> <xs:element name="DataRoot" type="mstns:DataRootType" /> <xs:element name="JournalImportSchema" msdata:IsDataSet="true" msdata:Locale="en-AU" msdata:EnforceConstraints="False"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="DataRoot" /> </xs:choice> </xs:complexType> </xs:element> </xs:schema> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
