parrot Posted July 14, 2011 Share Posted July 14, 2011 Hi, Can you pls help how to retrive only the distinct values from an xml file using xslt/xquery 1.0?<Main> <element1>table</element1> <element2>chair</element2> <element3 newattr1="samsung">cooler1</element3> <element4 new attr1="whirlpool">cooler2</element4> <element1>table</element1> <element2>chair</element2> <element3 newattr1="samsung">cooler1</element3> <element4 new attr1="whirlpool">cooler2</element4> <element3 newattr1="samsung">cooler1</element3> <element2>chair</element2> <element1>table</element1></Main>to get string value as:table | chair |cooler1=samsung |cooler2=whirlpool | Link to comment Share on other sites More sharing options...
Ingolme Posted July 14, 2011 Share Posted July 14, 2011 Using a loop, store values in an array and keep checking the array upon each iteration to see if the value already exists. Link to comment Share on other sites More sharing options...
parrot Posted July 15, 2011 Author Share Posted July 15, 2011 Using a loop, store values in an array and keep checking the array upon each iteration to see if the value already exists.sorry not clear, in which tool you are saying? can you pls give a sample of it?? Link to comment Share on other sites More sharing options...
Ingolme Posted July 16, 2011 Share Posted July 16, 2011 Sorry, I'm mistaken. I was thinking of a programming language, I'm not proficient with XSLT since I hardly need it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.