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

Re: problen comparing node with one variable in xslt

Subject: Re: problen comparing node with one variable in xslt
From: "Andrew Curry" <andrew.curry@xxxxxxxxxxxx>
Date: Thu, 4 Mar 2004 13:27:16 -0000
xslt comparing variables
Really bad coding but in a rush,
this should work

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
        <xsl:output method="html" indent="yes"/>
<xsl:template match="*">
<xsl:for-each select="//masterinformacion_padre">
<xsl:choose>
<xsl:when test="//masterinformacion_sel = .">
ok
</xsl:when>
<xsl:otherwise>
        ko
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

----- Original Message -----
From: "Dionisio Ruiz de Zarate" <dionisio@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, March 04, 2004 1:36 PM
Subject: Re:  problen comparing node with one variable in xslt


> The xml file is the bellow file.
>
> i mus tto compare the masterinformacion_sel node value (1224) with the
> masterinformacion_padre node value.
> print ok if are the same value and KO is are diferents.
> Can you help me please? thaks.
> i hope your answer.
>
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> <sn_servicioproyecto>
> <masterinformacion_sel>1224</masterinformacion_sel>
> <servicioproyecto_id>15</servicioproyecto_id>
> <servicioproyectopadre_id>0</servicioproyectopadre_id>
> <servicio_id>1</servicio_id>
> <proyecto_id>7</proyecto_id>
> <servicioproyectohijos>
> <sn_servicioproyecto>
> <servicioproyecto_id>1034</servicioproyecto_id>
> <servicioproyectopadre_id>15</servicioproyectopadre_id>
> <servicio_id>1</servicio_id>
> <proyecto_id>7</proyecto_id>
> <informacion>
> <sn_masterinformacion>
> <masterinformacion_id>1225</masterinformacion_id>
> <masterinformacion_padre>1224</masterinformacion_padre>
> </sn_masterinformacion>
> <sn_masterinformacion>
> <masterinformacion_id>1225</masterinformacion_id>
> <masterinformacion_padre>1223</masterinformacion_padre>
> </sn_masterinformacion>
> </informacion>
> </sn_servicioproyecto>
> </servicioproyectohijos>
> </sn_servicioproyecto>
>
>
>
>
> > whats the xml look like please?
> > ----- Original Message -----
> > From: "Dionisio Ruiz de Zarate" <dionisio@xxxxxxxxxxxxx>
> > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Sent: Thursday, March 04, 2004 12:52 PM
> > Subject:  problen comparing node with one variable in xslt
> >
> >
> >> with this.
> >> <xsl:variable name="var_masterinformacion_id">
> >> <xsl:value-of select= "sn_servicioproyecto/masterinformacion_sel"/>
> >> </xsl:variable>
> >> <xsl:value-of select= "$var_masterinformacion_id"/>
> >>
> >> i print the variable value
> >>
> >> with this:
> >> <xsl:value-of select= "masterinformacion_padre"/>
> >> i print the node value
> >>
> >> but i want to compare tthe variable and the masteriformacion_padre
value
> >> and if are the same value print ok
> >> i am trying with this code:

> >>
> >> butr it doesn't run.
> >> can you help me please?
> >> i am working in this problem during 2 days and i cannot resolve it.
> >> can you help me please?
> >> thyanks
> >>
> >>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >>
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
>
>
>  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.