Page 1 of 1

Using custom functions defined in an external xsl file in ox

Posted: Fri Oct 24, 2014 6:09 pm
by DirkDubois
Hello,

Does anyone know of a way to call functions defined in an external xsl style sheet from the oxy_xpath() function provided to populate content in a CSS file?

I am implementing some form controls whose values are populated by an xpath expression. The often the xpath expressions are very complicated and have dependencies on other xml files or are attempting to do conditional matches across the current document.

The problem is as follows:
XML Source:

Code: Select all


<root>
<group>
<ID>myID</ID>
<item>(content to be populated by xpath)</item>
</group>
<definitions>
<define>
<ID>myID</ID>
<list>value 1</list>
</define>
<define>
<ID>myOtherID</ID>
<list>value 2</list>
</define>
</definitions>
</root>
CSS File:

Code: Select all


item{
content:oxy_xpath("util:getItemContent(../ID)");
}
I am open to a complete solution implemented in place in xpath, but at the moment I have not been able to get this working. Thank you for all your help.

Sincerely,
Dirk Dubois

Re: Using custom functions defined in an external xsl file i

Posted: Tue Oct 28, 2014 9:39 am
by alex_jitianu
Hello Dirk,

Unfortunately I can't think of a way to do that... Just to make things clearer, you want this because the XPath language in itself imposes limitations or just because it is convoluted to express some complex things?

What you can currently do is to move this code from the CSS to a StylesFilter (which is a java extension). From a Styles filter you can use our Java based API to execute an ,%20int)]XSLT transformation.

Best regards,
Alex

Re: Using custom functions defined in an external xsl file i

Posted: Tue Oct 28, 2014 3:26 pm
by DirkDubois
Hello Alex,

Thank you for the quick reply. I assumed I would have to move to a java based extension to develop some of the more complex selection functionality that we want to implement in the author view. Currently we do not develop in java as our language of choice is C#. Do you happen to know of a way to develop in C# and port to Java for oxygens extensions? Or must I use Java? Thank you for all your help.

Thanks,
Dirk

Re: Using custom functions defined in an external xsl file i

Posted: Tue Oct 28, 2014 4:19 pm
by alex_jitianu
Hello Dirk,

I don't have much knowledge of such conversions from C# to Java. Searching on-line does produce some tools that do that but I can't really envision how that would work. Our API is Java based and in the code you write you have to use this API, is not like you just write a generic C# code (with no dependencies of external libraries) that will then be converted...

Best regards,
Alex

Re: Using custom functions defined in an external xsl file i

Posted: Tue Oct 28, 2014 4:35 pm
by DirkDubois
Hello Alex,

I figured as much. Well not a problem we will simply develop a plugin in Java (the language is very similar to C# anyway). Do you have a particular toolchain or IDE to recommend when developing plugins for oxygen?

Thanks,
Dirk

Re: Using custom functions defined in an external xsl file i

Posted: Wed Oct 29, 2014 9:48 am
by alex_jitianu
Hello Dirk,

Well, all of us are using Eclipse and we have a number of topics in our documentation that describe how to use Eclipse for various tasks. Starting with version 16.0 the SDK we have a Maven repository for the SDK and we found an Eclipse IDE for Java EE Developers very helpful when working with Maven projects. You can read some more about the StylesFilter I've talked about in topic Configuring CSS Styles Filter.

Best regards,
Alex

Re: Using custom functions defined in an external xsl file i

Posted: Wed Oct 29, 2014 3:27 pm
by DirkDubois
Hello Alex,

Thank you for all the great support! I will investigate these technologies and tools.

All the best,

Dirk