xsl operator,xpath and operator,xpath union,xsl union,xpath or operator,union operator in xpath,union operator,operator xsl,and operator in xsl,union operator xpath, xml%%%xsl operator - WG: XPATH

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

WG: XPATH | union operator question

Subject: WG: XPATH | union operator question
From: christof.hoeke@xxxxxxx
Date: Fri, 19 Dec 2003 17:44:51 +0100
xsl operator
thanks a lot, that makes sense.

btw (hope this is not off-topic), will there be a 2nd edition of the XSLT Programmer's Reference? (i could not found an answer to my question in the 1st edition, but i guess this is too specific anyway. 
but it is still the best book about xslt...)

chris


-----Ursprüngliche Nachricht-----
Von: Michael Kay [mailto:mhk@xxxxxxxxx]
Gesendet: Freitag, 19. Dezember 2003 16:55
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: RE:  XPATH | union operator question


The union operator selects both attributes, the value-of instruction
then selects the one that's first in document order. To get the
innermost one, use 

(@a | ../@a)[last()]

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> christof.hoeke@xxxxxxx
> Sent: 19 December 2003 15:06
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XPATH | union operator question
> 
> 
> hi,
> i have a problem to understand why the following is happening:
> 
> ###TODO
> in the following xml: if the inner @color is there use it, 
> otherwise use the outer @color
> 
> ###XML
> <test>
> 	<line color="outer1">
> 		<x color="inner1"/>
> 	</line>
> </test>
> 
> so i tested the following XSLT:
> ###XSL
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:template match="/test">
> 		<out>
> 			<xsl:apply-templates/>
> 		</out>
> 	</xsl:template>
> 	<xsl:template match="line">
> 		<xsl:apply-templates/>
> 	</xsl:template>
> 	<xsl:template match="x">
> 			<xsl:value-of select="@color | 
> parent::line/@color"/><br/>
> 			<xsl:value-of 
> select="parent::line/@color | @color "/><br/>
> 			<xsl:value-of select="(@color | 
> parent::line/@color)[1]"/><br/>
> 			<xsl:value-of 
> select="(parent::line/@color | @color)[1] "/><br/>
> 	</xsl:template>
> </xsl:stylesheet>
> 
> ###RESULT
> <out>
> 	outer1<br />
> 	outer1<br />
> 	outer1<br />
> 	outer1<br />
> </out>
> 
> i expected at least one inner1 to show up... 
> or i expected "inner1outer1" as a result.
> 
> what does the | operator in "@color | parent::line/@color" 
> select? only the most specific?
> 
> thanks a lot
> chris
> 
>  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.