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

RE: Copying and updating selectively

Subject: RE: Copying and updating selectively
From: "John Reid" <John.Reid@xxxxxxxxxxxxxxx>
Date: Sat, 26 Jul 2003 20:49:19 +1000
what apply template does
Um some small changes, but still no result. The first apply-template
gets applied, does it then apply itself recursively,without falling thru
to the next apply-template? If so does the copy statement build a
structure that is then applied once the recursion ends??

<xsl:template match="player/dates">
<xsl:copy>
    <xsl:apply-templates select="@*|node()[not(../@pword=$varPMKey)]"/>
    <xsl:apply-templates select="@*|node()[yes/@ID &lt; $varFrom]"/>
    <xsl:apply-templates select="@*|node()[yes/@ID &gt; $varTo]"/>
</xsl:copy>
</xsl:template>

g'day,

i got so far with this and then came up empty. I want to update/copy a
xml file updating any yes node to null (i guess deleting the text node
is the better way to put it). So that i start with ONE and end with TWO
on the condition that the @ID date is within the two date parameters.
The code at the bottom is my starting attempt. The two date parameters
are $varFrom=20030806 and $varTo=20030814

any thoughts

salud John Reid

ONE
	<player pword="56545">	
		<dates>
			<yes ID="20030722" WE="Tu"></yes>
			<yes ID="20030729" WE="Tu"></yes>
			<yes ID="20030805" WE="Tu"></yes>
			<yes ID="20030809" WE="Sa">D</yes>
			<yes ID="20030810" WE="Su">D</yes>
			<yes ID="20030812" WE="Tu">D</yes>
			<yes ID="20030819" WE="Tu"></yes>
			<yes ID="20030826" WE="Tu"></yes>
		</dates>
	</player>

TWO
	<player pword="56545">	
		<dates>
			<yes ID="20030722" WE="Tu"></yes>
			<yes ID="20030729" WE="Tu"></yes>
			<yes ID="20030805" WE="Tu"></yes>
			<yes ID="20030809" WE="Sa"></yes>
			<yes ID="20030810" WE="Su"></yes>
			<yes ID="20030812" WE="Tu"></yes>
			<yes ID="20030819" WE="Tu"></yes>
			<yes ID="20030826" WE="Tu"></yes>
		</dates>
	</player>

<xsl:template match="player/dates/yes">
<xsl:copy>
    <xsl:apply-templates select=".[@ID &lt; $varFrom]"/>
    <xsl:apply-templates select=".[@ID &gt; $varTo]"/>
    ?????
</xsl:copy>
</xsl:template>


 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.