[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

processing xml question

Subject: processing xml question
From: "Falls, Travis D (CASD, IT)" <Travis.Falls@xxxxxxxxxxxxxxx>
Date: Mon, 9 Dec 2002 11:26:17 -0500
item in xml
I have an xml file that I read in.  It has several (potentially 365) item
nodes.  The Item node looks as follows:

<item>
	<id>1038918508813</id>
	<title></title>
	<surveycode>CSEE_iConnect_Channel_Survey_2002-12-03
14:05:51</surveycode>	<link>/HIG/Survey/1038918508811.html</link>
	<pubdate>2002-12-11 00:00:00</pubdate>
	<expdate>2002-12-12 00:00:00</expdate>
	<archdate></archdate>
</item> 

The programming task is to get the most recently published item that isn't
expired and the previous one this one if there is one.

I accomplished this in the past by looping through the document and deleting
all the nodes that haven't been published or are expired.  Then I do a date
compare (second loop) holding two three items at a time to figure out the
news one, the one I publish, and the previously published one.  

I want to do this differently, by building a document fragment of items and
putting them in order newest to oldest.  Then I can just render the first
item in the new document fragment that meets the pubdate and expdate
condition, and the one after that is the previous one.  I don't know how to
take a document fragment and make it a document though, or if I have too. 

Is there a better way to accomplish this?  My programming language is Java,
I am using dom, and crimson.  I have the option of doing some of the xml
manipulation in xslt if I have to, but I am a much better java programmer
then I am a xsl programmer.  

Any advice on how you might do this is appreciated.

Regards,

Travis D. Falls
Developer
The Hartford 


This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.