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

XPATH String

SOLVED
czaugg-2
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

Re: XPATH String

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

Re: XPATH String

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

Re: XPATH String

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

Re: XPATH String

That sounds all good, glad to hear you got it working now 🙂

Announcements