<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
  <ModulePrefs title="NXSL API Example" 
     title_url="http://blog.thestem.ca"
     directory_title="NXSL API Example"
     description="A basic example of using NXSL API to process XML documents returned by Flickr."
     height="0" 
     author="Brett Forsyth"
     author_affiliation="The Stem"
     author_location="North Vancouver,BC"
     render_inline="optional"
     author_email="forsyth.brett+flickrSearchModule@gmail.com"
     scrolling="false" />
    
     <Content type="html"><![CDATA[
        <script src="http://www.google.com/js/nxsl.1.js" type="text/javascript"></script>
        <script type="text/javascript">
            _IG_FetchContent('http://www.flickr.com/services/rest/?api_key=4c037512ae8c92158e700df83682f7d9&method=flickr.people.findByUsername&username=brettf',
            function (responseText){
                    //Convert the responseText into an DOM data structure
                    var nxsl = xmlParse(responseText);
                    
                    //Create a NXSL template. This is where I had the most difficulty.
                    //The template is a XPath expression broken into pieces.
                    //The template will be replaced with the content of the selected element.
                    var user_id = xmlParse('<div select="//user" content="@id"></div>');
                    
                    //Process the template using the data structure created earlier 
                    nxslProcess(nxsl, user_id);
                    
                    //Convert the processed template into XML text and display
                    alert(xmlText(user_id));
                }
            );
        </script>
        ]]>
     </Content>
</Module>