From: "Brian Young" <[EMAIL PROTECTED]> > I'm curious about dom4j compliance with the infoset spec- particularly > with the order of elements in a document. > > Specifically, I ask because I need to fit a JTable model to an XML > document that currently has a traditional model of a vector of vectors.
That should work fine. The contents of an element maintain their order (using a List) so this should be fine. You might find the org.dom4j.swing.XMLTableModel class useful - it allows arbitrary dom4j documents to be viewed in a JTable using XPath expressions to extract information. > The table data can be rather large, several thousand rows at least, and > ordinality is critical. The element that repeats for each row would > preferably not have to have a "sequence number" attribute, because > keeping that in sync when rows are added/removed would be nightmarish. > Also I'm not sure how well or efficient the model would even sort on > such an attribute if it existed. There's no sequence attribute; the List maintains order. You can find the index of an item using List.indexOf() though its not that efficient. > But, at the same time, I don't want to try and fill the JTable based on > the order of repeating elements in the dom4J document if I can't depend > on it. My understanding is the infoset spec gives me the guarantee I'm > looking for- IF dom4j respects it? I think you'll be fine - though I'm not totally sure how you want to handle 'repeating elements' - I guess you just want to preserve this fact in the JTable? James _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
