> I have a DTD for my xml files and also an XSD, sometimes I need to use the > DTD and sometimes I need to use the XSD file for validation, what I am > looking for is: if I use > > <!DOCTYPE movies SYSTEM "movies.dtd"> > > in my document and the document contains some movies with the namespace > prefix, is there any way to parse that document without receiving any error?
You can define the DTD so it uses a prefix as part of its names. In other words, if you want to suppor both <myprefix:movie> and <movie>, the DTD must explicitly define both and must say that both can appear -- and you won't be able to use <someOtherPrefix:movie> even if it's bound to the same namespace. The DTD must also say explicitly where the namespace declarations are permitted, and which are permitted. This is, in my opinion, an unreasonably fragile solution. I would recommend that you abandon DTD validation and work entirely with XSD validation or with unvalidated documents. DTDs and namespaces just Do Not play nicely together, by design.