saxon:doctype
Added by Anonymous almost 19 years ago
Legacy ID: #3475078 Legacy Poster: Glen Bal (glenbal)
Hi all, I have some code that looks like this: <xsl:template match="/"> <saxon:doctype> <dtd:doctype name="yyy" public="-//yyy//DTD yyy//EN" system="yyy.dtd"> <dtd:entity name="logo512" system="logo512.jpg" notation="JPG"/> </dtd:doctype> </saxon:doctype> <xsl:apply-templates/> </xsl:template> It works with saxon version 8-4 but in 8-6-1 it returns an error SEPM0004: When 'standalone' or 'doctype-system' is specified, the document must be well-formed; but this document contains a top-level text node While processing testbestand yyy.xml: Run-time errors were reported Has something changed between versions? What can i do about it to make it work in the new version? Thanks in advance, Glen
Replies (4)
Please register to reply
RE: saxon:doctype - Added by Anonymous almost 19 years ago
Legacy ID: #3475161 Legacy Poster: Michael Kay (mhkay)
Yes, this rule (which is present in the serialization specification) is enforced in Saxon 8.6.1, and was not enforced in Saxon 8.4. You haven't shown your xsl:output declaration. Presumably it contains either a doctype-system attribute or (perhaps more likely) a standalone attribute. You may have to get rid of that. Internally, saxon:doctype works by generating a text node and outputting it using disable-output-escaping. The serializer therefore thinks that there is text before the first element in the document. Michael Kay
RE: saxon:doctype - Added by Anonymous almost 19 years ago
Legacy ID: #3475174 Legacy Poster: Glen Bal (glenbal)
Thanks for your answer. I had a standalone attribute in my doctype-system. Glen Bal
RE: saxon:doctype - Added by Anonymous almost 19 years ago
Legacy ID: #3475177 Legacy Poster: Glen Bal (glenbal)
correction, it was a standalone attribute in my xsl:output. Glen Bal
RE: saxon:doctype - Added by Anonymous almost 19 years ago
Legacy ID: #3475193 Legacy Poster: Michael Kay (mhkay)
I think I will simply document this as a restriction on saxon:doctype (i.e. that you can't use it when you specify standalone). Trying to lift the restriction gets too complicated. Michael Kay
Please register to reply