[Home] [By Thread] [By Date] [Recent Entries]
Either way is valid, acceptable, conformant, and non-deprecated. As you have discovered, the MSXML parser does not tolerate the xmlns attribute being defaulted via the DTD. This is either a bug, or a limitation of this parser, depending on how charitable you're feeling. -Wayne Steele >From: "Wedinger, Keith" <Keith_Wedinger@s...> >To: "Xml-Dev (xml-dev@l...)" <xml-dev@l...> >Subject: Default namespace declaration in DTD and MSXML >Date: Wed, 21 Nov 2001 13:08:04 -0500 > >I have the following DTD which declares an xmlns attribute to handle the >default namespace (the DTD comes from RosettaNet): > ><!ENTITY % common-attributes "id CDATA #IMPLIED" > > ><!ELEMENT Preamble ( > standardName , > standardVersion ) > > ><!ATTLIST Preamble xmlns CDATA #FIXED > "http://www.rosettanet.org/RNIF/V02.00 ><http://www.rosettanet.org/RNIF/V02.00> " > > ><!ELEMENT standardName > ( GlobalAdministeringAuthorityCode ) > > ><!ELEMENT GlobalAdministeringAuthorityCode > ( #PCDATA ) > > ><!ELEMENT standardVersion > ( VersionIdentifier ) > > ><!ELEMENT VersionIdentifier > ( #PCDATA ) > > >When I attempt to validate the following XML against the DTD above using >the >MSXML parser, I get an error indicating that a default namespace >declaration >in the DTD is not supported. When I attempt to validate the XML below >using >.NET, I get, "The 'x' character, hexadecimal value 0x78, cannot be included >in a name." > ><?xml version="1.0" encoding="UTF-8"?> ><!DOCTYPE Preamble SYSTEM "Preamble_MS_V02_00.dtd"> ><Preamble> > <standardName> > ><GlobalAdministeringAuthorityCode>RosettaNet</GlobalAdministeringAuthorityCo >de> > </standardName> > <standardVersion> > <VersionIdentifier>V02.00</VersionIdentifier> > </standardVersion> ></Preamble> > >To work around this in my code, I change the <Preamble> root element above >to: ><Preamble xmlns="http://www.rosettanet.org/RNIF/V02.00"> >Then, MSXML is happy. > >My question is: Is the default namepace declaration in the DTD above in >conjunction with the XML above considered valid? Or, would the valid form >be the root element containing the xmlns attribute? > >J. Keith Wedinger >Senior Software Developer >Sterling Commerce >keith_wedinger@s... > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|

Cart



