Help needed to contruct oxy_path() to populate oxy_popup()

Post here questions and problems related to oXygen frameworks/document types.
raybiss
Posts: 31
Joined: Sat Jan 17, 2015 6:21 pm

Help needed to contruct oxy_path() to populate oxy_popup()

Post by raybiss »

Hi,

I'm trying to supply the list of items for an oxy_popup() from an xml file relative to my framework extension folder.

This works fine if the xml file is relative to the edited topic.

Code: Select all


ph[info=specification] {
content : oxy_popup(
edit, '#text',
values, oxy_xpath('string-join(doc("commun/listes/specifications_techniques.xml")//div[@id=\'liste_specifications\']/ul/li/text(), ",")'),
selectionMode, 'single',
fontInherit, true
);
visibility:-oxy-collapse-text;
}
From my understanding of the post below, this should work in Oxygen 19
topic14141.html)

Code: Select all


ph[info=specification] {
content : oxy_popup(
edit, '#text',
values, oxy_xpath('string-join(doc("${frameworkDir(fr_name)}/specifications_techniques.xml")//div[@id=\'liste_specifications\']/ul/li/text(), ",")'),
selectionMode, 'single',
fontInherit, true
);
visibility:-oxy-collapse-text;
}
Now I'm having a really hard time trying to make it work with oxy_url() as suggested in this post.
post40812.html#p40900

I would really like to have those list with the framework extension, along with the css files.

Can it be done in Oxygen 18?

Thank you,
Raymond
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Help needed to contruct oxy_path() to populate oxy_popup()

Post by Radu »

Hi Raymond,

Indeed with Oxygen 19 which we plan to release in April-May your second example will probably work as it is.
Until then it needs to be re-written using the oxy_url function, probably something like this:

Code: Select all

ph[info=specification] {
content : oxy_popup(
edit, '#text',
values, oxy_xpath(oxy_concat('string-join(doc("', oxy_url('${framework(fr_name)}'), '/specifications_techniques.xml")//div[@id=\'liste_specifications\']/ul/li/text(), ",")')),
selectionMode, 'single',
fontInherit, true
);
visibility:-oxy-collapse-text;
}
I used framework instead of "frameworkDir" because "frameworkDir" returns a file path like "c:\path\to\.." but the XPath doc() function requires an URL-like path like "file:/c:/path/to...".
You can debug this by adding some static content before the element like this:

Code: Select all

ph[info=specification]  {
content : oxy_concat(oxy_url('${framework(fr_name)}'), "/specifications_techniques.xml");
color:red;
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
raybiss
Posts: 31
Joined: Sat Jan 17, 2015 6:21 pm

Re: Help needed to contruct oxy_path() to populate oxy_popup()

Post by raybiss »

Thank you very much!
It works perfectly.

Regards,
Raymond
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Help needed to contruct oxy_path() to populate oxy_popup()

Post by sorin_carbunaru »

Hi,

Just wanted to let you know that oXygen 19.0 has been released two days ago and in this version the oxy_xpath() CSS function supports editor variables.

Best wishes,
Sorin Carbunaru
oXygen XML
Post Reply