[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|