This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Passing XML Fragment as NodeList  To Java Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Passing XML Fragment as NodeList  To Java Class" Watch "Passing XML Fragment as NodeList  To Java Class" New topic
Author

Passing XML Fragment as NodeList To Java Class

Meenakshi Lingan
Greenhorn

Joined: May 02, 2005
Posts: 4
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

Joined: Jun 03, 2000
Posts: 5040
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


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Meenakshi Lingan
Greenhorn

Joined: May 02, 2005
Posts: 4
Thanks man it works.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Glad I could help.
Keep visiting Javaranch.

- m
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing XML Fragment as NodeList To Java Class