Skip to content

How do I validate Schematron files #1777

Answered by ewoutkramer
liu123456789 asked this question in Q&A
Discussion options

You must be logged in to vote

The schemas you need are included in the specification.zip that comes with the .NET Hl7.Fhir.Specification Nuget.

If you are not using the profile validator, you can directly use the .NET XML schema validation functions:

   XDocument docToValidate = .....;
   XmlSchemaSet xss = SchemaCollection.ValidationSchemaSet;

  ValidationEventHandler veh = (o, args) => // handle error here

  docToValidate.Validate(xss, veh);

If you are using the profile validator, this functionality is built-in, check this project on how to enable it: https://github.com/FirelyTeam/Furore.Fhir.ValidationDemo/blob/master/MainForm.cs#L163

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcovisserFurore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1776 on June 25, 2021 07:50.