0

I use ServingXML (1.1.2) for various plain-XML transformations. I need to upgrade the Saxon lib used by ServingXML to up to date Saxon 9.6 line (currently Saxon-HE 9.6.0.6J).

Reason for this is: I'm forced to use the recent Saxon line and I use both Saxon and ServingXML with a preloading app container which - sadly - restricts using multiple lib versions simultaneously.

Anyway, I've replaced the Saxon libs and made minor changes to the ServingXML code to match Saxon API differences.

It seems to work fine. However, a single ServingXML run the upgraded Saxon spits tens of lines:

 XML Parser does not recognize the feature http://xml.org/sax/features/validation

It seems odd to me because I'm unable to find any place in the ServingXML source where would that wrong feature setting to Saxon happen.

Yuri
  • 4,254
  • 1
  • 29
  • 46
  • Sorry, can't diagnose this from this information alone. The first step is to establish (a) what you are doing at the point this message occurs, (b) how your application instantiates an XML parser (e.g., does it leave Saxon to do it using JAXP methods?), and (c) which XML parser is actually instantiated (e.g. the built-in JDK parser, or Apache Xerces). – Michael Kay Jul 25 '15 at 07:55
  • I leave the instantiation of XML parser on Saxon itself. I use built-in Java XML parser. It's very hard to run the app in debug mode to get the exact call where the exceptions occur. – Yuri Aug 04 '15 at 11:37
  • Setting Apache Xerces parser via system property javax.xml.parsers.SAXParserFactory changes nothing. – Yuri Aug 04 '15 at 13:01
  • The only way left for me seems to be experimenting with `-Djaxp.debug=1`. – Yuri Aug 04 '15 at 15:29

2 Answers2

1

A bit of information that might help you in your investigation.

Firstly, it's a warning. After outputting the warning, Saxon continues as normal. In effect, the request to set this feature on the parser is ignored.

Secondly, the message occurs after Saxon calls parser.setFeature() with the specified feature name, and the parser throws a SAXNotRecognizedException. It can occur whether the feature is being set on or off.

Thirdly, Saxon attempts to set this feature if DTD validation is requested, for example by calling Configuration.setValidation(). However, there are many other paths that could cause this request.

So there are two things happening here. (A) the application is (by some means) requesting DTD validation of source documents, and (B) the application has somehow configured an XML parser that does not support DTD validation (or that does not recognise the request).

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
0

I took a look in the source code of ServingXML. It includes an implementation of XMLReader (package com.servingxml.util.xml.AbstractXMLReader) which fails to recognize the feature http://xml.org/sax/features/validation

I suspect this is the parser you are using. But I don't know how to help with your problem. Is the author of ServingXML responding to requests for help?

Michael Kay
  • 156,231
  • 11
  • 92
  • 164