1336828.html (773B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <script id=o_xml type="text/plain"><?xml version="1.0" encoding="UTF-8"?> 6 <tag_name/> 7 </script> 8 <script id=o_xslt type="text/plain"><?xml version="1.0" encoding="UTF-8"?> 9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="42"> 10 <xsl:variable name="var_name"><xsl:template/></xsl:variable> 11 <xsl:template match="tag_name[$var_name]"/> 12 </xsl:stylesheet> 13 </script> 14 <script> 15 window.onload = function(){ 16 let doc = new DOMParser(), proc = new XSLTProcessor(); 17 proc.importStylesheet(doc.parseFromString(document.getElementById('o_xslt').textContent, "text/xml")); 18 proc.transformToDocument(doc.parseFromString(document.getElementById('o_xml').textContent, "text/xml")); 19 }; 20 </script> 21 </head> 22 </html>