3 ], function(smartxml) {
9 var isMetaAttribute = function(attrName) {
10 return attrName.substr(0, 5) === 'meta-';
15 var WLXMLElementNode = function(nativeNode) {
16 smartxml.ElementNode.call(this, nativeNode);
18 WLXMLElementNode.prototype = Object.create(smartxml.ElementNode.prototype);
20 $.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, {
21 getClass: function() {
22 return this.getAttr('class');
24 getMetaAttributes: function() {
26 this.getAttrs().forEach(function(attr) {
27 if(isMetaAttribute(attr.name))
28 meta[attr.name.substr(5)] = attr.value;
32 getOtherAttributes: function() {
34 this.getAttrs().forEach(function(attr) {
35 if(attr.name != 'class' && !isMetaAttribute(attr.name))
36 toret[attr.name] = attr.value;
43 var WLXMLDocument = function(xml) {
44 smartxml.Document.call(this, xml);
46 WLXMLDocument.prototype = Object.create(smartxml.Document.prototype);
47 $.extend(WLXMLDocument.prototype, {
48 ElementNodeFactory: WLXMLElementNode
53 WLXMLDocumentFromXML: function(xml) {
54 return new WLXMLDocument(xml);