Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java call backs in XSLT

 
Devesh H Rao
Ranch Hand
Posts: 687
Hibernate jQuery Spring
  • Mark post as helpful
  • send pies
  • 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
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic