Closed cemo closed 1 year ago
Which module are you using? Pure, Xslt or Schxslt?
I am using
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<version>7.0.0</version>
</dependency>
My usage is:
@Test
void sampl2e() throws Exception {
ClassPathResource classPathResource = new ClassPathResource("/fixtures/1_TEMEL_FATURA.xml");
InputStream inputStream = classPathResource.getInputStream();
final ISchematronResource aResSCH = SchematronResourceSCH.fromClassPath("/schematron/TR_Schematron_EInvoice.xml");
if (!aResSCH.isValidSchematron ())
throw new IllegalArgumentException ("Invalid Schematron!");
SchematronOutputType schematronOutputType = aResSCH.applySchematronValidationToSVRL(new StreamSource(inputStream));
The problem is somewhere else. The "URI Resolver" is set by default (using method SchematronResourceSCH.setURIResolver
).
The problem is in the created SVRL out. Your output uses an element ns-prefix-in-attribute-values
in the wrong order.
Can you by any chance append the SCH and the example invoice to this issue, so that I can have a look?
I created a gist:
https://gist.github.com/cemo/83cd1064f20838cc6cbb053946e64c89
sample.xml is the scm schema which is including UBL-TR_Common_Schematron.xml
and UBL-TR_Codelist.xml
.
data.xml is valid sample.
By the way I tried as you suggested by changing locations of the definitions blocks and it seems it is working. But I wanted to share you again maybe it can help you for future problems.
I have a sch file including some other sch files. When I use with another project, it runs fine but with ph-schematron I have some issues. Can you help me please about this error?