3 ], function(smartxml) {
9 var isMetaAttribute = function(attrName) {
10 return attrName.substr(0, 5) === 'meta-';
15 var WLXMLElementNode = function(nativeNode, document) {
16 smartxml.ElementNode.call(this, nativeNode, document);
18 WLXMLElementNode.prototype = Object.create(smartxml.ElementNode.prototype);
20 $.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, {
21 getClass: function() {
22 return this.getAttr('class');
24 setClass: function(klass) {
25 return this.setAttr('class', klass);
27 getMetaAttributes: function() {
29 this.getAttrs().forEach(function(attr) {
30 if(isMetaAttribute(attr.name)) {
31 toret.push({name: attr.name.substr(5), value: attr.value});
36 getOtherAttributes: function() {
38 this.getAttrs().forEach(function(attr) {
39 if(attr.name !== 'class' && !isMetaAttribute(attr.name)) {
40 toret[attr.name] = attr.value;
48 var WLXMLDocument = function(xml) {
49 smartxml.Document.call(this, xml);
51 WLXMLDocument.prototype = Object.create(smartxml.Document.prototype);
52 $.extend(WLXMLDocument.prototype, {
53 ElementNodeFactory: WLXMLElementNode
58 WLXMLDocumentFromXML: function(xml) {
59 return new WLXMLDocument(xml);
62 WLXMLElementNodeFromXML: function(xml) {
63 return this.WLXMLDocumentFromXML(xml).root;