Pergunta

regarding:

A literal result element acts as an instruction to construct an element node with the same name in the result tree. The XSLT processor effectively creates a shallow copy of the literal result element from the stylesheet and inserts it into the result tree at the location within the result tree that is currently being constructed.

Source: http://lenzconsulting.com/how-xslt-works/#literal_result_elements

I'm wondering what does he mean when he say The XSLT processor effectively creates a shallow copy of the literal result element ?

What's a shallow copy mean in this context?

Foi útil?

Solução

I'm wondering what does he mean when he sayThe XSLT processor effectively creates a shallow copy of the literal result element ?

What's a shallow copy mean in this context?

The W3C XSLT specification, which is the only normative document specification of the XSLT language doesn't use the term "shallow copy"

My guess what the material referenced in this question wanted to state, is illustrated by this example:

 <h1>
   <xsl:value-of select="."/>
 </h1>

In the output, the element <xsl:value-of select="."/> isn't copied. A "shallow copy" does not copy any children nodes.

Once again, it is best to forget about "shallow copying" of the literal redult element and to rely only on the normative specification.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top