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

Re: new: how to change value of attributes

Subject: Re: new: how to change value of attributes
From: "Martin Honnen" Martin.Honnen@xxxxxx
Date: Fri, 27 Nov 2009 18:16:26 +0100
Re:  new: how to change value of attributes
> ivanmacculi@xxxxxxxxx wrote:
> > I've problems with Michael Kay suggestion:
> > 1) Oxygen tells me to declare f: namespace and xs: namespace:
> > <xsl:function name=3D"f:index-of-node" as=3D"xs:integer*">.
> 
> The xs namespace needs to be http://www.w3.org/2001/XMLSchema so put
>   xmlns:xs=3D"http://www.w3.org/2001/XMLSchema"
> on your xsl:stylesheet element.
> To define your own functions you are free to choose a namespace but you=
 
> need to choose one.
> 
> > 2) <xsl:template match=3D"*[. intersect $g]/@LABEL"> is open but not =
closed. Where can i close it? thank you so much.
> 
> I think Michael's suggestion is to replace
> 
>    <xsl:template match=3D"mets:div/@LABEL[matches(., '^Pagina [0-9]+$')=
]">
>      <xsl:variable name=3D"n">
>        <xsl:number level=3D"any" count=3D"mets:div[@LABEL[matches(., 
> '^Pagina [0-9]+$')]]"/>
>      </xsl:variable>
>      <xsl:attribute name=3D"LABEL" select=3D"concat('Carta ', if ($n mo=
d 2 =3D 
> 0) then concat(($n + 1) idiv 2, 'v') else concat(($n + 1) idiv 2, 'r'))=
"/>
>    </xsl:template>
> 
> in the solution I posted with
> 
> <xsl:variable name=3D"g" select=3D"//mets:div[matches(@LABEL, '^Pagina
> [0-9]+$')]"/>
> 
> <xsl:template match=3D"*[. intersect $g]/@LABEL">
>    <xsl:variable name=3D"n" select=3D"f:index-of-node($g, ..)"/>
>      <xsl:attribute name=3D"LABEL" select=3D"concat('Carta ', if ($n mo=
d 2 =3D 
> 0) then concat(($n + 1) idiv 2, 'v') else concat(($n + 1) idiv 2, 'r'))=
"/>
> </xsl:template>
> 
> plus the function he posted.
> 
> 
> 
> -- 
> 
> 	Martin Honnen
> 	http://msmvps.com/blogs/martin_honnen/

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.