Using XSLT variable in X PATH string -


i have xpath string follows:

/results/server[@name='server1'] 

i construct new xpath using defined xslt variable:

/results/server[@name='$server'] 

i haven't tried 'concat' might possible that. using xslt 2.0. xslt parser complains if use string defined above:

xpst0003 xpath syntax error @ char 65 on line 89 near: unexpected token "" in path expression

you can refer variable anywhere in xpath expression:

/results/server[@name eq $server] 

if write quotes, '$server', string literal happens contain dollar sign.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -