Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

javaranch mock question

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following code is valid?

a) <!DOCTYPE SYSTEM SYSTEM "test.dtd">
<SYSTEM></SYSTEM>
b) <!DOCTYPE PUBLIC SYSTEM "test.dtd">
<PUBLIC></PUBLIC>
c) <!DOCTYPE PUBLIC PUBLIC "test.dtd">
<PUBLIC></PUBLIC>
d) <!DOCTYPE SYSTEM PUBLIC "test.dtd">
<PUBLIC></PUBLIC>
Answer : a b

Can PUBLIC and SYSTEM be elements names? Why a and b are correct, not c and d?
 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess any name is valid as long as it is a valid xml name (w.r.t the characters it can contain)
The reason why c and d are not correct is that there is nothing like PUBLIC keyword for referring to an external DTD to the best of my knowledge.
Anyone please correct for any mistakes here.
Thanks.
 
jim yin
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got it, this is from PXML2:


The use of PUBLIC identifiers should probably be limited to internal systems and SGML legacy applications.


PUBLIC cannot be used to refer to external DTDs.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jim,
it would help if you could write a descriptive subject for the new topic you create, so that people have an idea of what your question is all about. Thank you
 
Good night. Drive safely. Here's a tiny ad for the road:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic