Name
<xsl:element>
Synopsis
<xsl:element name="
name
|
URI
#
name
" >...</xsl:element>
Description
Inserts the element pointed to by the attribute name into the result document. For example:
<xsl:element name="book" >
<xsl:element name="chapter">
<xsl:text>The Opening of Pandora's Box</xsl:text>
</xsl:element>
</xsl:element>This creates the following in the result node:
<book> <chapter>The Opening of Pandora's Box </chapter> </book>
Elements without explicit namespaces use the default namespace of their current context. Also, you can create a namespace for the element yourself:
<xsl:element name="http://www.oreilly.com/#book" >
This employs the namespace associated with the URI http://www.oreilly.com with the element. If there are no namespaces associated with the URI, it becomes the default namespace.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access