Two Laptop Bag
The moose likes Product and Other Certifications and the fly likes How to Declare Namespace in DTD Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Product and Other Certifications
Reply Bookmark "How to Declare Namespace in DTD" Watch "How to Declare Namespace in DTD" New topic
Author

How to Declare Namespace in DTD

Lakshmi Kishore
Ranch Hand

Joined: Aug 04, 2001
Posts: 51
hi anybody know how to declare the namespaces in a DTD? I am not able to decide whenther actually cna we define Namespaces??? i am really confused, can anybody help me......


Thanks & Regards<br />glkishore
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1126
Even though DTDs are not namespace aware, you can define namespaces in the DTD as regular attributes.
For example (XML in a Nutshell #66), this ATTLIST declaration fixes the default namespace of all svg elements as http://www.w3.org/2000:
<!ATTLIST svg xmlns CDATA #FIXED "http://www.w3.org/2000">
This allows you to omit xmlns attributes from all your svg elements.
A document does not need to be valid to take advantage of this omission. All that's required is that the parser read the DTD. All parsers read the internal DTD subset and process any ATTLIST declarations they find there.
Cheers,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Lakshmi Kishore
Ranch Hand

Joined: Aug 04, 2001
Posts: 51
if i declare this, how to use the namespace prefix? if that book contains, i will go through it soon as i don't have the book right now.
if not please some one could tell me how to refer prefix.
Thanks in Advance
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1126
The book explains the issue in pages 66-68.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to Declare Namespace in DTD
 
Similar Threads
Explanation about Namespaces
constructors
Specify namespaces in mapping file
converting DTD to schema
Namespace using Axis