Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Creating tabular HTML output based on comment in XML (using XSLT)

From: Ayan@-----------.---------.---
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent