OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Combining DTD and Schema declarations in the same XML

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Combining DTD and Schema declarations in the same XML
  • From: "Young Matthew" <matthew.young@forsakringskassan.se>
  • Date: Wed, 9 Feb 2005 15:16:45 +0100
  • Thread-index: AcUOsfwkL3hsXdcfRFKL8tsmKzE5LQ==
  • Thread-topic: Combining DTD and Schema declarations in the same XML


Want to combine DTD/Schema declaration in the same XML document.  We
have legacy DTD documents which I would like to reuse with
"under-development" XML Schemas and take advantage of namespace support
with schemas.  See example documents below.

If I validate the XML below no validation error is thrown as excepted
since the part1 element should only occur once (eg. maxOccurs="1").
Plus the part2 element is never asked for the DTD.

Would greatly appreciated references to articles or any ideas?  Thanks a
mil / Matthew Young

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE main PUBLIC "DTD" "C:\DOCUME~1\40042466\dtd\mixing.dtd" []>
<main name="test">
	<part1 xmlns="http://rfv.sfa.se";
C:\DOCUME~1\40042466\xsd\mixing.xsd" name="mypart"></part1>
	<part1 name=""></part1>

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT main (part1, part2)>
<!ATTLIST main
        name CDATA #REQUIRED>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://rfv.sfa.se"; targetNamespace="http://rfv.sfa.se";
	<xs:element name="main">
				<xs:element ref="part1" minOccurs="0"
				<xs:element ref="part2" minOccurs="0"/>
			<xs:attribute name="name" use="required"
	<xs:element name="part1">
			<xs:attribute name="name" use="required"
	<xs:element name="part2">
			<xs:attribute name="name" use="required"


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS