Scientists extracted water and oxygen from moon dust using sunlight. Could it work on the lunar surface?

Scientists extracted water and oxygen from moon dust using sunlight. Could it work on the lunar surface?