Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparing XML to XSLT

 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a XML version of a document, and an XSLT version that represents the SAME document.

How can I compare them and check that they are the same in the JAVA?

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XSLT represents a transformation; not a document. Do you mean you have an XML file generated by XSLT?
 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote: XSLT represents a transformation; not a document. Do you mean you have an XML file generated by XSLT?


An XML transformed in XSLT.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abder-Rahman Ali wrote:
An XML transformed in XSLT.


I don't know what that means. How do you "transform an XML document in XSLT"?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abder-Rahman Ali wrote:An XML transformed in XSLT.

It sounds like you now have two XML files. One generated by XSLT and one not. Why not just do a string compare to make sure the contents are identical?
 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:
Abder-Rahman Ali wrote:An XML transformed in XSLT.

It sounds like you now have two XML files. One generated by XSLT and one not. Why not just do a string compare to make sure the contents are identical?


A good idea. But, how can I do that?

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abder-Rahman Ali wrote:A good idea. But, how can I do that?

In JUnit: assertEquals("xml equal", string1, string2)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic