[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL Transformation
Hi, I have an XML doc that looks like this <STOCKITEM> <CATEGORY>A</CATEGORY> <STOCKCODE>123</STOCKCODE> </STOCKITEM> <STOCKITEM> <CATEGORY>A</CATEGORY> <STOCKCODE>456</STOCKCODE> </STOCKITEM> <STOCKITEM> <CATEGORY>B</CATEGORY> <STOCKCODE>789</STOCKCODE> </STOCKITEM> I would like to transform it into this kind of structure using XSL: <CATGEGORY name="A"> <STOCKITEM> <CODE>123</CODE> </STOCKITEM> <STOCKITEM> <CODE>456</CODE> </STOCKITEM> </CATEGORY> <CATGEGORY name="B"> <STOCKITEM> <CODE>789</CODE> </STOCKITEM> </CATEGORY> I don't know the categories in advance, and there are also sub cats that will nest within the categories. I could do it using scripts and some kind of fudge based on the SQL SELECT DISTINCT category idea. However, I think this is somewhat against the spirit of XSL. Any ideas on how this might be done? I can't be this first person to want to do this kind idiom. Many Thanks James Thompson ########################################## This email, its content and any files transmitted with it are intended solely for the addressee(s) and may be legally privileged and/or confidential. Access by any other party is unauthorised without the express written permission of the sender. If you have received this email in error you may not copy or use the contents, attachments or information in any way. Please destroy it and contact the sender on the number printed above, via the Dresdner Kleinwort Benson switchboard on +44 171 623 8000 or via e-mail return. Internet communications are not secure unless protected using strong cryptography. This email has been prepared using information believed by the author to be reliable and accurate, but Dresdner Kleinwort Benson makes no warranty as to accuracy or completeness. In particular Dresdner Kleinwort Benson does not accept responsibility for changes made to this email after it was sent. Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the Bank or its affiliates. They may be subject to change without notice. ########################################## xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|