wood burning stoves 2.0*
The moose likes Testing and the fly likes Comparing XML to XSLT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Comparing XML to XSLT" Watch "Comparing XML to XSLT" New topic
Author

Comparing XML to XSLT

Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

XSLT represents a transformation; not a document. Do you mean you have an XML file generated by XSLT?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
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

Joined: Jul 11, 2001
Posts: 14112
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"?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

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

Joined: May 22, 2008
Posts: 138
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Abder-Rahman Ali wrote:A good idea. But, how can I do that?

In JUnit: assertEquals("xml equal", string1, string2)
 
jQuery in Action, 2nd edition
 
subject: Comparing XML to XSLT
 
Similar Threads
Opensource XML Reporting tool
converting xml to xsl
Internationalization
XSLT to copy an XML document
XSLT vs JSP