Hi,
I have a collection storing XMLs which like the following format:
VendorZ
…
AAA
…
BBB
…
…
Now, I want to get one of the “Applicant” from the “ApplicantList” by matching the value of “OtherInfo”. For example, I want to display the applicant with “OtherInfo” being “BBB” plus the information of the vendor present in “Vendor” element in a browser in a particular format. And I DON’T want to show any other unrelevant data including other applicants’ information. How can I do that?
Do I need to firstly create an XML object which only contains the “Vendor” and the “Applicant” with “OtherInfo” being “BBB”, and then use an XSL to transform it into my desired format?
Or do I just need to get the whole XML object “DataFromVendor” and then use an XSL to do so?
Furthermore, can the pass thru servlet help me to do so?
Please help me. Thanks a lot.
Andy Ho
Ideally in this situation to construct your Tamino query so that it only selects the data you actually want to display. However that’s a bit awkward to achieve using _xql, it will be much easier with XQuery.
For the moment, it probably makes sense to retrieve the whole DataFromVendor object from Tamino, and use your stylesheet to select the part that you want to display. To do this, you’ll need to supply a parameter to the stylesheet.
In the stylesheet itself, write:
<xsl:param name=“OtherInfo”>
<xsl:template match=“/”>
…
<xsl:apply-templates select=“//Applicant[OtherInfo=$OtherInfo]”/>
…
And in the query URL, specify the value of this stylesheet parameter as xslt_OtherInfo=AAA. The Passthru Servlet (version 4.1.1) will extract this from the Query URL and pass it as a parameter to the transformation.
Michael Kay