java - How to retrieve all the elements name from a xml schema -
i having problem getting name of schema elements in java. creating small xml editor can load xml schema , validate xml file against xml schema. want parse schema, every elements name , put in content assistant, user can see available elements.
i read xsom user's guide, didn't understand much...
can me implement addelementsfromschema(file xsdfile) function, because lost myself trying.
public static void addelementsfromschema(file xsdfile){ }
it sounds primary need, @ least now, element names. can element names like:
xsomparser parser = new xsomparser(); parser.parse(xsdfile); xsschemaset schemas = parser.getresult(); iterator<xselementdecl> = schemas.iterateelementdecls(); while (i.hasnext()) { xselementdecl element = i.next(); string name = element.getname(); // add editor }
showing element definitions lot more difficult, element declarations in xml schemas can quite complex.
Comments
Post a Comment