XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
soundari rSubject: xsl:key and key () with input as more than one value - urgent
Author: soundari r
Date: 13 Oct 2005 06:48 AM
Hi,

I am new to use xsl:key functionality. My understanding is u
can reference a key and obtain the corresponding value from an
external xml file. Is that possible to give two or three values
for the query and retrieve one value.

For example:

i want to give empid, and department as input . the output would be
some value matching these two values.

Even in the referenced xml i have the values as
<empid> and <department> and <result> as elements. Its quite urgent.
Any help in this is appreciated.

Thanks in Advance.

Postnext
(Deleted User) Subject: xsl:key and key () with input as more than one value - urgent
Author: (Deleted User)
Date: 13 Oct 2005 11:07 AM
It is up to you to assign a value to the "use" attribute of "key" element. This "use" string will be calculated for each node matching
the pattern (specified as a value of "match" attribute) and the node
will be inserted into the map (actually multimap) using calculated "use" as a key. Take a look at this example:

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="MultiValueKey" match = "/xml/record" use = "concat(key1,key2)" />

<xsl:template match="/">
<xml>
<xsl:for-each select = "key('MultiValueKey','aa')">
<result>
Found: <xsl:value-of select="."/>
</result>
</xsl:for-each>
</xml>
</xsl:template>

</xsl:stylesheet>

processing this xml:

<xml>
<record>
<key1>a</key1>
<key2>a</key2>
</record>
<record>
<key1>a</key1>
<key2>b</key2>
</record>
<record>
<key1>a</key1>
<key2>c</key2>
</record>
<record>
<key1>b</key1>
<key2>a</key2>
</record>
<record>
<key1>b</key1>
<key2>b</key2>
</record>
<record>
<key1>b</key1>
<key2>c</key2>
</record>
</xml>

Posttop
soundari rSubject: xsl:key and key () with input as more than one value - urgent
Author: soundari r
Date: 19 Oct 2005 04:37 AM
Hi,

Thanks for the reply.and it helps me a lot
to understand and solve the problem.

Thanks once again.!

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.