views:

14

answers:

0

New to XSD here.

Has anyone found or written a framework for working with XML schema object model in Cocoa/Obj-C?

What I really need is the ability to define permitted types of modifications to an NSXMLDocument, as described in an XSD File. This includes defining sequences of child elements, list of attributes and their permitted values, etc etc. I need to expose these modification rules in my UI. For example:

  • I want to constrain the names of the new child elements added to an existing NSXMLElement node in my NSOutlineView
  • If the XSD says that Node A has required child elements (Nodes Aa and Ab) then when the user adds Node A to the XML tree, I want to automatically create Nodes Aa & Ab and add them to the just-created Node A.
  • etc etc

It seems to me that a good solution would be a Cocoa counterpart of JAXB. XSOM (which doesn't create schema-derived classes, but rather gives an query-able object model of the XSD) would work too.

My question is similar to this one, but I don't want to limit myself to JAXB-like solution. I'm interested in finding out other solutions that people have come up to this problem.

Cheers!!