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

Post here questions and problems related to oXygen frameworks/document types.
raybiss
Posts: 3

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

Tue Mar 07, 2017 4:28 am

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: 5095

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

Tue Mar 07, 2017 10:03 am

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: 3

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

Wed Mar 08, 2017 1:08 am

Thank you very much!
It works perfectly.

Regards,
Raymond
sorin_carbunaru
Site Admin
Posts: 111

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

Fri Apr 07, 2017 12:30 pm

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

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest