Hi,
i'm trying to ignore DTD/DOCTYPE , when applying stylesheet to an HTML document. (JAVA side).
Transformer transformer = factory.newTransformer(new StreamSource(new StringReader(xslContent)));
where xslContent = is a string. Here is xslContent :
<xsl:stylesheet version="1.0" xmlns:htm="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
<xsl:variable name="filepath" select="translate(/Content/KANISA_SPIDERINFO/@source,'"','')"/>
<xsl:variable name="filename" select="translate(/Content/KANISA_SPIDERINFO/@offset,'"','')"/>
<xsl:variable name="source">
file://localhost/<xsl:copy-of select="$filepath"/>\<xsl:copy-of select="$filename"/>
</xsl:variable>
<xsl:variable name="source2" select="document($source)"/>
<xsl:variable name="Title">
<xsl:value-of select="$source2/html/head/meta[@name='DC.Title']/@content"/>
</xsl:variable>
<KCTITLE>UDS User Guide - <xsl:value-of select="$Title"/></KCTITLE>
</xsl:template>
</xsl:stylesheet>
Here @source points to the folder of my html and @offset points to the html filename.
next i call below function
transformer.transform(new StreamSource(inputStream), new StreamResult(outputStream));
this function takes more then 60+ seconds if my html document contains DOCTYPE tag. Without DOCTYPE tag in html , it takes less then 1 second.
NOTE : inputStream will have the information of source & offset.
Can any one please let me know , how to ignore DOCTYPE from html file during transformer.transform function ?