Display of target data for xs:IDREF (Author mode)

Having trouble installing Oxygen? Got a bug to report? Post it all here.
MaNI
Posts: 10
Joined: Mon Sep 21, 2015 9:52 pm

Display of target data for xs:IDREF (Author mode)

Post by MaNI »

Hello,

I have a customer that uses oXygen and has asked me to produce XML for them to use in it.
The data has (pseudo-XML) something like:
bar <ref ref="123456"/> baz
And elsewhere in the data:
<target id="123456>foobarbaz</target>

The customer requires that in the display (Author mode) the 'ref element' gets replaced with the content 'foobarbaz' - so the display would show "bar >foobarbaz< baz" (Where <> is the little tag markers that your author mode shows.

I know how to do this substitution with e.g. XSLT but I can't seem to make author mode use the XSLT only CSS. Is it possible to have author mode to apply some XSLT before it displays? If not is there some other way that oXygen can achieve this?

Thanks,
Malcolm
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Display of target data for xs:IDREF (Author mode)

Post by alex_jitianu »

Hello Malcom,

You can get the desired effect by using the oxy_xpath() function, like this:

Code: Select all

ref {
content: oxy_xpath(oxy_concat('//target[@id=', attr(ref), ']/text()'));
}
Best regards,
Alex
Post Reply