String to Nodelist

Here should go questions about transforming XML with XSLT and FOP.
prashuss
Posts: 2
Joined: Thu Nov 03, 2005 4:49 am

String to Nodelist

Post by prashuss » Thu Nov 03, 2005 4:55 am

Hi....
I've XML schema as shown below:
\
<UI_BeneficiaryInfo>
<PrimaryBeneficiary>
<Beneficiary1>
<Name/>
<Relationship/>
<PercentDesignated/>
</Beneficiary1>
<Beneficiary2>
<Name/>
<Relationship/>
<PercentDesignated/>
</Beneficiary2>
</PrimaryBeneficiary>
</UI_BeneficiaryInfo>

I've to display the 2 rows corresponding to Beneficiary. Each row will contain name, relationship & percent. I was able to display these rows but I couldn't assign the XPATH to them. I've a written a loop to display these rows & when I'm concatenating the XPATH with Beneficiary & then appending 1, 2 ....through for-loop, I'm getting an exception, since it bacame the string after concatenation. What I need is a value & not a string. Can anyone help?

prashuss
Posts: 2
Joined: Thu Nov 03, 2005 4:49 am

Post by prashuss » Thu Nov 03, 2005 5:54 am

Basically, I want to evaluate a string as an XPath expression in XSL. How can I do that????

george
Site Admin
Posts: 2101
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Thu Nov 03, 2005 12:02 pm

Hi,

If you want to use standard XSLT then the solution is to split the transformation in a couple of steps. For instance you can apply a stylesheet S1 on your XML data that will generate also a styelsheet, let's say S2. Then you apply S2 on the XML data and get your final output. In this way you can generate with S1 code that will be considered as XSLT code in the second step.
If you do not have problems with a certain XSLT processor dependency then you can use that processor evaluate extension if available, for instance Saxon has such an extension function:
http://saxon.sourceforge.net/saxon6.5.4 ... l#evaluate

Best Regards,
George

Post Reply