Subject: [xsl] processing xml question From: "Falls, Travis D (CASD, IT)" <Travis.Falls@xxxxxxxxxxxxxxx> Date: Mon, 9 Dec 2002 11:26:17 -0500 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Date problem, Allan Jones | Thread | Re: [xsl] processing xml question, Mike Brown |
Re: [xsl] Date problem, David Carlisle | Date | [xsl] how to find position - please, aruniima . chakrabar |
Month |