oxy_xpath with xinclude

Hi there, I use oxy_xpath funktion in CSS like this oxy_xpath("string-join(distinct-values(./..//DT/text()),',')") which works very well with an XML like this: <TD> <D> <DT>..</DT> <D> <D> <DT>..</DT> <D> </TD> But if D elements are in XML modules included with XInclude <TD> <xi:include href="d1.xml"/> <xi:include href="d2.xml"/> </TD> No result is found (as expected first). But if I execute XPath in Author mode the results I'm looking for are found. Is there any chance to get this or another oxy_xpath working with xincludes? This oxy_xpath call is the value of "values" property in a popupselection control. So I could implement my own custom control, but I want to avoid this, if possible. Thanks for any hints Markus

Hello Markus, We already have a recorded issue to make the xi:includes transparent for oxy_xpath(). I'll add your vote for it. Meanwhile you can use a StylesFilter to dynamically compute the "values" property [1]. Instead of using an XPath, in the StylesFilter, you can use the API to navigate through the nodes structure and get the text of the DT nodes. The nodes from the XInclude are present in the author node model. [1] http://oxygenxml.com/doc/ug-editor/#topics/api_faq_add_form_control_from_fil... Best regards, Alex -- Alex Jitianu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/19/2014 12:34 PM, practice innovation wrote:
Hi there,
I use oxy_xpath funktion in CSS like this
oxy_xpath("string-join(distinct-values(./..//DT/text()),',')")
which works very well with an XML like this:
<TD>
<D>
<DT>....</DT>
<D>
<D>
<DT>....</DT>
<D>
</TD>
But if D elements are in XML modules included with XInclude
<TD>
<xi:include href="d1.xml"/>
<xi:include href="d2.xml"/>
</TD>
No result is found (as expected first). But if I execute XPath in Author mode the results I'm looking for are found.
Is there any chance to get this or another oxy_xpath working with xincludes?
This oxy_xpath call is the value of "values" property in a popupselection control. So I could implement my own custom control, but I want to avoid this, if possible.
Thanks for any hints
Markus
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Alex, as my :before rule is a little bit more complex StylesFilter is not the way I really like. Is there a way to implement a custom function getMyOwnValues(), which I can include like this: oxy_editor( type, popupSelection, edit, "@attribute", values, getMyOwnValues(), labels, getMyOwnValues(), resultSeparator, "|", columns, 10, selectionMode, "multiple", fontInherit, true); Thanks for your support Markus

Hi Markus, Unfortunately you can't define custom CSS functions. What if you keep the CSS rule as it is and use a StylesFilter only to correct these read-only contexts? if (!styles.isEditable()) { // Read-only context. The XPath will not give any values for this context. StaticContent[] contentProp = (StaticContent[]) styles.getProperty(Styles.KEY_MIXED_CONTENT); EditorContent editorContent = (EditorContent) contentProp[0]; editorContent.getProperties().put(InplaceEditorArgumentKeys.PROPERTY_VALUES, getValues()); } Best regards, Alex -- Alex Jitianu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/19/2014 6:02 PM, practice innovation wrote:
Hi Alex,
as my :before rule is a little bit more complex StylesFilter is not the way I really like.
Is there a way to implement a custom function getMyOwnValues(), which I can include like this:
oxy_editor(
type, popupSelection,
edit, "@attribute",
values, getMyOwnValues(),
labels, getMyOwnValues(),
resultSeparator, "|",
columns, 10,
selectionMode, "multiple",
fontInherit, true);
Thanks for your support
Markus
**
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
Alex Jitianu
-
practice innovation