aspose file tools*
The moose likes XML and Related Technologies and the fly likes Extending DTD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Extending DTD" Watch "Extending DTD" New topic
Author

Extending DTD

Vijay Venkat
Ranch Hand

Joined: Aug 12, 2001
Posts: 52
Hi

Can any one point me to some documents/examples or let me know how i can extend a DTD to add new elements and attributes?

Thanks,
Vijay V
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
The best startup... - DTD tutorial
Vijay Venkat
Ranch Hand

Joined: Aug 12, 2001
Posts: 52
Hi Balaji - Thanks for the Link.

I probably didn't phrase my question right.

I want to know how to Extend a DTD. If someone has already published a DTD and there are few place holders in the DTD where in certain elements allow its child to be of TYPE ANY. In this case i can add new elements there. But ANY in DTD means any element that is already defined in the DTD.
While ANY in schema means a new element, which need not be already declared in the scheam.

So if there is a DTD which has an element say CHEMICAL and has child by name CHEMICAL-EXTENSION which is of type ANY, now in this child element
CHEMICAL-EXTENSION - I want to add new elements which is not defined by the current DTD.

How can i do this. What is the recomended way to do it.

Thanks,
Vijay Venkat
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I haven't done this myself, ever, but I think you should look into the following approach:

1) Leave the existing DTD as it is.
2) Create a new DTD document where you define your new elements.
3) Add an ENTITY reference to the original DTD file...
<!ENTITY old SYSTEM "http://www.mydomain.com/old.dtd">
...and import it into the new DTD file:
&old;


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Vijay Venkat
Ranch Hand

Joined: Aug 12, 2001
Posts: 52
Hi Lasse Koskela,
I am back after a break.
Thanks a lot for your response. I will try and let you know how it works.

Regards,
Vijay Venkat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending DTD
 
Similar Threads
Backward compatibiltiy with DTD.
Disabling a text filed using XHTML-MP
Restaurant DTD
For all SCWCD guys : Doubts
how to learn dtd for the exam