24. Saxon-JS: Updating the browser web page
It’s impractical to expose an API like
innerHTMLfrom within XSLT.Instead, Saxon-JS leverages the existing mechanism for producing result documents
xsl:result-document:<xsl:result-document href="#schedule"><xsl:apply-templates select="ixsl:page()/html"/></xsl:result-document>If the
hrefattribute is a same-document fragment identifier, the resulting output is appended to the element with the corresponding ID.The extension method
ixsl:replace-contentinstructs the processor to replace the content, rather than appending to it:<xsl:result-document href="#schedule" method="ixsl:replace-content"><xsl:apply-templates select="ixsl:page()/html"/></xsl:result-document>(It’s possible to write to any element, even elements that don’t have IDs, by making them the context node first.)