• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java call backs in XSLT

 
Ranch Hand
Posts: 687
Hibernate jQuery Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a java class which i am calling in XSLT using the java call back api's provided by XSLT.
I am able to pass a NodeList to the calling method as a param but when i return a Node from the method the XSLT engine renders the same as a string [actually the toString of the Node gets called and this gets rendered].

How do i return a Node from the method called from the XSLT. Any help in this regard would be greatly appreciated.


Devesh H Rao
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XSLT isn't "procedural" like that -- so it doesn't and wouldn't "return" anything .... that's why you get the toString issue (unless you're doing it in XML-mode, in which case you actually see the full node structure printed out instead of the textual value of each node in the tree).
 
Devesh H Rao
Ranch Hand
Posts: 687
Hibernate jQuery Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nathaniel Stoddard:
XSLT isn't "procedural" like that -- so it doesn't and wouldn't "return" anything .... that's why you get the toString issue (unless you're doing it in XML-mode, in which case you actually see the full node structure printed out instead of the textual value of each node in the tree).




so you mean to say there is no way the java method that i have called from a xslt function can return a node.

is there any other way i can get this done. ok i think i need to explain a bit more what i need to do before asking what i need

say for example i have 3 nodes
<X> <X>
<X> <X>
<X> <X>

I need to process these nodes and based on certain rules need to return a single node

<X> ? <X>

i am able to pass the NodeList to the java method called from XSLT and i do the processing also but when i return a node the toString of the Node is printed.
is there any way i can get the Processed Node returned from the java method call.

Note: The rules are very dynamic hence i cannot build them in XSLT i need to get this done in Java itself

Thanks
[ September 10, 2004: Message edited by: Devesh H Rao ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic