[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: two nodes (or attributes) matching each other

Subject: RE: two nodes (or attributes) matching each other
From: Sundar Shanmugasundaram <SSHANMUGASUNDARAM@xxxxxxxxxxxxx>
Date: Thu, 24 Apr 2003 12:46:06 +0530
sundar it services
Hi,

Use this xsl file:

<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:output method="html"/>
<xsl:template match="/">
<html>

<xsl:for-each select="/FINCCIS/Services/Service/@name">
    	<xsl:variable name="FService" select="."/>
<xsl:for-each
select="/FINCCIS/User/Services/Service[.=$FService]">
<p><xsl:value-of select="."/></p>

</xsl:for-each>
</xsl:for-each>
</html>
</xsl:template>
</xsl:stylesheet>

regards,
sundar

-----Original Message-----
From: Jarkko Moilanen [mailto:Jarkko.Moilanen@xxxxxx]
Sent: Thursday, April 24, 2003 12:17 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  two nodes (or attributes) matching each other



Hi!

I am stuck here with fairly simple problem. And in my opinion this looks a
bit like grouping prob, but not sure about that. Anyways, what I want to
achieve here is to get the value of every user service
(/FINCCIS/User/Services/Service) when they match
with the similar service described in the system services
(/FINCCIS/Services/Service/@name)

Below is snippeds from my codes, XML ,XSL and current result.

Any suggestions?

Cheers,
Jarkko

*************************************************************************
XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FINCCIS>
// services attached this user = has permission to use service
<User>
 <Services>
  <Service>SitDisp</Service>
   <Service>XDoc</Service>
 </Services>
</User>

// All services in the system
<Services>
  <Service
     name="SitDisp"
     type="http"
     address="hypst09.uta.fi"
     port=":6969"
     command="/SituationDisplay.htm" />
  <Service
     name="XDoc"
     type="http"
     address="hypst09.uta.fi"
     port=":6969"
    command="/cbroker/XMLServ/XMLHan?command=showpage&amp;name=XDocTopUI"/>
</Services>
</FINCCIS>
**************************************************************************

XSLT:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:output method="html"/>
<xsl:template match="/">
<html>
<xsl:for-each select="/FINCCIS/User/Services/Service">
  	<xsl:variable name="UserService" select="."/>

<xsl:for-each select="/FINCCIS/Services/Service/@name">
    	<xsl:variable name="FService" select="."/>


<xsl:for-each
select="/FINCCIS/User/Services/Service[$UserService=$FService]">
<p><xsl:value-of select="/FINCCIS/User/Services/Service"/></p>

</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</html>
</xsl:template>
</xsl:stylesheet>
***************************************************************************

CURRENT RESULT:
<html>
<p>SitDisp</p>
<p>SitDisp</p>
<p>SitDisp</p>
<p>SitDisp</p>
</html>


****************************************************************
Jarkko Moilanen          "Erehtyminen on inhimillista,
Researcher                mutta todella suuret mokat
jm60697@xxxxxx            vaativat tietokoneen käyttöä."
www.uta.fi/~jm60697
GSM: +358 50 3766 927
****************************************************************
* ITCM | Information Technology and Crisis Management
* http://www.itcm.org
****************************************************************






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.