[xslt] HTML DOCTYPE added in a XML string after applying a style sheet

Hi Everybody !

I'm a newbie with XSLT and I need some help.

Here is my problem:

My inputs:
-a string with a xml tree.
-a stylesheet file 

My output:
- another XML string

I obtain what I want in the output except for one thing, when the stylesheet is applied XSLT add:
<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\";>

in my result string and I don't want this.
This is strange as it is not a HTML doc.

Here is my code (according to the tutorial here http://xmlsoft.org/XSLT/tutorial/libxslttutorial.html):

xmlLoadExtDtdDefaultValue = 1;


m_xslt = xsltParseStylesheetFile((const xmlChar *)xsltFilePath);
m_inputXmlDoc = xmlParseMemory(input, size);
m_outputXmlDoc = xsltApplyStylesheet(m_xslt, m_inputXmlDoc, NULL);

at this point when I check outputXmlDoc, I can see

outputXmlDoc->type == XML_HTML_DOCUMENT_NODE
outputXmlDoc->children->type = XML_DTD_NODE

I tried 
xmlLoadExtDtdDefaultValue = 0;

I 've searched in the archive list and in google but so far, I just read that the DTD cannot be turned off 
... but maybe I
am missing something ...

Is there a way to specify xsltApplyStylesheet for not including the DTD node ? Maybe through params ?

Thank you for your help.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]