[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Q: How to manipulate XML based on attribute?
I've got the following XML file: ============= <Page> <Person> <Name vip="true">John Smith</Name> <Friend>Joe Blow</Friend> </Person> </Page> ============= The vip attribute could occur on any element (this is a simplified structure just for example purposes, so assume there could be many different elements besides just these). In other words, it could occur on the Person element, or the Friend element, or not at all. Wherever the vip attribute appears, I want to embed the result of whatever I do with that element in <em></em> tags in the resultant HTML. For the example given above, I'd want the resultant HTML to look like the following: <html> <body> <em><h1>John Smith</h1></em> Joe Blow </body> </html> So, obviously in the standard XSL, I'm embedding the Name element in a <h1> tag. However, since it specifies the vip attribute, I need to embed the resultant manipulation of that tag in an <em> element. Since I don't know which element the attribute may appear on, I need a generic way to handle it. Is this possible? What would the XSL need to look like to do this kind of manipulation (especially where I don't know on which element the attribute could occur)? Thanks for your help! - Sean T. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|