Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi, I would like to use the WC_VERSION_ATTR Revision number in gentext.
I've got the attribute correct in arbortext via bursting rules (twoway). -> rev = WC_VERSION_ATTR
When I generate the text containing the rev (with xpath) is say as example: B.7
I would like the show only the Revision of the document: B (without the .7)
Is there a way to read the rev attribute and modify attribute ?
thanks in advance
christian
Solved! Go to Solution.
Hi Christian,
If you're already using XPath then good news, there is a function for this: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/substring-before
The following example should do the trick:
substring-before(/get/my/WC_VERSION_ATTR,".")
Replace /get/my/WC_VERSION_ATTR with your current XPath that retrieves "B.7", then the substring-before function will strip off everything after (and including) the full stop period dot.
My only concern is that you mention using two-way bursting. I don't think you can (or should) be modifying WC_VERSION_ATTR from the Arbortext side.
Hi Christian,
If you're already using XPath then good news, there is a function for this: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/substring-before
The following example should do the trick:
substring-before(/get/my/WC_VERSION_ATTR,".")
Replace /get/my/WC_VERSION_ATTR with your current XPath that retrieves "B.7", then the substring-before function will strip off everything after (and including) the full stop period dot.
My only concern is that you mention using two-way bursting. I don't think you can (or should) be modifying WC_VERSION_ATTR from the Arbortext side.
Dear Gareth,
thank you for your input ,works fine ! substring-before(/RDStyle/ResolvedMap/techinfomap/@rev, '.'
Regarding the two-way bursting, according to PTC, WC_VERSION_ATTR is read-only and can be used only in a twowaymetadatarule burst configuration file rule where the mode is toxml.
Do you have make any bad experiance ?
Thank you
Christian
That sounds all good, glad to hear you got it working now 🙂