Thanks for your reply.
I've a doubt about getting the sorted XML. I'd still need a browser to
view sorted results. Instead I need to get a sorted XML file (i.e.
write to a new xml file). Is there a way to do that?
Alternatively, of all the ways I've seen to manipulate a DOM tree, I
couldn't figure out how I could dump a (sorted??) tree to XML file,
either after sorting it in memory, or applying some kind of
transformation while writing a file like that (using
javax.xml.Transform)!!
What I really need is to find the best way to take an XML file and
output another XML in which elements are sorted something like this-
(original fragment)
<action path="/StartLogin" forward="/Login.do"/>
<action path="/Login"
className="oracle.adf.controller.struts.actions.DataActionMapping"
type="oracle.adf.controller.struts.actions.DataForwardAction"
name="DataForm" parameter="/login.uix">
<set-property property="modelReference"
value="MemInfoUIModel"/>
<forward name="success" path="/Main.do?node_id=ED"/>
<forward name="failure" path="/Login.do?badlogin=1"/>
<forward name="disabled" path="/Login.do?badlogin=2"/>
</action>
Above is the original fragment.
If we say (in the configuration) order all 'action' tags by the 'path'
attribute and all 'forward' tags by 'name' I would expect the result
to look like this:
<action path="/Login"
className="oracle.adf.controller.struts.actions.DataActionMapping"
type="oracle.adf.controller.struts.actions.DataForwardAction"
name="DataForm" parameter="/login.uix">
<forward name="disabled" path="/Login.do?badlogin=2"/>
<forward name="failure" path="/Login.do?badlogin=1"/>
<forward name="success" path="/Main.do?node_id=ED"/>
<set-property property="modelReference"
value="MemInfoUIModel"/>
</action>
<action path="/StartLogin" forward="/Login.do"/>
(action tags are sorted by 'path' value and forward tags are sorted by
'name' values)
It's a big struts-config file which I'm trying to sort. Please don't
ask me why!!
)
Thanks.
ak