Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Detecting PI in SAX and DOM

 
Anup Batra
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When Processing Instructions are a part of your parsing process, DOM should be used, since SAX cannot be used to detect a Processing Instruction in a document.
a) true
b) false
Answer : a
Pls. Explain(since SAX has processing Instruction callback)
 
ZEESHAN AZIZ
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I remember in my last failed attempt, I got a question of a similar nature. Can anyone explain in more detail.
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both DOM and SAX have the mechanism to handle processing instructions. DOM has a node type ProcessingInstruction and SAX has a notification method processingInstruction() as part of its ContentHandler interface.
Hence, the answer to this has to be false in my opinion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic