Project

Profile

Help

Upgrading from Saxon-EE 9.6 to 9.7.0.20: new transformation error "FORG0002"

Added by Charles Sun over 6 years ago

This is sort of a continuation of an earlier thread: https://saxonica.plan.io/boards/3/topics/6990

After we upgraded Saxon-EE from 9.6 to 9.7.0.20 and resolved the issue with error message XQDY0025, when performing XSLT transform with some different DocBook5 files, we started seeing a new error like this:

Error at char 19 in xsl:variable/@select on line 151 column 117 of graphics_customized.xsl:
FORG0002: Base URI {} is not an absolute URI
  at xsl:call-template name="t:process-image" (file:/path_to_style/docbook/xslt/base/html/graphics.xsl#956)

Here is the line 151 of graphics_customized.xsl mentioned in the error message:



Apparently the error FORG0002 has something to do with the base-uri function used here.

Do you have some recommendations on resolving this? Thanks.


Replies (4)

Please register to reply

RE: Upgrading from Saxon-EE 9.6 to 9.7.0.20: new transformation error "FORG0002" - Added by Michael Kay over 6 years ago

The rule is clearly there in the W3C specifications, I guess someone wrote a conformance test and we had to change the product to make it pass.

The value of base-uri(root(.)) is going to depend on what you supplied as a base URI or system ID when you built the relevant document tree. For example, if the source document came from a StreamSource, it will depend on the system ID of the stream source.

The JAXP specs are a bit fuzzy in this area:

InputSource says "If the system identifier is a URL, it must be fully resolved (it may not be a relative URL)." (For 'may not', read 'must not').

StreamSource says (for the constructors, though not for setSystemID(): "Must be a String that conforms to the URI syntax". That's a bit vague, but according to RFC3589 a "relative reference" (popularly called a relative URI) does NOT conform to the syntax for a URI.

In neither case does the Java class actually enforce these constraints.

RE: Upgrading from Saxon-EE 9.6 to 9.7.0.20: new transformation error "FORG0002" - Added by Charles Sun over 6 years ago

wrote a conformance test and we had to change the product to make it pass.

Did you mean that Saxon-EE 9.7 is doing what it is expected to do, and that to resolve the FORG0002 error the recommended solution would be for me to modify the XSLT, adjusting what gets supplied as the base URI or system ID when building the relevant document tree?

RE: Upgrading from Saxon-EE 9.6 to 9.7.0.20: new transformation error "FORG0002" - Added by Michael Kay over 6 years ago

I would think it's more likely that you need to modify the calling application, rather than the XSLT itself. My suspicion is that you are setting the systemId of an input document to a relative URI, and if so, that would be incorrect.

RE: Upgrading from Saxon-EE 9.6 to 9.7.0.20: new transformation error "FORG0002" - Added by Charles Sun over 6 years ago

Yes, modifying the code that supplies the base URI did the trick. Thanks again for your help!

    (1-4/4)

    Please register to reply