"Yuri de Wit" <[EMAIL PROTECTED]> wrote on 09/24/2006 09:04:27 AM:
> So far, I have been using Eclipse EMF's XSD model and a custom XML > InfoSet EMF model to implement an simple XML/XMLSchema tool. Part of > my requirements, which goes beyond just making sure xml instances are > valid, is to be able to assert the validity of XML instances > dynamically, recreate XSD type references from serialized xml, > construct valid XML instances on the fly (e.g. respecting min > occurrences), and persist the XML and XSD models. At this point, the > biggest work there is the validation of serialized XML into my XML > InfoSet recreating the type references to EMF XSD model. > > I am interested in knowing to what extent it would be possible for me > to reuse Xerces validator even if that requires some "sane" source > code changes so that I could plug my own XSD model into it (seems that > a custom XNI component could easily recreate my "untyped" XML InfoSet > model). Any insights into wheather that is a worhtwhile goal or how it > could be accomplished? Xerces' schema validator is hardwired to use its own implementation of XSModel. You'd pretty much have to rewrite the schema validator to get it to use something else. If you want to use your own schema model you first need to convert it to the XML representation of the schema (any of stream, SAX or DOM will do) and then feed that to the schema loader [1]. As for the XNI "untyped" infoset model builder, you could just plug that in to the end of the XNI pipeline by setting it as the XMLDocumentHandler [2] on whatever XMLParserConfiguration [3] you're using. > thanks in advance. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] [1] http://xerces.apache.org/xerces2-j/faq-grammars.html [2] http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLDocumentHandler.html [3] http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/parser/XMLParserConfiguration.html Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
