Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access DOCTYPE in DOM

 
Frank Lin
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use JAXP and Xerces1.3.1 to parse a XML document to a DOM tree, but can not access the conetent in <!DOCTYPE ...>. At my first look of the DOM spec., there is a node type of DOCUMENT_TYPE_NODE. But when my program traverse the tree, it does not come across this node type. Does anyone have this problem?
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a DocumentType interface to work with <!DOCTYPE content
To get an object implementing DocumentType interface, we can read a doctype attribute of Document object.
Does it help?
 
Frank Lin
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mapraputa Is:
There is a DocumentType interface to work with <!DOCTYPE content
To get an object implementing DocumentType interface, we can read a doctype attribute of Document object.
Does it help?

Thank you, Mapraputa. But does anyone know why DOCTYPE does not appear as a node as noted in the spec.?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic