Ignore DTD when 'standalone="yes"'?
Added by Anonymous about 17 years ago
Legacy ID: #4533969 Legacy Poster: Tony Graham (menteith)
I have a document with 'standalone="yes"' in the XML declaration and with a DOCTYPE declaration to an external DTD (i.e., external subset). The document really is standalone -- no IDs, no defaulted attributes -- and the DOCTYPE is there for the convenience of an XML editor application. When I run a transform on the document on a different system where the system identifier for the external subset does not resolve, Saxon complains about not finding the DTD with a java.io.FileNotFoundException. I don't want to use catalogs to resolve the reference the DTD, so how do I tell Saxon that the document really is standalone?
Replies (4)
Please register to reply
RE: Ignore DTD when 'standalone="yes"'? - Added by Anonymous about 17 years ago
Legacy ID: #4533995 Legacy Poster: Michael Kay (mhkay)
You are asking questions about the behaviour of the XML parser, over which Saxon has very limited control. I can't possibly help without knowing which XML parser you are using; and even then, it's not a Saxon question. If you want fine control over how the parser is configured, it's best to supply Saxon with a StreamSource containing an XMLReader which you have instantiated; this allows you to set any options that might be supported by the XMLReader. I would have thought the simplest approach is to supply an EntityResolver.
RE: Ignore DTD when 'standalone="yes"'? - Added by Anonymous about 17 years ago
Legacy ID: #4534086 Legacy Poster: Tony Graham (menteith)
I am using com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl from java version "1.6.0_01". When I use Aelfred as the parser -- because it's stated as being simple, not just to make it a Saxon question -- the error message changes but the effect is the same. To supply an EntityResolver probably is the simplest approach, but my clients are baulking at the length of the Saxon command line when all the catalog-related properties and arguments are included because they say their clients won't cope if anything goes wrong, e.g., if the wrong locations are specified for the jars.
RE: Ignore DTD when 'standalone="yes"'? - Added by Anonymous about 17 years ago
Legacy ID: #4534128 Legacy Poster: Michael Kay (mhkay)
Do you mean the version of AElfred that comes with Saxon 6.5.5? I'm afraid it's a long time since I looked at that. I'm not sure what environment you're in, but if things are getting to the point where the command line is unmanageably long, then it might be time to stop using the command line and create your own interface based on the Java API. Michael Kay
RE: Ignore DTD when 'standalone="yes"'? - Added by Anonymous about 17 years ago
Legacy ID: #4536203 Legacy Poster: Tony Graham (menteith)
A custom interface is not a viable option in this instance. It looks like we/they will have to keep using the command line with the extras for handling XML catalogs. Thank you for your help. Regards, Tony Graham.
Please register to reply