AntennaHouse / focheck

XSL-FO validation using RELAX NG and Schematron.
Apache License 2.0
30 stars 7 forks source link

Errors handling for 'background-image' and 'src' attributes. #36

Closed raducoravu closed 6 years ago

raducoravu commented 6 years ago

One of our clients reported that having a background image with a value like this:

            background-image="../xml_tools/common/line_arrowR.tif"

reports a "Syntax error" in one of the Schematron schemas. But using an 'src' attribute with a similar value on a fo:external-graphic does not although the XSL-FO specs says that both attributes are uri-reference types. Also the error is not very clear, as an end user just by looking at the error message I do not know what to do to fix it.

tgraham-antenna commented 6 years ago

Does not occur with current focheck. Was fixed in focheck 0.5.4.

The 'syntax error' message was because the URL was being parsed as an expression in the expression language. Section 5.9, Expressions, of XSL 1.1 (https://www.w3.org/TR/xsl/#d0e5032) says that "All property value specifications in attributes within an XSL stylesheet can be expressions." focheck tries to parse every expression except for the ones where it's told not to. background-image/@src wasn't added to that list until recently.

The spec also says that @src should be a <uri-specification>, which is supposed to have url(...) around the URI, but every formatter ignores that requirement and works with bare URIs as well.

raducoravu commented 6 years ago

Thanks @tgraham-antenna and sorry for the false report, we'll update the framework shipped with Oxygen.