I have a xml document which has a node that contains a proper name then a dash (-) followed by a description. I want to only display the proper name.
<productroot>
<name>Proper name - lots of text not relevant to my display.</name>
</productroot>
Thanks
Here is a complete solution:
when this transformation is applied on the XML document below:
the wanted, correct result is produced:
Explanation:
Overriding the identity rule.
Use of the standard XPath functions
contains()andsubstring-before().