I have the following XML code:
<detaileddescription>
<para>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum aliquam
interdum erat, <computeroutput>monospace output</computeroutput> eget rhoncus nunc
porttitor ut. Ut ac metus sed erat rutrum dignissim.
<parameterlist kind="param">
<parameteritem>
<parameternamelist>
<parametername>item1</parametername>
</parameternamelist>
<parameterdescription>
<para>Param description.</para>
</parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return">
<para>
<computeroutput>ERR</computeroutput> mattis nunc sed velit ultricies
volutpat. Suspendisse potenti. Vivamus nec ligula blandit urna lobortis
tempus.
</para>
</simplesect>
</para>
</detaileddescription>
I’d like to use xsl:apply-templates only to the text node child of the detaileddescription/para element and the <computeroutput> element that’s inside the text node. In other words, I want to apply-templates only to the following content:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum aliquam
interdum erat, <computeroutput>monospace output</computeroutput> eget rhoncus nunc
porttitor ut. Ut ac metus sed erat rutrum dignissim.
Can anyone show me how to do this using XSLT 2.0 and XPath 2.0?
If I understand your question correctly, this should work:
of course, depending on the context note. Otherwise, you could also mean the corresponding tempate that will fit only those elements you want:
Hope this helps,
R