Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Validating XML against Schema >Thread Next - Re: Validating XML against Schema Re: Validating XML against SchemaTo: NULL Date: 7/2/2004 5:04:00 PM Sorry, I misread your example. I could have sworn accountInformationUpdate.xsd had a target namespace. Since it doesn't, you can just change the include back to an import and your instance can look like this: <?xml version="1.0" encoding="UTF-8"?> <AccountUpdate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="accountInformationUpdate.xsd"> <AccountInformation> ... </AccountUpdate> None of the elements are in a namespace, because AccountUpdate is declared in a schema with no target namespace, and the rest are locally declared and hence not in a namespace. Since none of the elements are in a namespace, you don't even need to declare the namespace in the instance XML. This validates in Xerces-J. I don't use .NET, so I'm not sure what it will do there, but it should work. Priscilla -- ------------------------------------------------------------------ Priscilla Walmsley Author, Definitive XML Schema / XML in Office 2003 http://www.datypic.com ------------------------------------------------------------------ "Murali Maddali" <maddalimurali@y...> wrote in message news:OpDEvnGYEHA.3112@t...... > Hi Priscilla, > > Thank you for your response, first of all my appologies for posting the > wrong xml and schema files. I was trying to make a temperorary xml and > schema files, so that it would be easy to post on the forum. > > 1. You need to prefix AccountUpdate with "tmpGlobals:" - otherwise the > namespace declaration does nothing. > > I am not sure what you mean by this, but I tried to prefix AccountUpdate > with tmpGlobals and also tried to specify a default namespace, but > nothing helped. still the file is invalid. > > 2. Your xsi:schemaLocation attribute should say .../tmpGlobals instead > of ..../globals. The namespaces have to match exactly. > > I tried with this change but this is of not much help. > > 3. The namespace specified in your xs:import statement in account.xsd > must match the target namespace of the schema you are importing. So, it > must use www.temp.com instead of www.talgov.com. > > This was a copy/paste/replace error that I did during the post, all my > files refer to same namespace. > > > If you (any one else) want to take a look at the xml and schema files, > please mail me personally, I would send them to you. I don't want the > post to get too long. > > Things that confuse me most: > Here I am using my actual XML header, so please don't get confused, with > my post. The actual header looks like this. > > 1) cisGlobals.xsd. > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema targetNamespace="http://www.talgov.com/cisGlobals" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:cisGlobals="http://www.talgov.com/cisGlobals" > elementFormDefault="unqualified"> > > 2) accountInformationUpdate.xsd > <xs:schema elementFormDefault="unqualified" > attributeFormDefault="unqualified" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:cisGlobals="http://www.talgov.com/cisGlobals"> > <xs:import namespace="http://www.talgov.com/cisGlobals" > schemaLocation="cisGlobals.xsd"/> > <xs:element name="AccountUpdate"> > > 3) cis.xml > <AccountUpdate xmlns:cisGlobals="http://www.talgov.com/cisGlobals" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.talgov.com/cisGlobals > accountInformationUpdate.xsd"> > > > Thank you for all your help and replies, and once again sorry for the > confusion. > > murali. > > *** Sent via Devdex http://www.devdex.com *** > Don't just participate in USENET...get rewarded for it! | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
