Permalink
Browse files

modified: index.js

	new file:   test_data_uaprofile.xml
	modified:   testparser.js
  • Loading branch information...
1 parent 71a3f0a commit cab21854718c9f2ab06d2cc5d37c6583f688e766 @shimondoodkin committed Nov 25, 2010
Showing with 549 additions and 8 deletions.
  1. +149 −7 index.js
  2. +398 −0 test_data_uaprofile.xml
  3. +2 −1 testparser.js
View
156 index.js
@@ -19,7 +19,7 @@ this.sax=expat;
// var expatsax=require('./deps/node-expat').sax;
// var parser= new expatsax.Parser(charset) and add the expat events i added below:
-
+var selfmodule=this;
function parser(add_ref,ignore_ns,charset)
{
@@ -63,7 +63,7 @@ function parser(add_ref,ignore_ns,charset)
self.ns = {};
for(var k in attrs)
{
- if(attrs.hasOwnProperty(key))
+ if(attrs.hasOwnProperty(k))
{
if (k == 'xmlns' || k.substr(0, 6) == 'xmlns:') self.ns[k] = attrs[k];
}
@@ -74,15 +74,15 @@ function parser(add_ref,ignore_ns,charset)
var el={};
if(self.add_ref) el.parent=self.element;
-
var smicpos,nk;
for(var k in attrs)
{
nk=k;
if(attrs.hasOwnProperty(k))
{
smicpos=k.indexOf(':'); if(smicpos>0) nk=k.substring(smicpos+1,k.length);
- el[self.addns?k:nk] = attrs[k];
+ //el[self.addns?k:nk] = attrs[k];
+ el[self.addns?k:nk] = if_number_to_number(attrs[k]);
}
}
@@ -94,7 +94,7 @@ function parser(add_ref,ignore_ns,charset)
if(typeof self.element[nk]==='undefined')
{
- if(self.add_ref) el[0]=el; el['length']=1; // array emulation
+ if(self.add_ref) {el[0]=el; el['length']=1;} // array emulation
self.element[self.addns?name:nk]=el;
}
@@ -105,7 +105,7 @@ function parser(add_ref,ignore_ns,charset)
else
{
var tmp=self.element[nk];
- if(self.add_ref) delete tmp[0]; delete tmp['length']; // array emulation
+ if(self.add_ref) {delete tmp[0]; delete tmp['length'];} // array emulation
self.element[self.addns?name:nk]=[tmp,el];
}
self.parents.push(self.element);
@@ -171,7 +171,7 @@ function parser(add_ref,ignore_ns,charset)
self.parse=function (data)
{
-
+ if(data===undefined||data===null) { console.log("EXPAT Error: data is not string or buffer"); return;}
//var t=data.length, n=5120000;
//if(n>data.length)
self.parser.parse(data);
@@ -194,8 +194,150 @@ function parser(add_ref,ignore_ns,charset)
var lasterror=self.parser.getError(); if(lasterror!==null) console.log("EXPAT Error:"+lasterror);
}
+
+ self.inspect=selfmodule.inspect;
+ self.array_to_object=selfmodule.array_to_object;
+
}; this.parser=parser;
+function inspect(obj)
+{
+ if(typeof obj!=='object') console.log(require('sys').inspect(obj));
+ else for(var n in obj) console.log(n);
+};this.inspect=inspect;
+
+/*
+
+usage:
+ if(device.group===undefined)
+ {
+ // fallback devices do not contain group
+ //console.log(require('sys').inspect(device,true,3));
+ }
+ else
+ {
+ for(var n=0,l=device.group.length;n<l;n++)
+ {
+ //console.log(n);
+ device.group[n].capability=array_to_object(device.group[n].capability,'name');
+ }
+ device.group=array_to_object(device.group,'id');
+ }
+
+input:
+
+{
+ "id" : "generic",
+ "user_agent" : "",
+ "fall_back" : "root",
+ "_tagname" : "device",
+ "_nstagname" : "device",
+ "group" : [
+ {
+ "id" : "product_info",
+ "_tagname" : "group",
+ "_nstagname" : "group",
+ "capability" : [
+ {
+ "name" : "mobile_browser",
+ "value" : "",
+ "_tagname" : "capability",
+ "_nstagname" : "capability"
+ }
+ }
+ ]
+}
+
+result:
+
+{
+ "id" : "htc_magic_ver1_subandroid2_2_1",
+ "user_agent" : "Mozilla/5.0 (Linux; U; Android 2.2.1; es-es; HTC Magic Build/FRG57) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533",
+ "fall_back" : "htc_magic_ver1",
+ "_tagname" : "device",
+ "_nstagname" : "device",
+ "group" : {
+ "product_info" : {
+ "id" : "product_info",
+ "_tagname" : "group",
+ "_nstagname" : "group",
+ "capability" : {
+ "device_os_version": {
+ "name" : "device_os_version",
+ "value" : "2.2.1",
+ "_tagname" : "capability",
+ "_nstagname" : "capability"
+ }
+ }
+ }
+ }
+}
+
+*/
+
+function array_to_object(arr,filed,ignoreerrors)
+{
+ var obj={};
+ ignoreerrors=!!ignoreerrors;
+ if((!(arr instanceof Array)) && (typeof arr==='object') )
+ {
+ if(arr[filed]===undefined)
+ {
+ if(!ignoreerrors)
+ throw new Error("object index name filed missing in array item : ");
+ }
+ else
+ {
+ obj[arr[filed]]=arr;
+ //console.log(require('sys').inspect(obj,true,3));
+ }
+ }
+ else if(arr instanceof Array)
+ {
+ for(var i=0,l=arr.length; i<l ; i++)
+ {
+ if(arr[i][filed]===undefined)
+ {
+ if(!ignoreerrors)
+ throw new Error("index name filed missing in array item : "+i);
+ }
+ else
+ {
+ obj[arr[i][filed]]=arr[i];
+ }
+ }
+ }
+ else
+ {
+ throw new Error(" arr is not an array or an object with a filed ");
+ }
+ return obj;
+}this.array_to_object=array_to_object;
+
+
+function search_array(arr,filed,value)
+{
+ for(var i=0,l=arr.length; i<l ; i++)
+ {
+ if(arr[i][filed]!==undefined)
+ {
+ if(arr[i][filed]==value)
+ return arr[i]
+ }
+ }
+ return false;
+};this.search_array=search_array;
+
+var numeric_re=/^[-+]?(0|[1-9]|[1-9]\d+)\.?\d{0,14}$/;
+function if_number_to_number(value)
+{
+ if(value.length>15) return value;
+
+ if(numeric_re.test(value))
+ return parseFloat(value);
+ else
+ return value;
+}
function ltrim(str) {
for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
View
398 test_data_uaprofile.xml
@@ -0,0 +1,398 @@
+<!-- ===================================================== -->
+<!-- -->
+<!-- Copyright (c) 2003 Nokia. All rights reserved. -->
+<!-- -->
+<!-- The contents of this document are provided "as is". -->
+<!-- No warranties of any kind, either express or implied, -->
+<!-- including, but not limited to, the implied warranties -->
+<!-- of merchantability and fitness for a particular -->
+<!-- purpose, are made in relation to the accuracy, -->
+<!-- reliability or contents of this document. Nokia -->
+<!-- reserves the right to revise this document or -->
+<!-- withdraw it at any time without prior notice. -->
+<!-- -->
+<!-- ===================================================== -->
+<!-- ===================================================== -->
+<!-- -->
+<!-- This file was generated using the UA Profile -->
+<!-- generator provided by IOP Operations. -->
+<!-- -->
+<!-- 2005.04.07 10:12:05 -->
+<!-- -->
+<!-- Valid beginning from version 3.27 -->
+<!-- User Agent Header: Nokia6230i/2.0 (03.27) Profile/ -->
+<!-- MIDP-2.0 Configuration/CLDC-1.1 -->
+<!-- -->
+<!-- ===================================================== -->
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"
+xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#">
+ <rdf:Description rdf:ID="Profile">
+ <prf:component>
+ <rdf:Description rdf:ID="HardwarePlatform">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#HardwarePlatform"/>
+ <prf:BluetoothProfile>
+ <rdf:Bag>
+ <rdf:li>Headset Profile</rdf:li>
+ <rdf:li>Handsfree Profile</rdf:li>
+ <rdf:li>SIM Access Profile</rdf:li>
+ <rdf:li>Dial-up Networking Profile</rdf:li>
+ <rdf:li>Object Push Profile</rdf:li>
+ <rdf:li>File Transfer Profile</rdf:li>
+ <rdf:li>Generic Access Profile</rdf:li>
+ <rdf:li>Serial Port Profile</rdf:li>
+ <rdf:li>General Object Exchange Profile</rdf:li>
+ </rdf:Bag>
+ </prf:BluetoothProfile>
+ <prf:BitsPerPixel>16</prf:BitsPerPixel>
+ <prf:ColorCapable>Yes</prf:ColorCapable>
+ <prf:ImageCapable>Yes</prf:ImageCapable>
+ <prf:InputCharSet>
+ <rdf:Bag>
+ <rdf:li>ISO-8859-1</rdf:li>
+ <rdf:li>ISO-10646-UCS-2</rdf:li>
+ <rdf:li>US-ASCII</rdf:li>
+ <rdf:li>UTF-8</rdf:li>
+ </rdf:Bag>
+ </prf:InputCharSet>
+ <prf:Keyboard>PhoneKeyPad</prf:Keyboard>
+ <prf:Model>6230i</prf:Model>
+ <prf:NumberOfSoftKeys>3</prf:NumberOfSoftKeys>
+ <prf:OutputCharSet>
+ <rdf:Bag>
+ <rdf:li>ISO-8859-1</rdf:li>
+ <rdf:li>ISO-10646-UCS-2</rdf:li>
+ <rdf:li>US-ASCII</rdf:li>
+ <rdf:li>UTF-8</rdf:li>
+ </rdf:Bag>
+ </prf:OutputCharSet>
+ <prf:PixelAspectRatio>1x1</prf:PixelAspectRatio>
+ <prf:ScreenSize>208x208</prf:ScreenSize>
+ <prf:ScreenSizeChar>18x5</prf:ScreenSizeChar>
+ <prf:StandardFontProportional>Yes</prf:StandardFontProportional>
+ <prf:SoundOutputCapable>Yes</prf:SoundOutputCapable>
+ <prf:TextInputCapable>Yes</prf:TextInputCapable>
+ <prf:Vendor>Nokia</prf:Vendor>
+ <prf:VoiceInputCapable>Yes</prf:VoiceInputCapable>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="SoftwarePlatform">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#SoftwarePlatform"/>
+ <prf:AcceptDownloadableSoftware>Yes</prf:AcceptDownloadableSoftware>
+ <prf:AudioInputEncoder>
+ <rdf:Bag>
+ <rdf:li>AMR</rdf:li>
+ <rdf:li>EFR</rdf:li>
+ <rdf:li>FR</rdf:li>
+ <rdf:li>HR</rdf:li>
+ </rdf:Bag>
+ </prf:AudioInputEncoder>
+ <prf:CcppAccept>
+ <rdf:Bag>
+ <rdf:li>application/java</rdf:li>
+ <rdf:li>application/java-archive</rdf:li>
+ <rdf:li>application/sdp</rdf:li>
+ <rdf:li>application/vnd.met.ticket</rdf:li>
+ <rdf:li>application/vnd.met.receipt</rdf:li>
+ <rdf:li>application/vnd.nok-s40theme</rdf:li>
+ <rdf:li>application/vnd.nokia.ringing-tone</rdf:li>
+ <rdf:li>application/vnd.nokia.radio-preset</rdf:li>
+ <rdf:li>application/vnd.nokia.radio-presets</rdf:li>
+ <rdf:li>application/vnd.oma.dd+xml</rdf:li>
+ <rdf:li>application/vnd.oma.drm.content</rdf:li>
+ <rdf:li>application/vnd.oma.drm.message</rdf:li>
+ <rdf:li>application/vnd.oma.drm.rights+xml</rdf:li>
+ <rdf:li>application/vnd.oma.drm.rights+wbxml</rdf:li>
+ <rdf:li>application/vnd.syncml-xml</rdf:li>
+ <rdf:li>application/vnd.syncml-wbxml</rdf:li>
+ <rdf:li>application/vnd.wap.cert-response</rdf:li>
+ <rdf:li>application/vnd.wap.connectivity-wbxml</rdf:li>
+ <rdf:li>application/vnd.wap.hashed-certificate</rdf:li>
+ <rdf:li>application/vnd.wap.sic</rdf:li>
+ <rdf:li>application/vnd.wap.signed-certificate</rdf:li>
+ <rdf:li>application/vnd.wap.slc</rdf:li>
+ <rdf:li>application/vnd.wap.xhtml+xml</rdf:li>
+ <rdf:li>application/vnd.wap.wmlscriptc</rdf:li>
+ <rdf:li>application/x-java-archive</rdf:li>
+ <rdf:li>application/x-wallet-appl.user-data-provision</rdf:li>
+ <rdf:li>application/x-wap-prov.browser-bookmarks</rdf:li>
+ <rdf:li>application/xhtml+xml</rdf:li>
+ <rdf:li>application/m3g</rdf:li>
+ <rdf:li>audio/3gpp</rdf:li>
+ <rdf:li>audio/aac</rdf:li>
+ <rdf:li>audio/amr</rdf:li>
+ <rdf:li>audio/amr-wb</rdf:li>
+ <rdf:li>audio/mid</rdf:li>
+ <rdf:li>audio/midi</rdf:li>
+ <rdf:li>audio/mp3</rdf:li>
+ <rdf:li>audio/mp4</rdf:li>
+ <rdf:li>audio/mpeg</rdf:li>
+ <rdf:li>audio/sp-midi</rdf:li>
+ <rdf:li>audio/x-mid</rdf:li>
+ <rdf:li>audio/x-midi</rdf:li>
+ <rdf:li>image/bmp</rdf:li>
+ <rdf:li>image/gif</rdf:li>
+ <rdf:li>image/jpeg</rdf:li>
+ <rdf:li>image/jpg</rdf:li>
+ <rdf:li>image/png</rdf:li>
+ <rdf:li>image/vnd.nok-oplogo-color</rdf:li>
+ <rdf:li>image/vnd.nok-wallpaper</rdf:li>
+ <rdf:li>image/vnd.wap.wbmp</rdf:li>
+ <rdf:li>multipart/mixed</rdf:li>
+ <rdf:li>text/css</rdf:li>
+ <rdf:li>text/html</rdf:li>
+ <rdf:li>text/plain</rdf:li>
+ <rdf:li>text/vnd.sun.j2me.app-descriptor</rdf:li>
+ <rdf:li>text/vnd.wap.si</rdf:li>
+ <rdf:li>text/vnd.wap.sl</rdf:li>
+ <rdf:li>text/vnd.wap.wml</rdf:li>
+ <rdf:li>text/x-co-desc</rdf:li>
+ <rdf:li>text/x-vCalendar</rdf:li>
+ <rdf:li>text/x-vCard</rdf:li>
+ <rdf:li>video/3gpp</rdf:li>
+ <rdf:li>video/mp4</rdf:li>
+ </rdf:Bag>
+ </prf:CcppAccept>
+ <prf:CcppAccept-Charset>
+ <rdf:Bag>
+ <rdf:li>ISO-8859-1</rdf:li>
+ <rdf:li>ISO-10646-UCS-2</rdf:li>
+ <rdf:li>US-ASCII</rdf:li>
+ <rdf:li>UTF-8</rdf:li>
+ </rdf:Bag>
+ </prf:CcppAccept-Charset>
+ <prf:CcppAccept-Encoding>
+ <rdf:Bag>
+ <rdf:li>base64</rdf:li>
+ </rdf:Bag>
+ </prf:CcppAccept-Encoding>
+ <prf:JavaEnabled>Yes</prf:JavaEnabled>
+ <prf:JavaPlatform>
+ <rdf:Bag>
+ <rdf:li>CLDC</rdf:li>
+ <rdf:li>MIDP</rdf:li>
+ <rdf:li>MIDP/1.0-compatible</rdf:li>
+ <rdf:li>Profile/MIDP-2.0</rdf:li>
+ <rdf:li>Configuration/CLDC-1.0</rdf:li>
+ <rdf:li>Configuration/CLDC-1.1</rdf:li>
+ </rdf:Bag>
+ </prf:JavaPlatform>
+ <prf:MexeClassmarks>
+ <rdf:Bag>
+ <rdf:li>1</rdf:li>
+ <rdf:li>3</rdf:li>
+ </rdf:Bag>
+ </prf:MexeClassmarks>
+ <prf:MexeSpec>22.057</prf:MexeSpec>
+ <prf:MexeSecureDomains>Yes</prf:MexeSecureDomains>
+ <prf:VideoInputEncoder>
+ <rdf:Bag>
+ <rdf:li>H.263</rdf:li>
+ </rdf:Bag>
+ </prf:VideoInputEncoder>
+ <prf:Email-URI-Schemes>
+ <rdf:Bag>
+ <rdf:li>pop</rdf:li>
+ <rdf:li>imap4</rdf:li>
+ </rdf:Bag>
+ </prf:Email-URI-Schemes>
+ <prf:JavaPackage>
+ <rdf:Bag>
+ <rdf:li>javax.bluetooth</rdf:li>
+ <rdf:li>WMA 1.1</rdf:li>
+ <rdf:li>MMAPI 1.1</rdf:li>
+ </rdf:Bag>
+ </prf:JavaPackage>
+ <prf:JavaProtocol>
+ <rdf:Bag>
+ <rdf:li>file/1.0</rdf:li>
+ </rdf:Bag>
+ </prf:JavaProtocol>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="NetworkCharacteristics">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#NetworkCharacteristics"/>
+ <prf:SupportedBluetoothVersion>1.1</prf:SupportedBluetoothVersion>
+ <prf:SecuritySupport>
+ <rdf:Bag>
+ <rdf:li>SSL</rdf:li>
+ <rdf:li>TLS</rdf:li>
+ </rdf:Bag>
+ </prf:SecuritySupport>
+ <prf:SupportedBearers>
+ <rdf:Bag>
+ <rdf:li>GPRS</rdf:li>
+ <rdf:li>SMS</rdf:li>
+ <rdf:li>CSD</rdf:li>
+ <rdf:li>USSD</rdf:li>
+ <rdf:li>EGPRS</rdf:li>
+ <rdf:li>HSCSD</rdf:li>
+ <rdf:li>EDGE</rdf:li>
+ </rdf:Bag>
+ </prf:SupportedBearers>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="BrowserUA">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#BrowserUA"/>
+ <prf:BrowserName>Nokia</prf:BrowserName>
+ <prf:BrowserVersion>1.0</prf:BrowserVersion>
+ <prf:FramesCapable>No</prf:FramesCapable>
+ <prf:HtmlVersion>1.0</prf:HtmlVersion>
+ <prf:JavaAppletEnabled>No</prf:JavaAppletEnabled>
+ <prf:JavaScriptEnabled>No</prf:JavaScriptEnabled>
+ <prf:PreferenceForFrames>No</prf:PreferenceForFrames>
+ <prf:TablesCapable>Yes</prf:TablesCapable>
+ <prf:XhtmlVersion>1.0</prf:XhtmlVersion>
+ <prf:XhtmlModules>
+ <rdf:Bag>
+ <rdf:li>XHTML1-struct</rdf:li>
+ <rdf:li>XHTML1-blkstruct</rdf:li>
+ <rdf:li>xhtml-basic10</rdf:li>
+ </rdf:Bag>
+ </prf:XhtmlModules>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="WapCharacteristics">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#WapCharacteristics"/>
+ <prf:WapDeviceClass>C</prf:WapDeviceClass>
+ <prf:WapVersion>2.0</prf:WapVersion>
+ <prf:WmlDeckSize>131072</prf:WmlDeckSize>
+ <prf:WmlScriptLibraries>
+ <rdf:Bag>
+ <rdf:li>Lang</rdf:li>
+ <rdf:li>Float</rdf:li>
+ <rdf:li>String</rdf:li>
+ <rdf:li>URL</rdf:li>
+ <rdf:li>WMLBrowser</rdf:li>
+ <rdf:li>Dialogs</rdf:li>
+ </rdf:Bag>
+ </prf:WmlScriptLibraries>
+ <prf:WmlScriptVersion>
+ <rdf:Bag>
+ <rdf:li>1.2.1</rdf:li>
+ </rdf:Bag>
+ </prf:WmlScriptVersion>
+ <prf:WmlVersion>
+ <rdf:Bag>
+ <rdf:li>1.2.1</rdf:li>
+ </rdf:Bag>
+ </prf:WmlVersion>
+ <prf:WtaiLibraries>
+ <rdf:Bag>
+ <rdf:li>WTA.Public.makeCall</rdf:li>
+ <rdf:li>WTA.Public.sendDTMF</rdf:li>
+ <rdf:li>WTA.Public.addPBEntry</rdf:li>
+ </rdf:Bag>
+ </prf:WtaiLibraries>
+ <prf:DrmClass>
+ <rdf:Bag>
+ <rdf:li>ForwardLock</rdf:li>
+ <rdf:li>CombinedDelivery</rdf:li>
+ <rdf:li>SeparateDelivery</rdf:li>
+ </rdf:Bag>
+ </prf:DrmClass>
+ <prf:DrmConstraints>
+ <rdf:Bag>
+ <rdf:li>datetime</rdf:li>
+ <rdf:li>interval</rdf:li>
+ <rdf:li>count</rdf:li>
+ </rdf:Bag>
+ </prf:DrmConstraints>
+ <prf:OmaDownload>Yes</prf:OmaDownload>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="PushCharacteristics">
+ <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#PushCharacteristics"/>
+ <prf:Push-Accept>
+ <rdf:Bag>
+ <rdf:li>application/wml+xml</rdf:li>
+ <rdf:li>text/html</rdf:li>
+ </rdf:Bag>
+ </prf:Push-Accept>
+ <prf:Push-Accept-Charset>
+ <rdf:Bag>
+ <rdf:li>ISO-8859-1</rdf:li>
+ <rdf:li>ISO-10646-UCS-2</rdf:li>
+ <rdf:li>US-ASCII</rdf:li>
+ <rdf:li>UTF-8</rdf:li>
+ </rdf:Bag>
+ </prf:Push-Accept-Charset>
+ <prf:Push-Accept-Encoding>
+ <rdf:Bag>
+ <rdf:li>base64</rdf:li>
+ </rdf:Bag>
+ </prf:Push-Accept-Encoding>
+ <prf:Push-MsgSize>1400</prf:Push-MsgSize>
+ <prf:Push-MaxPushReq>30</prf:Push-MaxPushReq>
+ </rdf:Description>
+ </prf:component>
+ <prf:component>
+ <rdf:Description rdf:ID="MmsCharacteristics">
+ <rdf:type rdf:resource="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#MmsCharacteristics"/>
+ <mms:MmsMaxMessageSize>300000</mms:MmsMaxMessageSize>
+ <mms:MmsMaxImageResolution>1280x1024</mms:MmsMaxImageResolution>
+ <mms:MmsCcppAccept>
+ <rdf:Bag>
+ <rdf:li>application/sdp</rdf:li>
+ <rdf:li>application/smil</rdf:li>
+ <rdf:li>application/vnd.nok-s40theme</rdf:li>
+ <rdf:li>application/vnd.nokia.ringing-tone</rdf:li>
+ <rdf:li>application/vnd.oma.drm.content</rdf:li>
+ <rdf:li>application/vnd.oma.drm.message</rdf:li>
+ <rdf:li>audio/3gpp</rdf:li>
+ <rdf:li>audio/aac</rdf:li>
+ <rdf:li>audio/amr</rdf:li>
+ <rdf:li>audio/amr-wb</rdf:li>
+ <rdf:li>audio/mid</rdf:li>
+ <rdf:li>audio/midi</rdf:li>
+ <rdf:li>audio/mp3</rdf:li>
+ <rdf:li>audio/mp4</rdf:li>
+ <rdf:li>audio/mpeg</rdf:li>
+ <rdf:li>audio/rmf</rdf:li>
+ <rdf:li>audio/sp-midi</rdf:li>
+ <rdf:li>audio/x-mid</rdf:li>
+ <rdf:li>audio/x-midi</rdf:li>
+ <rdf:li>image/bmp</rdf:li>
+ <rdf:li>image/gif</rdf:li>
+ <rdf:li>image/jpeg</rdf:li>
+ <rdf:li>image/jpg</rdf:li>
+ <rdf:li>image/png</rdf:li>
+ <rdf:li>image/vnd.nokia.ota-bitmap</rdf:li>
+ <rdf:li>image/vnd.nokia.wbmp</rdf:li>
+ <rdf:li>image/vnd.nok-wallpaper</rdf:li>
+ <rdf:li>image/vnd.nok-oplogo-color</rdf:li>
+ <rdf:li>image/vnd.wap.wbmp</rdf:li>
+ <rdf:li>image/x-ota-bitmap</rdf:li>
+ <rdf:li>text/plain</rdf:li>
+ <rdf:li>text/x-vCalendar</rdf:li>
+ <rdf:li>text/x-vCard</rdf:li>
+ <rdf:li>video/3gpp</rdf:li>
+ </rdf:Bag>
+ </mms:MmsCcppAccept>
+ <mms:MmsCcppAcceptCharSet>
+ <rdf:Bag>
+ <rdf:li>ISO-8859-1</rdf:li>
+ <rdf:li>ISO-10646-UCS-2</rdf:li>
+ <rdf:li>US-ASCII</rdf:li>
+ <rdf:li>UTF-8</rdf:li>
+ </rdf:Bag>
+ </mms:MmsCcppAcceptCharSet>
+ <mms:MmsCcppAcceptEncoding>
+ <rdf:Bag>
+ <rdf:li>base64</rdf:li>
+ </rdf:Bag>
+ </mms:MmsCcppAcceptEncoding>
+ <mms:MmsVersion>
+ <rdf:Bag>
+ <rdf:li>1.2</rdf:li>
+ </rdf:Bag>
+ </mms:MmsVersion>
+ </rdf:Description>
+ </prf:component>
+ </rdf:Description>
+</rdf:RDF>
View
3 testparser.js
@@ -27,4 +27,5 @@ function testfile(file)
//testfile('test_data.html');
//testfile('test_data.xml');
-testfile('test_data_longer.xml');
+//testfile('test_data_longer.xml');
+testfile('test_data_uaprofile.xml');

0 comments on commit cab2185

Please sign in to comment.