OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Sorting/reordering XML files - Implementation/Design questions

[ Lists Home | Date Index | Thread Index ]
  • From: "Glenn R. Kronschnabl" <grk@arlut.utexas.edu>
  • To: "Perl-XML Mailing List" <perl-xml@listserv.activestate.com>
  • Date: Tue, 08 Dec 1998 09:05:34 -0600

[Note: this is cross-posted between perl-xml and xml-dev.  I thought twice 
before I did this, but I couldn't talk myself out of it...]

I have a very simple app that I want to do.  Basically, I have an address 
list xml file built up using the vcard DTD, wrapped in a vCardSet.  It 
looks like:

<?xml version="1.0" encoding="UTF-8"?>
<vCardSet name="GRKs vCards">
<vCard>
<fn>Glenn Kronschnabl</fn>
<n>   <family>Kronschnabl</family>
      <given>Glenn</given></n>
<org><orgname>UT Austin</orgname></org>
</vCard>
<vCard>
....
</vCard>
</vCardSet>

Note that the order of <vCard>'s are not in any particular order.

So,

I would like to be able to sort (on family, given, etc) then print using 
both  XSL/DSSSL.  I am shooting for a telephone book-like printout ala 
Microsoft Outlook 2-column phone book printout.

Q.  Should I pre-sort using Perl-XML and XML::DOM and write out a new XML 
file? Right now I have been trying to use XML::DOM and I'm close but I'm 
not sure what I am trying to do even makes sense?   The advantage of using 
the DOM is that I don't have to know anything about what I'm actually 
sorting accept for the relevant fields (the opposite would be to create 
the vCard data structure I guess). What are other people doing in this 
area?  What is the best way?  Should I rearrange the nodelist in memory or 
should I construct a new nodelist and write it out (not worrying about 
preserver whitespace)?

-or-

Q.  Could this be done using just SAX?  What are the tradeoffs?

-or-

Q.  Should I sort the xml list in DSSSL (would appear painful, at least to 
me).  I have found snippets in the dssslist that appear to give a good 
start, but if anyone has such a function around, that would help.

Actually, I presume that both could be used.  Just seems like a Perl-XML 
solution would be more generic and could be re-used more often.

Thanks for you inputs.

Cheers,
Glenn                                  
--------------------
Glenn R. Kronschnabl
Applied Research Laboratories        | grk@arlut.utexas.edu (PGP/MIME ok)
The University of Texas at Austin    | http://www.arlut.utexas.edu/~grk
PO Box 8029, Austin, TX 78713-8029   | (Ph) 512.835.3642 (FAX) 512.835.3808
10,000 Burnet Road, Austin, TX 78758 | ... but an Aggie at heart!



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS