Specific part/character of the value in XML

615 views Asked by At

Does anyone know how to select specific character or part in XML value in node?

For example I have value <Country> Holland </Country> or <City>'s-Hertogenbosch</City> and I want to select 'a' character from <Country> and ' (single quote) in <City> without using substring() functions: how can I achieve that? I tried almost everything, but except substring, substring-before, substring-after neither is working.

2

There are 2 answers

0
Mihail Mitrevski On

I solve this two days ago , first i rendered whole data with render-xml() function and in the output whole node-set is provided as a string..then i split that string with function tokenize() in every single quote character or 'a'..for example tokenize($string, "&amp;") and the in the other variable i put them together like this string-join($tokenize, "\&ampt;")..it seems to work for me...previous i used concat-sequence-format(&tokenize,"\&ampt;") as instead of string i insert a node-set, but obviously is not working (as a node-set)and i don't know why.

2
Andre Leon Rangel On

Is not clear what you are trying to achieve. What you can do is to use the following flow: convert the xml to a clean STRING (uglify it). use a java activity with java Regular Expressions RegExp put the selected words containing the character in a list structure

please give more details of what you are trying to achieve