Hi,

With this code: 

@request.restful()
def icd10():
    import libxml2
    icd10_xml = libxml2.parseDoc(open('/home/www-data/web2py/applications'+
URL('static','icd10/icd10cm/Tabular.xml'),'r').read())
    response.view = 'generic.xml'
    def GET(**vars):
        search_str = request.vars.search
        xpath_req = '//chapter/section/diag/desc[contains(text(),"'+
search_str+'")]'
        diags = icd10_xml.xpathEval(xpath_req)
        concat = '<?xml version="1.0" encoding="utf-8"?><main>'
        for diag in diags:
            diag_str = str(XML(diag))
            concat = concat + diag_str
        concat = concat + '</main>'
        return concat
    return locals()

I get an HTML view instead of XML.

Why?

Mike

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to