Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Have html tag inside XML?

From: "Anthony Jones" <Ant@------------.--->
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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent