Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing XML Fragment as NodeList To Java Class

 
Meenakshi Lingan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Hopefully someone here can give me a solution or refer me to an appropriate resource.

Consider the following piece of xml
<Maintag>
<SubtagOne>subtag One </SubtagOne>
<SubtagTwo>subtag One </SubtagTwo>
<SubtagThree>subtag One </SubtagThree>
</Maintag>
Now,
while processing this in a xsl:template,I need to pass the above set of elements as a org.w3c.dom.NodeList object to a method in a java class .

Note: I am already aware of how to invoke a Java class method from xslt .

Thanx.
MeenakshiLingan.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are looking just for the expression that returns a NodeSet for these elements, then you could try the following axis -



By definition, this should return a NodeSet that you are looking for.
Although, I must confess, I don't know how to invoke a Java class method from xslt.
Hopefully, I am not missing something.

- m
 
Meenakshi Lingan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks man it works.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad I could help.
Keep visiting Javaranch.

- m
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic