Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Have html tag inside XML? >Thread Next - Re: Have html tag inside XML? Re: Have html tag inside XML?To: NULL Date: 4/5/2006 10:31:00 PM "RedHair" <redhair@u...> wrote in message news:us4itGOWGHA.4148@T...... > Hi Anthony, > > Thanks for your quick reply. > This is like applying template recursively? > Can you explain select="@* | * | node()" to me? > > @* select all attributes in an element. * selects all child elements node() selects any other node The | is effectively a union operator so @* | * | node() selects everything possible inside an XML element. >This is like applying template recursively? Yes. As soon as apply-templates is used the possibility of the template which calls it being called again is always present. So unlike procedural languages where recursion is often thought of as special case or advanced techinique, recursion in XSL is quite natural and common. This template:- <xsl:template match="/ | @* | * | node()"> <xsl:copy> <xsl:apply-templates select="@* | * | node()"/> </xsl:copy> </xsl:template> is known as the identity template and will output the same XML that was input. The template I used in my answer is similar expect I removed the superflous match to the root / and placed a mode on it to limit it's effect to the intended use. Anthony. Anthony | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
