how to extract the DOCTYPE via xslt in xml to xml transform ?
Date:
2005-05-13 12:16:59
From:
DJAY
i am transforming a an xml file having a DOCTYPE declaration to another xml file
Can anybody suggest me way of Extracting the DOCTYPE decl from the source XML file to be passed to Destination XML file
I am aware of
But dont knwo how to extract it for the source xml
thanks in advance
An XSLT processor can't do this, because it doesn't know what source document's DOCTYPE declaration was. Remember, an XML parser parses the source document, validates it against a DTD if necessary, resolves entity references, etc. before handing the result to the XSLT processor, and the XSLT processor has no way of knowing what was handed to the XML parser. To copy the DOCTYPE declaration from one file to another, you'd have to use some tool that could look at the source document as straight text and not as an XML document to be parsed, such as perl or python.