How to set the value for a leaf by copying from another leaf

Hi,

Can you please tell how to set the value for a leaf by copying from another leaf?

can we use leafref {path “./x=current()”}?

Thanks in Advance!

i.e.,
leaf if-name {
type leafref {
path “/wan-interface:wan-interface/wan-interface:interface/wan-interface:if-name”;
}
}

			leaf QOS-OUT {
				tailf:cli-allow-join-with-value;
				type leafref {
					path "./if-name=current()";
				}
			}