Hi all,
I must have a variable in my XML location Path, is it possible ?
When i test it with '6' all is ok and it work like i want, but if this value is in variable, it have an error.
This work :
[Metadata.Text:Path="/contexture/publication/parution/cahier/pages/page[@folio='6']/@verrou",Dataset="SYELA-XML",Model="XML"]
https://www.dropbox.com/s/sgwijeqzh1pq9 ... 6.png?dl=0
Here i just remplaced the value '6' by my variable '[Job.PrivateData:Key="FOLIO"]' and This don't work :
[Metadata.Text:Path="/contexture/publication/parution/cahier/pages/page[@folio='[Job.PrivateData:Key="FOLIO"]']/@verrou",Dataset="SYELA-XML",Model="XML"]
https://www.dropbox.com/s/gnfqyggd9297d ... 1.png?dl=0
Any idea please ???? thanks.
Switch Variables in XML Location Path
-
- Member
- Posts: 38
- Joined: Tue Sep 30, 2014 3:28 pm
Re: Switch Variables in XML Location Path
Try escaping the square brackets around your variable like \[Job.PrivateData:Key="FOLIO"\]. Switch is picky when it comes to square brackets.
-
- Member
- Posts: 38
- Joined: Tue Sep 30, 2014 3:28 pm
Re: Switch Variables in XML Location Path
Thanks for your answer but i have the same error...
Re: Switch Variables in XML Location Path
As I said brackets is something Switch is picky about.
This is from the manual:
This is from the manual:
But nested variables are not supported in all variable groups.If used in an argument that supports nested variables, the opening square bracket '[' is interpreted by Switch as the beginning of a new variable. To use the square bracket as static text, you need to double it: '[['. Note that there is no need to double the closing square bracket.
-
- Member
- Posts: 38
- Joined: Tue Sep 30, 2014 3:28 pm
Re: Switch Variables in XML Location Path
Answer from enfocus support... Grrrr
Hi Boris,
It's not possible to use Switch Variables in an XML location path. Switch currently does not convert nested variables in XML. You can find more info on this here: http://www.enfocus.com/manuals/UserGuid ... yntax.html
Kind regards,
Jan De Brabanter
Enfocus Product Specialist
Hi Boris,
It's not possible to use Switch Variables in an XML location path. Switch currently does not convert nested variables in XML. You can find more info on this here: http://www.enfocus.com/manuals/UserGuid ... yntax.html
Kind regards,
Jan De Brabanter
Enfocus Product Specialist
-
- Newbie
- Posts: 6
- Joined: Fri Mar 16, 2018 12:33 pm
Re: Switch Variables in XML Location Path
If you have the scripting module, try this as a script expression...
var theFolio = job.getPrivateData("FOLIO");
var xpathString = "[Metadata.Text:Path=\"/contexture/publication/parution/cahier/pages/page[@folio='" + theFolio + "']/@verrou\",Dataset=\"Xml\",Model=\"XML\"]";
var theValue = job.getVariableAsString(xpathString);
theValue;
var theFolio = job.getPrivateData("FOLIO");
var xpathString = "[Metadata.Text:Path=\"/contexture/publication/parution/cahier/pages/page[@folio='" + theFolio + "']/@verrou\",Dataset=\"Xml\",Model=\"XML\"]";
var theValue = job.getVariableAsString(xpathString);
theValue;