Subject: RE: [xsl] xsl <xsl:template match= question From: "dmitri kerievsky" <dmitrik@xxxxxxxxxxxxxx> Date: Fri, 14 Jun 2002 15:04:38 -0400 |
Thanks for responding. The code using match="catalog/artist/album/label/person" does work, except it seems to include the value within title. Is there a way to avoid this? Dmitri -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of sara.mitchell@xxxxxxxxx Sent: Friday, June 14, 2002 1:14 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl <xsl:template match= question At the very least, the path in the match="" portion of the template does not match the actual path you have shown in your example. What you appear to be missing is the the "/" in the path means go down to children -- it doesn't have to sort through siblings. So: * match="catalog/artist/name/album/title/label" is looking for the label element in a structure like this <catalog> <artist> <name> <album> <title> <label></label> </title> </album> </name> </artist> </catalog> It looks like what you really want is the attributes on the person element. The path to person based on your example is: match="catalog/artist/album/label/person" If you use this, the code to create the Mailto should work. Sara > -----Original Message----- > From: dmitri kerievsky [mailto:dmitrik@xxxxxxxxxxxxxx] > Sent: Friday, June 14, 2002 7:16 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] xsl <xsl:template match= question > > > this is outputting AB, instead of > href="mailto:joe@xxxxxxxx">joe doe</a> > how can this line <xsl:template > match="catalog/artist/name/title/album/label/"> > in the .xsl be changed to do this, without assigning an attribute? > thx, > dk > > .xml > > <catalog> > <artist> > <name></name> > <album> > <title>AB</title> > <label> > <person email="joe@xxxxxxxx" > name="joe doe"/> > </label> > </album> > > </artist> > </catalog> > > > .xsl > > <xsl:template match="catalog/artist/name/title/album/label/"> > <a href="{concat('mailto:', @email)}"><xsl:value-of > select="@name" > /></a> > </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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl <xsl:template match= , sara . mitchell | Thread | RE: [xsl] xsl <xsl:template match= , sara . mitchell |
RE: [xsl] Xalan Transformation Erro, Scott Purcell | Date | RE: [xsl] Yet Another Flat File to , Bill Cohagan |
Month |