Please note that I'm asking for validation against a particular node and not the whole file. For examples
<somexmldoc>
<someNode>
<UserDefinedNode> </>
<UserDefinedNode> </>
</someNode>
</somexmldoc>
For this XML doc, I have an wholeDoc.XSD which could be used to validate the whole document except "UserDefinedNode" (This node is specified with "any" tag in xsd, which allows a user to define anything under that node).
Is it possible to have a separate userdefined.XSD file to validate "UserDefinedNode"? Is it possible to use MSXML for C++ (IXMLDomDocument) to validate this?
Thanks!
XSD applies to the whole DOM document but not DOM fragment. However, as your fragment is also valid XML, why not copy it to another DOM object as the root? You can leverage appendChild or cloneNode to achive this and then validate the new DOM.
By the way, if you want to validate a specified DOM fragment, validateNode method is there for you.