Software / code / prosody
Comparison
util/xml.lua @ 6666:42fdc8dddf04
Merge 0.10->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 06 May 2015 19:26:53 +0100 |
| parent | 6663:d3023dd07cb6 |
| child | 6669:7da8b6bc0966 |
comparison
equal
deleted
inserted
replaced
| 6650:cf15b18e9810 | 6666:42fdc8dddf04 |
|---|---|
| 9 ["http://www.w3.org/XML/1998/namespace"] = "xml"; | 9 ["http://www.w3.org/XML/1998/namespace"] = "xml"; |
| 10 }; | 10 }; |
| 11 local ns_separator = "\1"; | 11 local ns_separator = "\1"; |
| 12 local ns_pattern = "^([^"..ns_separator.."]*)"..ns_separator.."?(.*)$"; | 12 local ns_pattern = "^([^"..ns_separator.."]*)"..ns_separator.."?(.*)$"; |
| 13 return function(xml) | 13 return function(xml) |
| 14 --luacheck: ignore 212/self | |
| 14 local handler = {}; | 15 local handler = {}; |
| 15 local stanza = st.stanza("root"); | 16 local stanza = st.stanza("root"); |
| 16 function handler:StartElement(tagname, attr) | 17 function handler:StartElement(tagname, attr) |
| 17 local curr_ns,name = tagname:match(ns_pattern); | 18 local curr_ns,name = tagname:match(ns_pattern); |
| 18 if name == "" then | 19 if name == "" then |