Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Creating tabular HTML output based on comment in XML (using XSLT) Creating tabular HTML output based on comment in XML (using XSLT)To: NULL Date: 10/29/2009 10:55:00 PM Hi Friends Greetings! I have an XML file which contains difference between two xml like this: <?xml version="1.0" encoding="UTF-8" ?> <orders> <OrdersTransaction> <Item> <!-- Changed Element:old --> <Description>Marker</Description> <!-- Changed Element:new --> <Description>Mark er</Description> </Item> </OrdersTransaction> <OrdersTransaction> <Item> <!-- Changed Element:old --> <Description>Eraser</Description> <!-- Changed Element:new --> <Description>eraser</Description> </Item> <Item> <!-- Added Element(s) --> <comment>additional comments</comment> </Item> <Item> <!-- Deleted Element(s) --> <comment>Pen</comment> </Item> <Item> <!-- Changed Element:old --> <Description>Highlighter</Description> <!-- Changed Element:new --> <Description>highlighter</Description> </Item> </OrdersTransaction> </orders> "Deleted Element(s)" means, it was present in First XML, but not anymore in Second XML. "Added Element(s)" means, it was present in Second XML, but not in First XML. "Changed Element:old" means it was like this in First XML but "Changed Element:new" shows the changed version of it in Second XML. Now, these deleted, added or changed components can occur at any position in the XML file. What I mean to say is, the tags can be deep inside. So there is no chance to know beforehand. Only we can check the comments to know which part in the XML holds what. My question: I need to show HTML output in a simple table like this: ------------------------------------------------------------ First XML | Second XML ------------------------------------------------------------ | | Added Element(s): | Item>comment | value: additional comments ------------------------------------------------------------ | Deleted Element(s): | Item>comment | value: Pen | ------------------------------------------------------------ Changed Element:old | Changed Element:new Item>Description | Item>Description value: Highlighter | value: highlighter ------------------------------------------------------------ Now, the tags "Item", "comment" etc are not fixed. It depends on the XML we are comparing. So need to track on the basis of <!-- Added Element(s) -->, <!-- Deleted Element(s) -->, <!-- Changed Element:new --> etc. and need to render the table printing the values and attributes in the tags. Please ask me anything you like. Thanks a ton in advance Ayan | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
