c# - Validate XML element against schema -
i need validate small fragment of xml file against schema. essentially, i'd ask question "does element x in xml document y conform type defined in schema z?" , if not message describing why. has account restrictions placed on types (e.g. maxlength, mininclusive).
is possible?
i don't know doing c#, it's done in xquery or xslt 2.0. in xslt 2.0 it's:
<xsl:copy-of select="doc('doc.xml')//selected/element" validation="strict"/>
and in xquery it's
validate strict {doc('doc.xml')//selected/element}
all need schema-aware xquery or xslt 2.0 processor runs in chosen environment.
Comments
Post a Comment