xsl-list
[Top] [All Lists]

RE: Conditional extraction of data

2004-11-08 07:25:34
Thanks Brian.  It's nice to know I understand something of this, anyway :)

By the way, I should add, just to let you all know, that I'll reference the 
group in the references section of my submission.  Copies will be available 
(from me) on request - in case anyone wants to know the kinds of questions 
students are being tortured with.

Cheers

Peter

 -----Original Message-----
From:   Bryan Rasmussen [mailto:bry(_at_)itnisk(_dot_)com] 
Sent:   08 November 2004 14:22
To:     xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:        RE: [xsl] Conditional extraction of data


-- 
Bryan Rasmussen
yes <xsl:copy-of select="@*"/> copies all the attributes.

Quoting "Bradley, Peter" <PBradley(_at_)uwic(_dot_)ac(_dot_)uk>:

Hi Bryan,

Hmm.  That's a fair bit to take in.  I'll have to think about that tonight to
understand what's going on there.  I'd completely missed that xsl:copy copied
just the node and not its children.  Looking again its explanation at w3c
schools I begin to understand.

Am I right in thinking that the:

<xsl:copy><xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>

copies all the attributes?  I'm not actually interested in attributes at this
point, just content, but I think I see where you're coming from.

Thanks to both you and David.  At least I have some stuff to try now -
whereas I was fresh out of ideas as midnight approached last night.

As I said to David, I'll try to remember to let you know how I get on

Thanks

Peter

 -----Original Message-----
From:         Bryan Rasmussen [mailto:bry(_at_)itnisk(_dot_)com] 
Sent: 08 November 2004 14:03
To:   xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:      Re: [xsl] Conditional extraction of data


-- 
Bryan Rasmussen



<xsl:copy><xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>

I always prefer this way of copying, generally using a mode, on particular
namespaces or all elements. so

<xsl:template match="*" mode="copier">
<xsl:copy><xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copier"/>
</xsl:copy>
</xsl:template>
<xsl:template match="tag2" mode="copier">
<i><xsl:apply-templates/></i>
</xsl:template> 
<xsl:template math="anElement">
<xsl:apply-templates mode="copier"/>
</xsl:template>

so that everything gets copied with the copier mode, but tag2 doesn't and
it
escapes the mode. This is just a personal preference though. 



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--