Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

(XSLT 1.0) Question about mapping substrings as attributes of an element

$
0
0

Hello,

Let's say I have this block of xml that will be transformed into another xml using XSLT.

<ComboBox><parameter><sqlexpression>SELECT  DISTINCT Type FROM TABLE where typecode = {0} and typename ={1}</sqlexpression></parameter></ComboBox>

Where {0} and {1} are parameters.

I need to pass them as attributes to the parameter element like this:

<parameter variables"0,1"></parameter>

If there are indeed parameters in the sqlexpression I need to create an attribute called "variables" and for each of them write them inside that attribute.

If only {0} then variables="0"

If {0} and {1} then variables="0,1"

and so on.

I've tried doing something with substring-after and substring-before, but obviously I can't get more than one instance on the same string.

Can anyone hlep me?

Thanks in advance and if needed I will try to provide further information.



Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>