Changeset 1102

Show
Ignore:
Timestamp:
2008-09-23 21:12:08 (2 months ago)
Author:
MaierMan
Message:

Fix: Violated standards by using createElement instead of createElementNS. This caused all elements to have a null ns uri.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/dta/manager/imex.js

    r1101 r1102  
    154154                root.setAttribute('type', 'static'); 
    155155                root.setAttribute('version', '3.0'); 
    156                 root.setAttribute('generator', 'DownThemAll! ' + DTA.VERSION + ' <http://downthemall.net/>'); 
     156                root.setAttribute('generator', 'DownThemAll! ' + DTA.BASE_VERSION + ' <http://downthemall.net/>'); 
    157157                root.setAttributeNS(NS_DTA, 'version', DTA.VERSION); 
    158158                root.setAttribute('pubdate', new Date().toUTCString()); 
     
    160160                root.appendChild(doc.createComment("metalink as exported by DownThemAll!\r\nmay contain DownThemAll! specific information in the DownThemAll! namespace: " + NS_DTA));   
    161161                 
    162                 let files = doc.createElement('files'); 
     162                let files = doc.createElementNS(NS_METALINKER, 'files'); 
    163163                for (let d in downloads) { 
    164                         let f = doc.createElement('file'); 
     164                        let f = doc.createElementNS(NS_METALINKER, 'file'); 
    165165                        f.setAttribute('name', d.fileName); 
    166166                        f.setAttributeNS(NS_DTA, 'num', d.numIstance); 
     
    171171                         
    172172                        if (d.description) { 
    173                                 let n = doc.createElement('description'); 
     173                                let n = doc.createElementNS(NS_METALINKER, 'description'); 
    174174                                n.textContent = d.description; 
    175175                                f.appendChild(n); 
    176176                        }  
    177                         let r = doc.createElement('resources'); 
     177                        let r = doc.createElementNS(NS_METALINKER, 'resources'); 
    178178                        for (let u in d.urlManager.all) { 
    179                                 let n = doc.createElement('url'); 
     179                                let n = doc.createElementNS(NS_METALINKER, 'url'); 
    180180                                let t = u.url.spec.match(/^(\w+):/); 
    181181                                n.setAttribute('type', t[1]); 
     
    187187                        } 
    188188                        if (d.hash) { 
    189                                 let v = doc.createElement('verification'); 
    190                                 let h = doc.createElement('hash'); 
     189                                let v = doc.createElementNS(NS_METALINKER, 'verification'); 
     190                                let h = doc.createElementNS(NS_METALINKER, 'hash'); 
    191191                                h.setAttribute('type', d.hash.type.toLowerCase()); 
    192192                                h.textContent = d.hash.sum.toLowerCase(); 
     
    197197                         
    198198                        if (d.totalSize > 0) { 
    199                                 let s = doc.createElement('size'); 
     199                                let s = doc.createElementNS(NS_METALINKER, 'size'); 
    200200                                s.textContent = d.totalSize; 
    201201                                f.appendChild(s);