File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extending DTD

 
Vijay Venkat
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best startup... - DTD tutorial
 
Vijay Venkat
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
 
Vijay Venkat
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic