Jump to content

compare


neerajmurali

Recommended Posts

For comparing the contents of two elements i am using the compare funtion.but its showing error like this 'compare' is not a valid XSLT or XPath function.i am using IE 6 browser. for eg i want to compare the following two elements and check wther its same .<artist>Empire Burlesque</artist> <author>Dolly Parton</author>

Link to comment
Share on other sites

Well, a compare() functin simply doesn't exist, that's for sure.What do you mean by "the same"? Whether it's content is equivalent to another? Well, you can use XPath predicates for that, like so:

artist[.=../author]

That would compare whether the artist element is the same as the author below it.

Link to comment
Share on other sites

Whoa... but... oh... so there is a compare() function. Curious... anyhow.No, Xalan doesn't currently support XPath 2.0. Btw, I know from a trusty source (Michael Kay, editor of the XSLT 2.0 specification) that XPath 2.0 won't be available for XSLT 1.0 processors. So whenever you're wondering if a certain XSLT processor supports XPath 2.0, you should instead ask yourself if it's an XSLT 2.0 processor. The only 2 XSLT 2.0 processors currently are Saxon and AltovaXML2007.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...