0

I am getting different SVRL result when I use to stream with dummy URI it doesn't return the correct SVRL and if I provide actual URI it return correct SVRL in Saxon 9.8.3 version.

Processor processor = new Processor();
// Load the source document
var documentbuilder = processor.NewDocumentBuilder();
documentbuilder.BaseUri = new Uri("http://dummy.base.uri/");
XdmNode input = documentbuilder.Build(xmlstream);

// Create a transformer for the stylesheet.
var compiler = processor.NewXsltCompiler();
compiler.ErrorList = new System.Collections.Generic.List<Exception>();
XsltTransformer transformer = compiler.Compile(xsltStream).Load();
transformer.InitialContextNode = input;

Kindly advise if I am making any mistake. The only difference is the correct one returns below and incorrect SVRL skip it.

<svrl:failed-assert test=". != ''" id="EHF-COMMON-R001" flag="fatal" location="/*:CreditNote[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2'][1]/*:CreditNoteLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Note[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
  <svrl:text>Document MUST not contain empty elements.</svrl:text>
</svrl:failed-assert>
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Without seeing your schematron or XSLT code it's impossible to tell why it's producing the results you observe. All we can tell from the information given is that the validation seems to depend in some way on the base URI of the source document. – Michael Kay Jan 28 '18 at 17:42
  • The Schematron XSLT is placed https://ufile.io/qcagu and XML document that needs validation is https://ufile.io/r3o1s If you need anything else then let me know. The function which is returning correct SVRL is https://ufile.io/xdzoa and the message which is not returning correct SVRL based on stream is https://ufile.io/3esar – majid ismail Jan 28 '18 at 18:20
  • I have fixed it by using stream for both xsl and xml and it seems working now. – majid ismail Jan 28 '18 at 19:45

0 Answers0