Page 1 of 1

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

Posted: Tue Mar 07, 2017 4:28 am
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

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

Posted: Tue Mar 07, 2017 10:03 am
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

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

Posted: Wed Mar 08, 2017 1:08 am
by raybiss
Thank you very much!
It works perfectly.

Regards,
Raymond

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

Posted: Fri Apr 07, 2017 12:30 pm
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