[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Testing 2 XML documents for equality - a solution
> For a given element node if you calculate an XPath to the > current node, and then use that XPath to find a node in the > other document, you have two nodes, you then need to compare > whether they are equal, but that is _exactly_ the problem you > are trying to solve. The earlier stylesheet just took the > string value of the node but that is just the concatenation > of all the element content so loses most of the markup information. True enough, I would suggest restricting it to data-centric XML, or adding a special case for mixed content nodes. I really think the aim here is to keep it as simple as possible, rather than create the de-facto comparison stylesheet. > What is wrong with the much simpler alternative of just > writing out the string corresponding to a specific > "canonical" linearisation, and then jsut comparing those two strings? I guess because how do you map back to the element/attribute that doesn't match once you've done the comparison. cheers andrew
|
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
|