Using xsom to return a list of attributes in definition order
I just started using xsom for a project that I am working on. Currently I need to get a list of all attributes from a specific element declaration. That can be done using the code below. The problem that I run into is that the attributes are listed in alphabetical order (by their name). What is really needed is to have the attributes in the order that they are defined in the schema. How do I get a list of the attributes in the order that they were defined in the schema document (see below for example)?
private Table parseDeclaration(XSElementDecl decl)
Table table = new Table();
for (XSAttGroupDecl group : decl.getType().asComplexType().getAttGroups())
for (XSAttributeUse attr : group.getAttributeUses())
Attributes returned in order [pre]id, name, value[/pre] when the order should be [pre]id, value, name[/pre].