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 SchemaTo: NULL Date: 7/2/2004 4:27:00 PM Hi Murali, Since both schema documents have the same target namespace, you should use xs:include instead of xs:import, as in: <xs:include schemaLocation="cisGlobals.xsd"/> Also, in cis.xml, you do need to prefix AccountUpdate with "cisGlobals:" in order for it to be in the namespace (which is what you want.) The other elements should not be prefixed. A default namespace declaration won't work in this case, because all the elements other than AccountUpdate are NOT in a namespace. This is because they are locally declared, and you are using elementFormDefault="unqualified". Hope that helps, 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 | |||
|
