I have to write a XSLT which can remove the last occurrence of the string. The string can have value like
Handmade Paper Wall Art - Floating Square + Dots 23"
Handmade Paper Wall Art" - Floating Square + Dots 23"
Handmade Paper Wall Art - Floating Square + Dots 23" (12"X11")
In the above case only the 1st string , the last " will be removed and other cases it will not remove anything.Please note we are using XSLT 1.0 . Please need your help to get the correct method in XSLT.
I assume that these strings are embedded in an XML document. And I assume that the result you want is a copy of that XML document, only with the changes you described applied.
Is that correct?
If so then first of all you need the XSLT identity transformation, and then you need to include a template which selects the nodes you need changed. That template should use the substring() function and possibly the string-length() function and output the result of the code.
Joined: Nov 22, 2007
Yes these are present in a XML document and using XSLT 1.0 I am creating a feed file. I am not able to determine the last occurrence of " in the String name.
For example we have the strings as below
abc cdv" and a"cd fr"dd.
Now my code is removing the " from both the string. The output is abc cdv and a"cd frdd . However it should only remove the " from the 1st string and the 2nd string should be untouched. I am using the below code