• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PUBLIC in DTD

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
In one of the DTD Declaration in an XML, i found this
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN'>
Many say that PUBLIC is used when you have publicised the DTD. Now if i use this declaration when my application is validating the XML against DTD where will it search for the DTD ? or should i specifythe URL (of sun site in above case) ? I think specifying URL location is as good using SYSTEM instead of PUBLIC. Also in one of the book they say PUBLIC is used for internal purpose.Some one please help.
Hari
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hari,
The specification has the following definitions -

It means that the 'PUBLIC' part consists of two quoted strings (separated by space - S).
The first one is the public ID, which uniquely identifies the XML application in use.
The second part is a URI. It is the URI, which is in practice being used by the XML parsers to actually validate the document (XML in a nutshell page #30).
Cheers,
Dan
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi hari,
i don't think your application search for PUBLIC dtd. Isn't it just unique namespace differentiate the namespace amongst various name sources?
you could find out the DTD in that site, but even though they don't provide it, it wouldn matter to validate your xml file. For example, when you make a client application to connect the Server (in this case SUN), you should follows their DTD as they provided to match the name and type. In this case, you can differentiate your namespace and theirs. It they don't have specific DTD file, they should provide xml file has a DTD information or just DTD to work your application.
correct me if i am wrong.
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are two articles for those who want more details :roll:
http://www.xml.com/pub/a/2000/11/29/deviant.html
and: http://www.xml.com/pub/a/2000/04/12/deviant/index.html
 
stephen Kang
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, that's food for thought
 
On top of spaghetti all covered in cheese, there was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic