cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

XPATH String

czaugg-2
5-Regular Member

XPATH String

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

3 REPLIES 3

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.

czaugg-2
5-Regular Member
(To:GarethOakes)

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 🙂

Top Tags