Subject: Re: [xsl] Re: node() implementation From: Jarkko Moilanen <Jarkko.Moilanen@xxxxxx> Date: Thu, 12 Jun 2003 09:45:31 +0300 (EEST) |
Thank You too Dimitre. On Wed, 11 Jun 2003, Dimitre Novatchev wrote: > In the first solution there is no code that will copy text nodes and the > value of attribute nodes to the result tree -- the template matching > "node()" is overriding the default rule for text nodes. > > The main difference between the first template and the second is that the > latter matches only element nodes, leaving the default processing (copying > the text) of text nodes to the default rule. This is why the text of text > nodes is copied into the result tree. > > Also, the template matching attributes has an explicit xsl:value-of, which > copies the value of the current attribute node to the result tree. > > > I hope this helped. > > > ===== > Cheers, > > Dimitre Novatchev. > http://fxsl.sourceforge.net/ -- the home of FXSL > > > > > <Jarkko.Moilanen@xxxxxx> wrote in message > news:1055341776.3ee73cd069856@xxxxxxxxxxxxxx > > I was given this question: > > "I have a difficulty to find an example of stylesheet which strips all > xml > > tags leaving only text and attributes ( I need it for indexing ) . > > It should work with IE. Some examples I picked up from Internet just > upset IE." > > > > So what I suggested was: > > > > <xsl:stylesheet version="1.0" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > > > <xsl:output method="text"/> > > > > <xsl:template match="node()"> > > node:<xsl:apply-templates/> > > <xsl:apply-templates select="@*"/> > > </xsl:template> > > > > <xsl:template match="@*"> > > attr:<xsl:apply-templates/> > > </xsl:template> > > </xsl:stylesheet> > > > > For some reason with MSXML it did not work (produced not values of > > node values or attributes. It did work with Xalan C++. > > > > The following stylesheet is according to a third party working > > correctly. > > > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > > > <xsl:output method="text"/> > > > > <xsl:template match="*"> > > node:<xsl:apply-templates select="node()"/> > > <xsl:apply-templates select="@*"/> > > </xsl:template> > > > > <xsl:template match="@*"> > > attr:<xsl:value-of select="."/> > > </xsl:template> > > > > </xsl:stylesheet> > > > > > > So my question is which processor (well IE aint a processor) > > is doing the job correct > > > > Cheers, > > </Jarkko> > > > > *************************************************** > > * Jarkko Moilanen * > > * Project Researcher, ITCM (www.itcm.org) * > > * Profound XML technology Expert * > > * University of Tampere * > > * Hypermedia Laboratory * > > *************************************************** > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > **************************************************************** Jarkko Moilanen "Erehtyminen on inhimillista, Researcher mutta todella suuret mokat jm60697@xxxxxx vaativat tietokoneen käyttöä." www.uta.fi/~jm60697 GSM: +358 50 3766 927 **************************************************************** * ITCM | Information Technology and Crisis Management * http://www.itcm.org **************************************************************** XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: node() implementation, Dimitre Novatchev | Thread | [xsl] contains any child nodes attr, florian |
Re: [xsl] node() implementation, Jarkko Moilanen | Date | [xsl] Statistics - Calculating Stan, Hugh Dixon |
Month |