Skip to content

Instantly share code, notes, and snippets.

@nickdunn
Created June 7, 2012 10:32
Show Gist options
  • Save nickdunn/2888094 to your computer and use it in GitHub Desktop.
Save nickdunn/2888094 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my_function="http://example.com">
<!--
Note the function declaration above.
While the namespace URI is from the function's extension, I've made up the prefix 'my_function' just for use in this doc.
-->
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
indent="yes" />
<!-- include the stream, this does all sorts of awesome -->
<xsl:include href='efm://functions' />
<xsl:template match="/">
<xsl:variable name='name' select="'I am a boring string.'" />
<p><xsl:value-of select='my_function:hello($name)' /></p>
</xsl:template>
</xsl:stylesheet>
@nickdunn
Copy link
Author

nickdunn commented Jun 7, 2012

We have defined a namespace prefix my_function with a URI http://example.com. This URI maps on to the functions defined in the Hello World example, named hello and hellonode. Make sure you have enabled the Hello World extension.

@proyb2
Copy link

proyb2 commented Jun 7, 2012

Brilliant! Appreciate for getting this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment