Hi
i've added namspace support
I've change somme lines
change tagTokenRe (the previus change of nodeRe is not necessairy line 79)
Code:
79 var modeRe = /^(\s?[\/>+~]\s?|\s|$)/;
80 var tagTokenRe = /^(#)?((((\([\w-\*:\.]+\))|([\w-\*]+))!)?([\w-\*]+))/;
add namespace table initialiation
Code:
82 if ('undefined' == typeof(document.namespaces)) {//init global namespaces array if undefined
83 document.namespaces = new Array();
83 attibutes=document.documentElement.attributes;
84 i = 0;
85 for (x = 0; x < attibutes.length; x++) {
86 attr = attibutes[x];
87 if (/xmlns:/.test(attr.nodeName)) {
88 var matches = attr.nodeName.split(/:/);
89 var namespace = {
90 name: matches[1],
91 urn: attr.value};
92 document.namespaces[i++] = namespace;
93 }
94 }
95 }
convert ! to : for tagName selector and add namespace search
Code:
168 tagName = tagName.replace('!',':');
169 var am = tagName.match (/(\((.*)\)):(.*)/);
170 if (am){
171 var namespace = Ext.DomQuery.getNS(am[2]);
172 if (namespace) {
173 tagName = namespace.name+':'+ am[3];
174 }
175 }
add : support on attribute
Code:
616 re: /^(?:([\[\{])(?:@)?((((\([\w-\/\:\.]+\))|([\w-]+)):)?([\w-]+))\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
617 select: 'n = byAttribute(n, "{2}", "{9}", "{8}", "{1}");'
and on buAttribute finction
Code:
268 var am = attr.match (/(\((.*)\)):(.*)/);
269 if (am){
270 var namespace = Ext.DomQuery.getNS(am[2]);
271 if (namespace) {
272 attr = namespace.name+':'+ am[3];
273 }
274 }
now you can select node like
Code:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fast="urn:org.jquery.fast">
....
<div fast:class="Switcher">....
</html>
Code:
var E1 = Ext.select('[@id=dock2]');
var E2 = Ext.select('[@fast:class=Switcher]');
var E3 = Ext.select('body');
var E4 = Ext.select('fast!block');
var E5 = Ext.select('fast!block[@fast:class=Switcher]');
var E6 = Ext.select('[@(urn:org.jquery.fast):class=Switcher]');
var E7 = Ext.select('(urn:org.jquery.fast)!block');
var E8 = Ext.select('(urn:org.jquery.fast)!block[@(urn:org.jquery.fast):class=Switcher]');
By
A+JYT