Page 1 of 1

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

Posted: Tue Sep 22, 2015 10:43 am
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

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

Posted: Tue Sep 22, 2015 12:32 pm
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