Hello All,
The xml document below describes the contents of a folder in a Document Managment System. I need to retrieve the DocId for the most recently added (<Add_Date>) spreadsheet file(<name> ends with ".XLS"). As a newbie to XML, XSL and XPATH, I wanted to bounce some ideas off the more experienced folks in this group.
<?xml version="1.0" encoding="utf-8" ?>
<FolderDetails xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"> <Docs> <DocumentDetails> <Name>EIU.xls</Name> <Version>1</Version> <Add_Date>10/8/2003 3:41:51 PM</Add_Date> <DocType>E</DocType> <DocId>15607779</DocId> </DocumentDetails> <DocumentDetails> <Name>MAKE.xls</Name> <Version>1</Version> <Add_Date>10/17/2003 8:22:43 AM</Add_Date> <DocType>E</DocType> <DocId>15608338</DocId> </DocumentDetails> </Docs> </FolderDetails>
My first thought was to transform this XML into another XML which is sorted on Add_date (descending order) and then pick the very first occurance of docId. But there does not seem to be a direct way to sort on a date value.
I know this is an awfully inadequate explanation of what I am attempting to do. But I am asking for any ideas or sample code to quickly and efficiently accomplish this. I am under a tremendous amount of pressure so any help, ideas, code snippets.. gratefully accepted...
Thanks in advance,
Jay
The xml document below describes the contents of a folder in a Document Managment System. I need to retrieve the DocId for the most recently added (<Add_Date>) spreadsheet file(<name> ends with ".XLS"). As a newbie to XML, XSL and XPATH, I wanted to bounce some ideas off the more experienced folks in this group.
<?xml version="1.0" encoding="utf-8" ?>
<FolderDetails xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"> <Docs> <DocumentDetails> <Name>EIU.xls</Name> <Version>1</Version> <Add_Date>10/8/2003 3:41:51 PM</Add_Date> <DocType>E</DocType> <DocId>15607779</DocId> </DocumentDetails> <DocumentDetails> <Name>MAKE.xls</Name> <Version>1</Version> <Add_Date>10/17/2003 8:22:43 AM</Add_Date> <DocType>E</DocType> <DocId>15608338</DocId> </DocumentDetails> </Docs> </FolderDetails>
My first thought was to transform this XML into another XML which is sorted on Add_date (descending order) and then pick the very first occurance of docId. But there does not seem to be a direct way to sort on a date value.
I know this is an awfully inadequate explanation of what I am attempting to do. But I am asking for any ideas or sample code to quickly and efficiently accomplish this. I am under a tremendous amount of pressure so any help, ideas, code snippets.. gratefully accepted...
Thanks in advance,
Jay