java - base-uri function in schematron for validating xml probatron + saxon -
we used probatron , saxon validate test xml using given sch file in our java application. recently, new rule has been added sch file such as
<let name="foo" value="base-uri()"> and rules use value, $foo contains empty string , rules fail. have set value? added xml:base tags test xml stated in https://www.w3.org/tr/xmlbase/ did not worked. have set sth in java side?
edit (solution found) used probatron4j java based schematron handling:
java source part:
javax.xml.transform.transformerfactory t = org.probatron.utils.gettransformerfactory(); // create xml readers, perfor template processing, apply xslt // stated in probatron4j examples // ... t.transform(getcandidatesource(), new streamresult(baos)); our fix includes:
source source = new streamsource(new fileinputstream(.. // or source source = new streamsource(canditateurl.openstream().. // depending on whether input source file or url based // below fix, set path of file or exteral form of url source.setsystemid(pathorurl); final result: value set systemid set return value of base-uri() function val in schema.
Comments
Post a Comment