-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schematron assert ID in AbstractSVRLMessage #103
Comments
Hi, Can you please check if a preceeding element |
No, the fired-rule elements only have template and context + the generated mode and priority attributes. Should it have been generated on the svrl:fired-rule as well? The full section from XSLT <!--RULE -->
<xsl:template match="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]" mode="M12" priority="1010">
<svrl:fired-rule context="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]" />
<!--ASSERT -->
<xsl:choose>
<xsl:when test="false()" />
<xsl:otherwise>
<svrl:failed-assert test="false()">
<xsl:attribute name="id">PEPPOL-EN16931-R041</xsl:attribute>
<xsl:attribute name="flag">fatal</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates mode="schematron-select-full-path" select="." />
</xsl:attribute>
<svrl:text>Allowance/charge base amount MUST
be provided when allowance/charge percentage is provided.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates mode="M12" select="*" />
</xsl:template> from Schematron <!-- Allowance/Charge (document level/line level) -->
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]">
<assert id="PEPPOL-EN16931-R041" test="false()" flag="fatal">Allowance/charge base amount MUST
be provided when allowance/charge percentage is provided.</assert>
</rule> |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Finally - that was done in ph-schematron 6.0.1 |
Would it be possible to add the assert id from schematron/XSLT files in the
AbstractSVRLMessage
(SVRLFailedAssert
,SVRLSuccessfulReport
)?The ID I have in mind is "PEPPOL-EN16931-R041" from the sample below.
When using ph-bdve-peppol to validate files, the returned
ValidationResults
and the containing errorsgetErrorID()
returns null.I am not sure if the intent of the errorId is to contains this type of information. But I did a test in a fork where I added fetching of error ID from
FailedAssert
inSVRLFailedAssert
andSVRLSuccessfulReport
viaAbstractSVRLMessage
, mangeg@f5d4fb6. With these changes I am able to get the assert id fromIError.getErrorID()
.The use for this would be to be able to programmatically act on results without depending on the readable validation message, ie. (Allowance/charge base amount MUST be provided when Allowance/charge percentage is provided.) in the sample.
From PEPPOL-EN16931-UBL.sch
SCH:
XSLT:
The text was updated successfully, but these errors were encountered: