wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes How to copy a portion of xsl into a variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to copy a portion of xsl into a variable" Watch "How to copy a portion of xsl into a variable" New topic
Author

How to copy a portion of xsl into a variable

Lalit Bansal
Ranch Hand

Joined: Jan 29, 2007
Posts: 63
Hi,

I've the following XSL:



On applying this XSL on the concerned XML, I get properly required transformed XML.
Now, I want a portion of this transformed XML into an XSL variable. This variable should have exact copy of the portion of XML that I require; which means it should include all the tags, values, etc.
The portion that I require to copy in the variable is between the <lif:xmlInput> and </lif:xmlInput> tags.

Pls help me out with the soultion for same. Any pointers shall be highly appreciated.

Thnx in advance.

regards,
[ December 14, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41508
    
  53
For future reference, you can edit an existing post (including setting the "Don't use smilies" checkbox") by clicking the little paper-and-pencil icon ().


Ping & DNS - my free Android networking tools app
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Well, don't generate it (i.e. send it to the output) and then try to put it in a variable. Put it in the variable first, then send it to the output.
Lalit Bansal
Ranch Hand

Joined: Jan 29, 2007
Posts: 63
Hi Paul,

That is exactly what I want. I want to know how to put the code between <lif:xmlInput> and </lif:xmlInput> tags in a variable.

Thanks in advance.

regards,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I'm sorry, I thought that was obvious.
Lalit Bansal
Ranch Hand

Joined: Jan 29, 2007
Posts: 63
Hi Paul,

Thaks for the information.

I shall be highly obliged if your could help me further in my requirement. I want this variable to be converted to a string. The purpose is that I want the entire code portion between <xmlInput> tags as a String.

Thanks in advance.

regards,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

What kind of string? An XSLT string? (I don't understand what it would mean to convert that element to a string in XSLT so perhaps you could explain a bit more if that's the case.) Or a Java string?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to copy a portion of xsl into a variable