Support #6496
closedSaxon PE Assert
0%
Description
I'm having trouble getting assert
to trigger using:
- Out-of-the-box Saxonica release (
Saxon-PE-12.5
) - An XSLT containing asserts (
AUNZ-Billing-Shared.xslt
) - A deliberately erroneous XML file (
Invalid.xml
)
$ java -jar SaxonPE12-5J/saxon-pe-12.5.jar -t -ea:on -s:Invalid.xml -xsl:AUNZ-Billing-Shared.xslt -o:zresult.xml
Which produces a result file showing no assert
was triggered (zresult.xml
).
What am I doing wrong?
Files
Updated by Martin Honnen 4 months ago
Do you use any XSLT xsl:assert
https://www.w3.org/TR/xslt-30/#element-assert?
It seems your XSLT might be some compilation of a Schematron document and you expect it to produce validation errors/Schematron failed validations but the Saxon command line option -ea
will certainly not help with those.
Which failed assert are you expecting? Do you have the original Schematron file as well from which the shown XSLT was compiled?
Updated by Martin Honnen 4 months ago
Is the comment at the beginning of the XML sample supposed to indicate which failed Schematron assertion you are expecting?
Note that the XSLT you posted doesn't seem to contain any code checking starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:peppol:pint:billing-1@aunz-1')
.
Updated by Rick Harvey 4 months ago
- File PINT-UBL-validation-preprocessed.sch PINT-UBL-validation-preprocessed.sch added
- File PINT-UBL-validation-preprocessed.xslt PINT-UBL-validation-preprocessed.xslt added
Attached is the source schematron (PINT-UBL-validation-preprocessed.sch
) and XSLT (PINT-UBL-validation-preprocessed.xslt
).
Updated by Martin Honnen 4 months ago
What is the relation between AUNZ-Billing-Shared.xslt
and the added PINT-UBL-validation-preprocessed.xslt
?
The question remains, do you expect -ea:on
to be of any use/help for Schematron based validation? It is meant for XSLT xsl:assert
, I think, only.
Also with longish/complex samples it always helps which precise result you want.
The added Schematron seems to have an error to declare xs
for the XML schema namespace but at one point have a rule trying to use the xsd
prefix.
Updated by Michael Kay 4 months ago
This is why it's so important that we see your actual code -- I had assumed you were asking about xsl:assert
.
What we have here is a stylesheet, generated it appears by Schematron, that isn't producing the output you would have expected. So essentially, I think you're asking us for help debugging your code. Debugging user-written code isn't part of our normal support offer. We'll take a look at it, but this is a 3300 line stylesheet and we have no understanding of the XML or of exaclly what it's trying to do, so I can't offer any guarantees.
What exactly is invalid about the invalid.xml file? That will help us get started.
Updated by Rick Harvey 4 months ago
Hi Michael (and Martin)
Thank you very much for your quick response and analysis.
Indeed, it looks like a problem that the test file (Invalid.xml) not actually being invalid against the specification (*.sch, *.xslt).
I will report this back to the Australian Government, which produced these files. (https://peppol.org/learn-more/country-profiles/australia/)
You may close this issue. As your (very nice) product seems to be working as expected.
Thanks again...Rick
Updated by Rick Harvey 4 months ago
I got a reply back from the AU Government - Peppol documents need to be validated against both Shared
and Aligned
XSLTs.
The test file (Invalid.xml
) validates against Shared
(above) but does not validate against Aligned
(attached).
Sorry for my ignorance. However, I now know a lot more about your product. :-)
Thanks...Rick
Updated by Michael Kay 4 months ago
- Status changed from New to Closed
Glad to hear the problem is resolved.
Please register to edit this issue