Start with a conversion that converts any XML document into itself.
- : node, . node - myagenda, -.
, , , , . :
<xsl:template match="myagenda">
<xsl:copy-of select=".">
<xsl:apply-templates select="node() | @*"/>
</xsl:copy-of>
</xsl:template>
: ", ?" , .
, . : XML document . , ; XSLT ( xsl:output):
<xsl:param name="contactName"/>
<xsl:param name="contactPhone"/>
, myagenda , , contact. , :
<xsl:template match="myagenda">
<xsl:copy-of select=".">
<xsl:apply-templates select="node() | @*"/>
<contact>
<name><xsl:value-of select="$contactName"/></name>
<phone><xsl:value-of select="$contactPhone"/></phone>
</contact>
</xsl:copy-of>
</xsl:template>
XML , XSLT :
<xsl:variable name="contact" value="document('contact.xml')"/>
<xsl:variable name="contactName" value="$contact/*/name[1]'/>
<xsl:variable name="contactPhone" value=$contact/*/phone[1]'>
contact.xml name phone ( * , , ).