This content has been marked as final. Show 15 replies
Thanks for your response.
As I am new for XLMP, I am unable to pass value in the variable.
I have created a variable in the field and passed that variable( <?$WATER_M?> ) to the text field in MSWord water mark support.
<xsl: variable name = "WATER_M">
Now below this I am trying to code my condition say:
<?xdofx:if (C_ORDER_NUMBER) = 12345 then $WATER_M = 'MY ORDER' end if?>
but it is not working.
I think the syntax I am using to pass value to the variable when the condition is met is wrong. It should print "MY ORDER" as the water mark when the condition is met.
Can you please correct the syntax.
I'm also trying to include a watermark in my rtf that would need to be conditional. Regarding the XMLP variables, do we have an example that is compatible with the MS Word watermark text field? There are plenty of Java references the user guide, but I didn't see an example from RTF.
I can get Word to pick up an XSL variable, but can't get any IF logic to work around it. Using a set_variable and get_variable also doesn't appear to work so well from a Word watermark perspective (Word didn't successfully do the get_variable when running from Word Format->Background->Watermark->Text).
Message was edited by:
Here is the code I'm using to assign the Word Watermark:
<xsl:variable name="wMarkCancel" select="'CANCELED'"/>
And the value in MS Word in the Watermark Textbox (nav from MS Word: Format->Background->Printed Watermark->Text Watermark):
Any thoughts or suggestions on how to only get the watermark to appear when a flag is set?
I kind of have that impression as well. It looks like the watermark is preprocessed and any if logic wrapped around it is simply ignored, but there has to be a way. Having a watermark that will display when the purchase order is canceled seems like a fairly common requirement. Surely this can't be the first time this functionality has been requested?
I have come up with a solution that I think will work for you. Its using an if statement but its a new or should I say one that we have not documented yet.
<xsl:variable name="wMark" select="xdoxslt:ifelse(.//WM_FLAG='C’,'Canceled','Approved')"/>
I have a single variable wMark and I then use the ifelse statment
thi sis check the value of the WM_FLAG element, if its a 'C' then assign Canceled otherwise assign Approved to the wMark variable
I then have a text watermark
See attached template and XML
Will blog this and other watermarking stuff on Monday
I have used the above code that you have mentioned for watermark but it is not working properly. Actually the XSL variables behave like constants. so, once the if condition is evaluated first time, the first value 'CANCELED' will be there in 'wMark' variable.. and it is not getting updated. i think we need to use updatable variables..
If the above code worked for any one. please tell me clearly how did it work and what was the code exactly. I need it very badly.
The ifelse statement Tim suggested worked fine for me. Here's the actual code I have for a dynamic watermark:
<xsl:variable name="wMark" select="xdoxslt:ifelse(/PO_DATA/CANCEL_FLAG='Y’,'Canceled','')"/>
My code only assigns "Canceled" to the watermark if the flag is set to "Y" and leaves the watermark blank otherwise.
The other Choose and If-Else statements didn't work, but this one does. This is the only example of an xsl variable I've seen where the variable does not behave like a constant and is dynamic (though, technically, the wMark variable is assigned only once in the code).
This is strange.. the same code when i use, is not giving any result.. I mean it is displaying only 'CANCELED' even when the flag is not 'Y' . i will paste the code that i have used.. it is the same..actually..
<xsl:variable name="wMark" select="xdoxslt:ifelse(.//FLAG='B’,'Canceled','')"/>
What is it that you have placed in the watermark text ?? please let me know..
i am using this