• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to incluse a dtd.

 
Srinivas Rallapalli
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I have xml and xsl files. Now I have to generate another xml file using these 2 files. I can generate normally. But if I want to include some dtd file into the generated xml file then I should modify the xsl file. Now if I try to generate xml file it is giving error as
Cannot have a DOCTYPE declaration outside of a prolog.
Can sobody help me.
Srinivas
 
Joel Amoussou
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Srinivas,
You should include the following element in your XSLT file:
<xsl utput method='xml' doctype-system='doc.dtd'/>
where doctype-system is the system identifier (location) of the dtd file of the result xml.
This should output a document type declaration immediately before the root element in the target document as follows (assuming <root> is the root element name):
<!DOCTYPE root SYSTEM 'doc.dtd'>
----
Joel Amoussou
IBM XML Certification Practice Test
http://www.xmlmentor.net/xmlexamsim.htm
 
Joel Amoussou
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course I mean:
<xsl utput method='xml' doctype-system='doc.dtd'/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic