wirispluginengine 3.62.0.1322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/wirispluginengine/WIRISplugins.js +2833 -0
- data/app/controllers/wirispluginengine/application_controller.rb +75 -0
- data/app/helpers/wirispluginengine/application_helper.rb +4 -0
- data/config/routes.rb +4 -0
- data/configuration.ini.dist +104 -0
- data/lib/com/wiris/common/WInteger.rb +57 -0
- data/lib/com/wiris/plugin/api/Cas.rb +8 -0
- data/lib/com/wiris/plugin/api/CleanCache.rb +8 -0
- data/lib/com/wiris/plugin/api/Configuration.rb +8 -0
- data/lib/com/wiris/plugin/api/ConfigurationKeys.rb +96 -0
- data/lib/com/wiris/plugin/api/Editor.rb +8 -0
- data/lib/com/wiris/plugin/api/Filter.rb +8 -0
- data/lib/com/wiris/plugin/api/ImageFormatController.rb +8 -0
- data/lib/com/wiris/plugin/api/ParamsProvider.rb +8 -0
- data/lib/com/wiris/plugin/api/PluginBuilder.rb +79 -0
- data/lib/com/wiris/plugin/api/Render.rb +8 -0
- data/lib/com/wiris/plugin/api/ServiceResourceLoader.rb +8 -0
- data/lib/com/wiris/plugin/api/Test.rb +8 -0
- data/lib/com/wiris/plugin/api/TextService.rb +8 -0
- data/lib/com/wiris/plugin/configuration/ConfigurationUpdater.rb +8 -0
- data/lib/com/wiris/plugin/impl/CasImpl.rb +146 -0
- data/lib/com/wiris/plugin/impl/CleanCacheImpl.rb +111 -0
- data/lib/com/wiris/plugin/impl/ConfigurationImpl.rb +176 -0
- data/lib/com/wiris/plugin/impl/CustomConfigurationUpdater.rb +38 -0
- data/lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb +29 -0
- data/lib/com/wiris/plugin/impl/EditorImpl.rb +86 -0
- data/lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb +34 -0
- data/lib/com/wiris/plugin/impl/FileStorageAndCache.rb +59 -0
- data/lib/com/wiris/plugin/impl/FolderTreeStorageAndCache.rb +144 -0
- data/lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb +56 -0
- data/lib/com/wiris/plugin/impl/HttpImpl.rb +53 -0
- data/lib/com/wiris/plugin/impl/HttpListener.rb +8 -0
- data/lib/com/wiris/plugin/impl/ImageFormatControllerPng.rb +73 -0
- data/lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb +34 -0
- data/lib/com/wiris/plugin/impl/PluginBuilderImpl.rb +253 -0
- data/lib/com/wiris/plugin/impl/RenderImpl.rb +280 -0
- data/lib/com/wiris/plugin/impl/ServiceResourceLoaderImpl.rb +52 -0
- data/lib/com/wiris/plugin/impl/TestImpl.rb +166 -0
- data/lib/com/wiris/plugin/impl/TextFilter.rb +211 -0
- data/lib/com/wiris/plugin/impl/TextFilterTags.rb +55 -0
- data/lib/com/wiris/plugin/impl/TextServiceImpl.rb +118 -0
- data/lib/com/wiris/plugin/storage/StorageAndCache.rb +8 -0
- data/lib/com/wiris/util/json/JSon.rb +536 -0
- data/lib/com/wiris/util/json/JSonIntegerFormat.rb +21 -0
- data/lib/com/wiris/util/json/StringParser.rb +61 -0
- data/lib/com/wiris/util/sys/HttpConnection.rb +18 -0
- data/lib/com/wiris/util/sys/HttpConnectionListener.rb +8 -0
- data/lib/com/wiris/util/sys/IniFile.rb +143 -0
- data/lib/com/wiris/util/sys/Store.rb +109 -0
- data/lib/com/wiris/util/xml/SerializableImpl.rb +20 -0
- data/lib/com/wiris/util/xml/WCharacterBase.rb +634 -0
- data/lib/com/wiris/util/xml/WEntities.rb +14 -0
- data/lib/com/wiris/util/xml/WXmlUtils.rb +515 -0
- data/lib/com/wiris/util/xml/XmlSerializer.rb +485 -0
- data/lib/com/wiris/util/xml/XmlWriter.rb +279 -0
- data/lib/loader.rb +12 -0
- data/lib/src-generic/Array.rb +23 -0
- data/lib/src-generic/ArrayInt.rb +32 -0
- data/lib/src-generic/Base64.rb +15 -0
- data/lib/src-generic/BaseCode.rb +94 -0
- data/lib/src-generic/Bytes.rb +50 -0
- data/lib/src-generic/BytesInput.rb +38 -0
- data/lib/src-generic/EReg.rb +56 -0
- data/lib/src-generic/File.rb +36 -0
- data/lib/src-generic/FileLock.rb +27 -0
- data/lib/src-generic/FileSystem.rb +37 -0
- data/lib/src-generic/Hash.rb +43 -0
- data/lib/src-generic/Http.rb +107 -0
- data/lib/src-generic/HttpRequest.rb +25 -0
- data/lib/src-generic/HttpResponse.rb +71 -0
- data/lib/src-generic/Iterator.rb +20 -0
- data/lib/src-generic/Math.rb +15 -0
- data/lib/src-generic/Md5.rb +8 -0
- data/lib/src-generic/Md5Tools.rb +12 -0
- data/lib/src-generic/PropertiesTools.rb +33 -0
- data/lib/src-generic/Reflect.rb +17 -0
- data/lib/src-generic/RubyConfigurationUpdater.rb +45 -0
- data/lib/src-generic/Serializer.rb +85 -0
- data/lib/src-generic/Std.rb +74 -0
- data/lib/src-generic/Storage.rb +153 -0
- data/lib/src-generic/StringBuf.rb +41 -0
- data/lib/src-generic/StringTools.rb +46 -0
- data/lib/src-generic/Timer.rb +7 -0
- data/lib/src-generic/Type.rb +19 -0
- data/lib/src-generic/TypeTools.rb +32 -0
- data/lib/src-generic/Unserializer.rb +73 -0
- data/lib/src-generic/Utf8.rb +27 -0
- data/lib/src-generic/Xml.rb +199 -0
- data/lib/src-generic/extended/Integer.rb +5 -0
- data/lib/src-generic/extended/Math.rb +7 -0
- data/lib/src-generic/extended/Properties.rb +12 -0
- data/lib/src-generic/extended/String.rb +39 -0
- data/lib/src-generic/settings/PlatformSettings.rb +19 -0
- data/lib/wirispluginengine.rb +5 -0
- data/lib/wirispluginengine/engine.rb +5 -0
- data/lib/wirispluginengine/integration/cleancache.rb +8 -0
- data/lib/wirispluginengine/integration/configurationjs.rb +16 -0
- data/lib/wirispluginengine/integration/configurationjson.rb +7 -0
- data/lib/wirispluginengine/integration/createimage.rb +8 -0
- data/lib/wirispluginengine/integration/getmathml.rb +18 -0
- data/lib/wirispluginengine/integration/resource.rb +8 -0
- data/lib/wirispluginengine/integration/service.rb +6 -0
- data/lib/wirispluginengine/integration/showimage.rb +21 -0
- data/lib/wirispluginengine/integration/test.rb +6 -0
- data/lib/wirispluginengine/version.rb +3 -0
- data/resources/VERSION +1 -0
- data/resources/default-configuration.ini +45 -0
- data/resources/tech.txt +1 -0
- data/resources/wirisplugin.css +43 -0
- metadata +182 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
module WirisPlugin
|
2
|
+
include Wiris
|
3
|
+
class WEntities
|
4
|
+
include Wiris
|
5
|
+
|
6
|
+
def initialize()
|
7
|
+
super()
|
8
|
+
end
|
9
|
+
s1 = "boxDL@02557@boxDl@02556@boxdL@02555@boxdl@02510@boxDR@02554@boxDr@02553@boxdR@02552@boxdr@0250C@boxH@02550@boxh@02500@boxHD@02566@boxHd@02564@boxhD@02565@boxhd@0252C@boxHU@02569@boxHu@02567@boxhU@02568@boxhu@02534@boxUL@0255D@boxUl@0255C@boxuL@0255B@boxul@02518@boxUR@0255A@boxUr@02559@boxuR@02558@boxur@02514@boxV@02551@boxv@02502@boxVH@0256C@boxVh@0256B@boxvH@0256A@boxvh@0253C@boxVL@02563@boxVl@02562@boxvL@02561@boxvl@02524@boxVR@02560@boxVr@0255F@boxvR@0255E@boxvr@0251C@Acy@00410@acy@00430@Bcy@00411@bcy@00431@CHcy@00427@chcy@00447@Dcy@00414@dcy@00434@Ecy@0042D@ecy@0044D@Fcy@00424@fcy@00444@Gcy@00413@gcy@00433@HARDcy@0042A@hardcy@0044A@Icy@00418@icy@00438@IEcy@00415@iecy@00435@IOcy@00401@iocy@00451@Jcy@00419@jcy@00439@Kcy@0041A@kcy@0043A@KHcy@00425@khcy@00445@Lcy@0041B@lcy@0043B@Mcy@0041C@mcy@0043C@Ncy@0041D@ncy@0043D@numero@02116@Ocy@0041E@ocy@0043E@Pcy@0041F@pcy@0043F@Rcy@00420@rcy@00440@Scy@00421@scy@00441@SHCHcy@00429@shchcy@00449@SHcy@00428@shcy@00448@SOFTcy@0042C@softcy@0044C@Tcy@00422@tcy@00442@TScy@00426@tscy@00446@Ucy@00423@ucy@00443@Vcy@00412@vcy@00432@YAcy@0042F@yacy@0044F@Ycy@0042B@ycy@0044B@YUcy@0042E@yucy@0044E@Zcy@00417@zcy@00437@ZHcy@00416@zhcy@00436@DJcy@00402@djcy@00452@DScy@00405@dscy@00455@DZcy@0040F@dzcy@0045F@GJcy@00403@gjcy@00453@Iukcy@00406@iukcy@00456@Jsercy@00408@jsercy@00458@Jukcy@00404@jukcy@00454@KJcy@0040C@kjcy@0045C@LJcy@00409@ljcy@00459@NJcy@0040A@njcy@0045A@TSHcy@0040B@tshcy@0045B@Ubrcy@0040E@ubrcy@0045E@YIcy@00407@yicy@00457@acute@000B4@breve@002D8@caron@002C7@cedil@000B8@circ@002C6@dblac@002DD@die@000A8@dot@002D9@grave@00060@macr@000AF@ogon@002DB@ring@002DA@tilde@002DC@uml@000A8@Aacute@000C1@aacute@000E1@Acirc@000C2@acirc@000E2@AElig@000C6@aelig@000E6@Agrave@000C0@agrave@000E0@Aring@000C5@aring@000E5@Atilde@000C3@atilde@000E3@Auml@000C4@auml@000E4@Ccedil@000C7@ccedil@000E7@Eacute@000C9@eacute@000E9@Ecirc@000CA@ecirc@000EA@Egrave@000C8@egrave@000E8@ETH@000D0@eth@000F0@Euml@000CB@euml@000EB@Iacute@000CD@iacute@000ED@Icirc@000CE@icirc@000EE@Igrave@000CC@igrave@000EC@Iuml@000CF@iuml@000EF@Ntilde@000D1@ntilde@000F1@Oacute@000D3@oacute@000F3@Ocirc@000D4@ocirc@000F4@Ograve@000D2@ograve@000F2@Oslash@000D8@oslash@000F8@Otilde@000D5@otilde@000F5@Ouml@000D6@ouml@000F6@szlig@000DF@THORN@000DE@thorn@000FE@Uacute@000DA@uacute@000FA@Ucirc@000DB@ucirc@000FB@Ugrave@000D9@ugrave@000F9@Uuml@000DC@uuml@000FC@Yacute@000DD@yacute@000FD@yuml@000FF@Abreve@00102@abreve@00103@Amacr@00100@amacr@00101@Aogon@00104@aogon@00105@Cacute@00106@cacute@00107@Ccaron@0010C@ccaron@0010D@Ccirc@00108@ccirc@00109@Cdot@0010A@cdot@0010B@Dcaron@0010E@dcaron@0010F@Dstrok@00110@dstrok@00111@Ecaron@0011A@ecaron@0011B@Edot@00116@edot@00117@Emacr@00112@emacr@00113@ENG@0014A@eng@0014B@Eogon@00118@eogon@00119@gacute@001F5@Gbreve@0011E@gbreve@0011F@Gcedil@00122@Gcirc@0011C@gcirc@0011D@Gdot@00120@gdot@00121@Hcirc@00124@hcirc@00125@Hstrok@00126@hstrok@00127@Idot@00130@IJlig@00132@ijlig@00133@Imacr@0012A@imacr@0012B@inodot@00131@Iogon@0012E@iogon@0012F@Itilde@00128@itilde@00129@Jcirc@00134@jcirc@00135@Kcedil@00136@kcedil@00137@kgreen@00138@Lacute@00139@lacute@0013A@Lcaron@0013D@lcaron@0013E@Lcedil@0013B@lcedil@0013C@Lmidot@0013F@lmidot@00140@Lstrok@00141@lstrok@00142@Nacute@00143@nacute@00144@napos@00149@Ncaron@00147@ncaron@00148@Ncedil@00145@ncedil@00146@Odblac@00150@odblac@00151@OElig@00152@oelig@00153@Omacr@0014C@omacr@0014D@Racute@00154@racute@00155@Rcaron@00158@rcaron@00159@Rcedil@00156@rcedil@00157@Sacute@0015A@sacute@0015B@Scaron@00160@scaron@00161@Scedil@0015E@scedil@0015F@Scirc@0015C@scirc@0015D@Tcaron@00164@tcaron@00165@Tcedil@00162@tcedil@00163@Tstrok@00166@tstrok@00167@Ubreve@0016C@ubreve@0016D@Udblac@00170@udblac@00171@Umacr@0016A@umacr@0016B@Uogon@00172@uogon@00173@Uring@0016E@uring@0016F@Utilde@00168@utilde@00169@Wcirc@00174@wcirc@00175@Ycirc@00176@ycirc@00177@Yuml@00178@Zacute@00179@zacute@0017A@Zcaron@0017D@zcaron@0017E@Zdot@0017B@zdot@0017C@apos@00027@ast@0002A@brvbar@000A6@bsol@0005C@cent@000A2@colon@0003A@comma@0002C@commat@00040@copy@000A9@curren@000A4@darr@02193@deg@000B0@divide@000F7@dollar@00024@equals@0003D@excl@00021@frac12@000BD@frac14@000BC@frac18@0215B@frac34@000BE@frac38@0215C@frac58@0215D@frac78@0215E@gt@0003E@half@000BD@horbar@02015@hyphen@02010@iexcl@000A1@iquest@000BF@laquo@000AB@larr@02190@lcub@0007B@ldquo@0201C@lowbar@0005F@lpar@00028@lsqb@0005B@lsquo@02018@micro@000B5@middot@000B7@nbsp@000A0@not@000AC@num@00023@ohm@02126@ordf@000AA@ordm@000BA@para@000B6@percnt@00025@period@0002E@plus@0002B@plusmn@000B1@pound@000A3@quest@0003F@quot@00022@raquo@000BB@rarr@02192@rcub@0007D@rdquo@0201D@reg@000AE@rpar@00029@rsqb@0005D@rsquo@02019@sect@000A7@semi@0003B@shy@000AD@sol@0002F@sung@0266A@sup1@000B9@sup2@000B2@sup3@000B3@times@000D7@trade@02122@uarr@02191@verbar@0007C@yen@000A5@blank@02423@blk12@02592@blk14@02591@blk34@02593@block@02588@bull@02022@caret@02041@check@02713@cir@025CB@clubs@02663@copysr@02117@cross@02717@Dagger@02021@dagger@02020@dash@02010@diams@02666@dlcrop@0230D@drcrop@0230C@dtri@025BF@dtrif@025BE@emsp@02003@emsp13@02004@emsp14@02005@ensp@02002@female@02640@ffilig@0FB03@fflig@0FB00@ffllig@0FB04@filig@0FB01@flat@0266D@fllig@0FB02@frac13@02153@frac15@02155@frac16@02159@frac23@02154@frac25@02156@frac35@02157@frac45@02158@frac56@0215A@hairsp@0200A@hearts@02665@hellip@02026@hybull@02043@incare@02105@ldquor@0201E@lhblk@02584@loz@025CA@lozf@029EB@lsquor@0201A@ltri@025C3@ltrif@025C2@male@02642@malt@02720@marker@025AE@mdash@02014@mldr@02026@natur@0266E@ndash@02013@nldr@02025@numsp@02007@phone@0260E@puncsp@02008@rdquor@0201D@rect@025AD@rsquor@02019@rtri@025B9@rtrif@025B8@rx@0211E@sext@02736@sharp@0266F@spades@02660@squ@025A1@squf@025AA@star@02606@starf@02605@target@02316@telrec@02315@thinsp@02009@uhblk@02580@ulcrop@0230F@urcrop@0230E@utri@025B5@utrif@025B4@vellip@022EE@angzarr@0237C@cirmid@02AEF@cudarrl@02938@cudarrr@02935@cularr@021B6@cularrp@0293D@curarr@021B7@curarrm@0293C@Darr@021A1@dArr@021D3@ddarr@021CA@DDotrahd@02911@dfisht@0297F@dHar@02965@dharl@021C3@dharr@021C2@duarr@021F5@duhar@0296F@dzigrarr@027FF@erarr@02971@hArr@021D4@harr@02194@harrcir@02948@harrw@021AD@hoarr@021FF@imof@022B7@lAarr@021DA@Larr@0219E@larrbfs@0291F@larrfs@0291D@larrhk@021A9@larrlp@021AB@larrpl@02939@larrsim@02973@larrtl@021A2@lAtail@0291B@latail@02919@lBarr@0290E@lbarr@0290C@ldca@02936@ldrdhar@02967@ldrushar@0294B@ldsh@021B2@lfisht@0297C@lHar@02962@lhard@021BD@lharu@021BC@lharul@0296A@llarr@021C7@llhard@0296B@loarr@021FD@lrarr@021C6@lrhar@021CB@lrhard@0296D@lsh@021B0@lurdshar@0294A@luruhar@02966@Map@02905@map@021A6@midcir@02AF0@mumap@022B8@nearhk@02924@neArr@021D7@nearr@02197@nesear@02928@nhArr@021CE@nharr@021AE@nlArr@021CD@nlarr@0219A@nrArr@021CF@nrarr@0219B@nvHarr@02904@nvlArr@02902@nvrArr@02903@nwarhk@02923@nwArr@021D6@nwarr@02196@nwnear@02927@olarr@021BA@orarr@021BB@origof@022B6@rAarr@021DB@Rarr@021A0@rarrap@02975@rarrbfs@02920@rarrc@02933@rarrfs@0291E@rarrhk@021AA@rarrlp@021AC@rarrpl@02945@rarrsim@02974@Rarrtl@02916@rarrtl@021A3@rarrw@0219D@rAtail@0291C@ratail@0291A@RBarr@02910@rBarr@0290F@rbarr@0290D@rdca@02937@rdldhar@02969@rdsh@021B3@rfisht@0297D@rHar@02964@rhard@021C1@rharu@021C0@rharul@0296C@rlarr@021C4@rlhar@021CC@roarr@021FE@rrarr@021C9@rsh@021B1@ruluhar@02968@searhk@02925@seArr@021D8@searr@02198@seswar@02929@simrarr@02972@slarr@02190@srarr@02192@swarhk@02926@swArr@021D9@swarr@02199@swnwar@0292A@Uarr@0219F@uArr@021D1@Uarrocir@02949@udarr@021C5@udhar@0296E@ufisht@0297E@uHar@02963@uharl@021BF@uharr@021BE@uuarr@021C8@vArr@021D5@varr@02195@xhArr@027FA@xharr@027F7@xlArr@027F8@xlarr@027F5@xmap@027FC@xrArr@027F9@xrarr@027F6@zigrarr@021DD@ac@0223E@amalg@02A3F@barvee@022BD@Barwed@02306@barwed@02305@bsolb@029C5@Cap@022D2@capand@02A44@capbrcup@02A49@capcap@02A4B@capcup@02A47@capdot@02A40@ccaps@02A4D@ccups@02A4C@ccupssm@02A50@coprod@02210@Cup@022D3@cupbrcap@02A48@cupcap@02A46@cupcup@02A4A@cupdot@0228D@cupor@02A45@cuvee@022CE@cuwed@022CF@Dagger@02021@dagger@02020@diam@022C4@divonx@022C7@eplus@02A71@hercon@022B9@intcal@022BA@iprod@02A3C@loplus@02A2D@lotimes@02A34@lthree@022CB@ltimes@022C9@midast@0002A@minusb@0229F@minusd@02238@minusdu@02A2A@ncap@02A43@ncup@02A42@oast@0229B@ocir@0229A@odash@0229D@odiv@02A38@odot@02299@odsold@029BC@ofcir@029BF@ogt@029C1@ohbar@029B5@olcir@029BE@olt@029C0@omid@029B6@ominus@02296@opar@029B7@operp@029B9@oplus@02295@osol@02298@Otimes@02A37@otimes@02297@otimesas@02A36@ovbar@0233D@plusacir@02A23@plusb@0229E@pluscir@02A22@plusdo@02214@plusdu@02A25@pluse@02A72@plussim@02A26@plustwo@02A27@prod@0220F@race@029DA@roplus@02A2E@rotimes@02A35@rthree@022CC@rtimes@022CA@sdot@022C5@sdotb@022A1@setmn@02216@simplus@02A24@smashp@02A33@solb@029C4@sqcap@02293@sqcup@02294@ssetmn@02216@sstarf@022C6@subdot@02ABD@sum@02211@supdot@02ABE@timesb@022A0@timesbar@02A31@timesd@02A30@tridot@025EC@triminus@02A3A@triplus@02A39@trisb@029CD@tritime@02A3B@uplus@0228E@veebar@022BB@wedbar@02A5F@wreath@02240@xcap@022C2@xcirc@025EF@xcup@022C3@xdtri@025BD@xodot@02A00@xoplus@02A01@xotime@02A02@xsqcup@02A06@xuplus@02A04@xutri@025B3@xvee@022C1@xwedge@022C0@dlcorn@0231E@drcorn@0231F@gtlPar@02995@langd@02991@lbrke@0298B@lbrksld@0298F@lbrkslu@0298D@lceil@02308@lfloor@0230A@lmoust@023B0@lparlt@02993@ltrPar@02996@rangd@02992@rbrke@0298C@rbrksld@0298E@rbrkslu@02990@rceil@02309@rfloor@0230B@rmoust@023B1@rpargt@02994@ulcorn@0231C@urcorn@0231D@gnap@02A8A@gnE@02269@gne@02A88@gnsim@022E7@lnap@02A89@lnE@02268@lne@02A87@lnsim@022E6@nap@02249@ncong@02247@nequiv@02262@nge@02271@ngsim@02275@ngt@0226F@nle@02270@nlsim@02274@nlt@0226E@nltri@022EA@nltrie@022EC@nmid@02224@npar@02226@npr@02280@nprcue@022E0@nrtri@022EB@nrtrie@022ED@nsc@02281@nsccue@022E1@nsim@02241@nsime@02244@nsmid@02224@nspar@02226@nsqsube@022E2@nsqsupe@022E3@nsub@02284@nsube@02288@nsup@02285@nsupe@02289@ntgl@02279@ntlg@02278@nVDash@022AF@nVdash@022AE@nvDash@022AD@nvdash@022AC@parsim@02AF3@prnap@02AB9@prnE@02AB5@prnsim@022E8@rnmid@02AEE@scnap@02ABA@scnE@02AB6@scnsim@022E9@simne@02246@solbar@0233F@subnE@02ACB@subne@0228A@supnE@02ACC@supne@0228B@ang@02220@ange@029A4@angmsd@02221@angmsdaa@029A8@angmsdab@029A9@angmsdac@029AA@angmsdad@029AB@angmsdae@029AC@angmsdaf@029AD@angmsdag@029AE@angmsdah@029AF@angrtvb@022BE@angrtvbd@0299D@bbrk@023B5@bbrktbrk@023B6@bemptyv@029B0@beth@02136@boxbox@029C9@"
|
10
|
+
s2 = "bprime@02035@bsemi@0204F@cemptyv@029B2@cirE@029C3@cirscir@029C2@comp@02201@daleth@02138@demptyv@029B1@ell@02113@empty@02205@emptyv@02205@gimel@02137@iiota@02129@image@02111@imath@00131@jmath@0006A@laemptyv@029B4@lltri@025FA@lrtri@022BF@mho@02127@nexist@02204@oS@024C8@planck@0210F@plankv@0210F@raemptyv@029B3@range@029A5@real@0211C@tbrk@023B4@trpezium@0FFFD@ultri@025F8@urtri@025F9@vzigzag@0299A@weierp@02118@apE@02A70@ape@0224A@apid@0224B@asymp@02248@Barv@02AE7@bcong@0224C@bepsi@003F6@bowtie@022C8@bsim@0223D@bsime@022CD@bump@0224E@bumpE@02AAE@bumpe@0224F@cire@02257@Colon@02237@Colone@02A74@colone@02254@congdot@02A6D@csub@02ACF@csube@02AD1@csup@02AD0@csupe@02AD2@cuepr@022DE@cuesc@022DF@Dashv@02AE4@dashv@022A3@easter@02A6E@ecir@02256@ecolon@02255@eDDot@02A77@eDot@02251@efDot@02252@eg@02A9A@egs@02A96@egsdot@02A98@el@02A99@els@02A95@elsdot@02A97@equest@0225F@equivDD@02A78@erDot@02253@esdot@02250@Esim@02A73@esim@02242@fork@022D4@forkv@02AD9@frown@02322@gap@02A86@gE@02267@gEl@02A8C@gel@022DB@ges@02A7E@gescc@02AA9@gesdot@02A80@gesdoto@02A82@gesdotol@02A84@gesles@02A94@Gg@022D9@gl@02277@gla@02AA5@glE@02A92@glj@02AA4@gsim@02273@gsime@02A8E@gsiml@02A90@Gt@0226B@gtcc@02AA7@gtcir@02A7A@gtdot@022D7@gtquest@02A7C@gtrarr@02978@homtht@0223B@lap@02A85@lat@02AAB@late@02AAD@lE@02266@lEg@02A8B@leg@022DA@les@02A7D@lescc@02AA8@lesdot@02A7F@lesdoto@02A81@lesdotor@02A83@lesges@02A93@lg@02276@lgE@02A91@Ll@022D8@lsim@02272@lsime@02A8D@lsimg@02A8F@Lt@0226A@ltcc@02AA6@ltcir@02A79@ltdot@022D6@ltlarr@02976@ltquest@02A7B@ltrie@022B4@mcomma@02A29@mDDot@0223A@mid@02223@mlcp@02ADB@models@022A7@mstpos@0223E@Pr@02ABB@pr@0227A@prap@02AB7@prcue@0227C@prE@02AB3@pre@02AAF@prsim@0227E@prurel@022B0@ratio@02236@rtrie@022B5@rtriltri@029CE@Sc@02ABC@sc@0227B@scap@02AB8@sccue@0227D@scE@02AB4@sce@02AB0@scsim@0227F@sdote@02A66@sfrown@02322@simg@02A9E@simgE@02AA0@siml@02A9D@simlE@02A9F@smid@02223@smile@02323@smt@02AAA@smte@02AAC@spar@02225@sqsub@0228F@sqsube@02291@sqsup@02290@sqsupe@02292@ssmile@02323@Sub@022D0@subE@02AC5@subedot@02AC3@submult@02AC1@subplus@02ABF@subrarr@02979@subsim@02AC7@subsub@02AD5@subsup@02AD3@Sup@022D1@supdsub@02AD8@supE@02AC6@supedot@02AC4@suphsub@02AD7@suplarr@0297B@supmult@02AC2@supplus@02AC0@supsim@02AC8@supsub@02AD4@supsup@02AD6@thkap@02248@thksim@0223C@topfork@02ADA@trie@0225C@twixt@0226C@Vbar@02AEB@vBar@02AE8@vBarv@02AE9@VDash@022AB@Vdash@022A9@vDash@022A8@vdash@022A2@Vdashl@02AE6@vltri@022B2@vprop@0221D@vrtri@022B3@Vvdash@022AA@alpha@003B1@beta@003B2@chi@003C7@Delta@00394@delta@003B4@epsi@003B5@epsiv@003F5@eta@003B7@Gamma@00393@gamma@003B3@Gammad@003DC@gammad@003DD@iota@003B9@kappa@003BA@kappav@003F0@Lambda@0039B@lambda@003BB@mu@003BC@nu@003BD@Omega@003A9@omega@003C9@Phi@003A6@phi@003C6@phiv@003D5@Pi@003A0@pi@003C0@piv@003D6@Psi@003A8@psi@003C8@rho@003C1@rhov@003F1@Sigma@003A3@sigma@003C3@sigmav@003C2@tau@003C4@Theta@00398@theta@003B8@thetav@003D1@Upsi@003D2@upsi@003C5@Xi@0039E@xi@003BE@zeta@003B6@Cfr@0212D@Hfr@0210C@Ifr@02111@Rfr@0211C@Zfr@02128@Copf@02102@Hopf@0210D@Nopf@02115@Popf@02119@Qopf@0211A@Ropf@0211D@Zopf@02124@acd@0223F@aleph@02135@And@02A53@and@02227@andand@02A55@andd@02A5C@andslope@02A58@andv@02A5A@angrt@0221F@angsph@02222@angst@0212B@ap@02248@apacir@02A6F@awconint@02233@awint@02A11@becaus@02235@bernou@0212C@bNot@02AED@bnot@02310@bottom@022A5@cap@02229@Cconint@02230@cirfnint@02A10@compfn@02218@cong@02245@Conint@0222F@conint@0222E@ctdot@022EF@cup@0222A@cwconint@02232@cwint@02231@cylcty@0232D@disin@022F2@Dot@000A8@DotDot@020DC@dsol@029F6@dtdot@022F1@dwangle@029A6@elinters@0FFFD@epar@022D5@eparsl@029E3@equiv@02261@eqvparsl@029E5@exist@02203@fltns@025B1@fnof@00192@forall@02200@fpartint@02A0D@ge@02265@hamilt@0210B@iff@021D4@iinfin@029DC@imped@001B5@infin@0221E@infintie@029DD@Int@0222C@int@0222B@intlarhk@02A17@isin@02208@isindot@022F5@isinE@022F9@isins@022F4@isinsv@022F3@isinv@02208@lagran@02112@Lang@0300A@lang@027e8@lArr@021D0@lbbrk@03014@le@02264@loang@03018@lobrk@0301A@lopar@02985@lowast@02217@minus@02212@mnplus@02213@nabla@02207@ne@02260@nhpar@02AF2@ni@0220B@nis@022FC@nisd@022FA@niv@0220B@Not@02AEC@notin@02209@notinva@02209@notinvb@022F7@notinvc@022F6@notni@0220C@notniva@0220C@notnivb@022FE@notnivc@022FD@npolint@02A14@nvinfin@029DE@olcross@029BB@Or@02A54@or@02228@ord@02A5D@order@02134@oror@02A56@orslope@02A57@orv@02A5B@par@02225@parsl@02AFD@part@02202@permil@02030@perp@022A5@pertenk@02031@phmmat@02133@pointint@02A15@Prime@02033@prime@02032@profalar@0232E@profline@02312@profsurf@02313@prop@0221D@qint@02A0C@qprime@02057@quatint@02A16@radic@0221A@Rang@0300B@rang@027e9@rArr@021D2@rbbrk@03015@roang@03019@robrk@0301B@ropar@02986@rppolint@02A12@scpolint@02A13@sim@0223C@simdot@02A6A@sime@02243@smeparsl@029E4@square@025A1@squarf@025AA@strns@000AF@sub@02282@sube@02286@sup@02283@supe@02287@tdot@020DB@there4@02234@tint@0222D@top@022A4@topbot@02336@topcir@02AF1@tprime@02034@utdot@022F0@uwangle@029A7@vangrt@0299C@veeeq@0225A@Verbar@02016@wedgeq@02259@xnis@022FB@angle@02220@ApplyFunction@02061@approx@02248@approxeq@0224A@Assign@02254@backcong@0224C@backepsilon@003F6@backprime@02035@backsim@0223D@backsimeq@022CD@Backslash@02216@barwedge@02305@Because@02235@because@02235@Bernoullis@0212C@between@0226C@bigcap@022C2@bigcirc@025EF@bigcup@022C3@bigodot@02A00@bigoplus@02A01@bigotimes@02A02@bigsqcup@02A06@bigstar@02605@bigtriangledown@025BD@bigtriangleup@025B3@biguplus@02A04@bigvee@022C1@bigwedge@022C0@bkarow@0290D@blacklozenge@029EB@blacksquare@025AA@blacktriangle@025B4@blacktriangledown@025BE@blacktriangleleft@025C2@blacktriangleright@025B8@bot@022A5@boxminus@0229F@boxplus@0229E@boxtimes@022A0@Breve@002D8@bullet@02022@Bumpeq@0224E@bumpeq@0224F@CapitalDifferentialD@02145@Cayleys@0212D@Cedilla@000B8@CenterDot@000B7@centerdot@000B7@checkmark@02713@circeq@02257@circlearrowleft@021BA@circlearrowright@021BB@circledast@0229B@circledcirc@0229A@circleddash@0229D@CircleDot@02299@circledR@000AE@circledS@024C8@CircleMinus@02296@CirclePlus@02295@CircleTimes@02297@ClockwiseContourIntegral@02232@CloseCurlyDoubleQuote@0201D@CloseCurlyQuote@02019@clubsuit@02663@coloneq@02254@complement@02201@complexes@02102@Congruent@02261@ContourIntegral@0222E@Coproduct@02210@CounterClockwiseContourIntegral@02233@CupCap@0224D@curlyeqprec@022DE@curlyeqsucc@022DF@curlyvee@022CE@curlywedge@022CF@curvearrowleft@021B6@curvearrowright@021B7@dbkarow@0290F@ddagger@02021@ddotseq@02A77@Del@02207@DiacriticalAcute@000B4@DiacriticalDot@002D9@DiacriticalDoubleAcute@002DD@DiacriticalGrave@00060@DiacriticalTilde@002DC@Diamond@022C4@diamond@022C4@diamondsuit@02666@DifferentialD@02146@digamma@003DD@div@000F7@divideontimes@022C7@doteq@02250@doteqdot@02251@DotEqual@02250@dotminus@02238@dotplus@02214@dotsquare@022A1@doublebarwedge@02306@DoubleContourIntegral@0222F@DoubleDot@000A8@DoubleDownArrow@021D3@DoubleLeftArrow@021D0@DoubleLeftRightArrow@021D4@DoubleLeftTee@02AE4@DoubleLongLeftArrow@027F8@DoubleLongLeftRightArrow@027FA@DoubleLongRightArrow@027F9@DoubleRightArrow@021D2@DoubleRightTee@022A8@DoubleUpArrow@021D1@DoubleUpDownArrow@021D5@DoubleVerticalBar@02225@DownArrow@02193@Downarrow@021D3@downarrow@02193@DownArrowUpArrow@021F5@downdownarrows@021CA@downharpoonleft@021C3@downharpoonright@021C2@DownLeftVector@021BD@DownRightVector@021C1@DownTee@022A4@DownTeeArrow@021A7@drbkarow@02910@Element@02208@emptyset@02205@eqcirc@02256@eqcolon@02255@eqsim@02242@eqslantgtr@02A96@eqslantless@02A95@EqualTilde@02242@Equilibrium@021CC@Exists@02203@expectation@02130@ExponentialE@02147@exponentiale@02147@fallingdotseq@02252@ForAll@02200@Fouriertrf@02131@geq@02265@geqq@02267@geqslant@02A7E@gg@0226B@ggg@022D9@gnapprox@02A8A@gneq@02A88@gneqq@02269@GreaterEqual@02265@GreaterEqualLess@022DB@GreaterFullEqual@02267@GreaterLess@02277@GreaterSlantEqual@02A7E@GreaterTilde@02273@gtrapprox@02A86@gtrdot@022D7@gtreqless@022DB@gtreqqless@02A8C@gtrless@02277@gtrsim@02273@Hacek@002C7@hbar@0210F@heartsuit@02665@HilbertSpace@0210B@hksearow@02925@hkswarow@02926@hookleftarrow@021A9@hookrightarrow@021AA@hslash@0210F@HumpDownHump@0224E@HumpEqual@0224F@iiiint@02A0C@iiint@0222D@Im@02111@ImaginaryI@02148@imagline@02110@imagpart@02111@Implies@021D2@in@02208@integers@02124@Integral@0222B@intercal@022BA@Intersection@022C2@intprod@02A3C@InvisibleComma@02063@InvisibleTimes@02062@langle@027e8@Laplacetrf@02112@lbrace@0007B@lbrack@0005B@LeftAngleBracket@027e8@LeftArrow@02190@Leftarrow@021D0@leftarrow@02190@LeftArrowBar@021E4@LeftArrowRightArrow@021C6@leftarrowtail@021A2@LeftCeiling@02308@LeftDoubleBracket@0301A@LeftDownVector@021C3@LeftFloor@0230A@leftharpoondown@021BD@leftharpoonup@021BC@leftleftarrows@021C7@LeftRightArrow@02194@Leftrightarrow@021D4@leftrightarrow@02194@leftrightarrows@021C6@leftrightharpoons@021CB@leftrightsquigarrow@021AD@LeftTee@022A3@LeftTeeArrow@021A4@leftthreetimes@022CB@LeftTriangle@022B2@LeftTriangleEqual@022B4@LeftUpVector@021BF@LeftVector@021BC@leq@02264@leqq@02266@leqslant@02A7D@lessapprox@02A85@lessdot@022D6@lesseqgtr@022DA@lesseqqgtr@02A8B@LessEqualGreater@022DA@LessFullEqual@02266@LessGreater@02276@lessgtr@02276@lesssim@02272@LessSlantEqual@02A7D@LessTilde@02272@ll@0226A@llcorner@0231E@Lleftarrow@021DA@lmoustache@023B0@lnapprox@02A89@lneq@02A87@lneqq@02268@LongLeftArrow@027F5@Longleftarrow@027F8@longleftarrow@027F5@LongLeftRightArrow@027F7@Longleftrightarrow@027FA@longleftrightarrow@027F7@longmapsto@027FC@LongRightArrow@027F6@Longrightarrow@027F9@longrightarrow@027F6@looparrowleft@021AB@looparrowright@021AC@LowerLeftArrow@02199@LowerRightArrow@02198@lozenge@025CA@lrcorner@0231F@Lsh@021B0@maltese@02720@mapsto@021A6@measuredangle@02221@Mellintrf@02133@MinusPlus@02213@mp@02213@multimap@022B8@napprox@02249@natural@0266E@naturals@02115@nearrow@02197@NegativeMediumSpace@0200B@NegativeThickSpace@0200B@NegativeThinSpace@0200B@NegativeVeryThinSpace@0200B@NestedGreaterGreater@0226B@NestedLessLess@0226A@nexists@02204@ngeq@02271@ngtr@0226F@nLeftarrow@021CD@nleftarrow@0219A@nLeftrightarrow@021CE@nleftrightarrow@021AE@nleq@02270@nless@0226E@NonBreakingSpace@000A0@NotCongruent@02262@NotDoubleVerticalBar@02226@NotElement@02209@NotEqual@02260@NotExists@02204@NotGreater@0226F@NotGreaterEqual@02271@NotGreaterLess@02279@NotGreaterTilde@02275@NotLeftTriangle@022EA@NotLeftTriangleEqual@022EC@NotLess@0226E@NotLessEqual@02270@NotLessGreater@02278@NotLessTilde@02274@NotPrecedes@02280@NotPrecedesSlantEqual@022E0@NotReverseElement@0220C@NotRightTriangle@022EB@NotRightTriangleEqual@022ED@NotSquareSubsetEqual@022E2@NotSquareSupersetEqual@022E3@NotSubsetEqual@02288@NotSucceeds@02281@NotSucceedsSlantEqual@022E1@NotSupersetEqual@02289@NotTilde@02241@NotTildeEqual@02244@NotTildeFullEqual@02247@NotTildeTilde@02249@NotVerticalBar@02224@nparallel@02226@nprec@02280@nRightarrow@021CF@nrightarrow@0219B@nshortmid@02224@nshortparallel@02226@nsimeq@02244@nsubseteq@02288@nsucc@02281@nsupseteq@02289@ntriangleleft@022EA@ntrianglelefteq@022EC@ntriangleright@022EB@ntrianglerighteq@022ED@nwarrow@02196@oint@0222E@OpenCurlyDoubleQuote@0201C@OpenCurlyQuote@02018@orderof@02134@parallel@02225@PartialD@02202@pitchfork@022D4@PlusMinus@000B1@pm@000B1@Poincareplane@0210C@prec@0227A@precapprox@02AB7@preccurlyeq@0227C@Precedes@0227A@PrecedesEqual@02AAF@PrecedesSlantEqual@0227C@PrecedesTilde@0227E@preceq@02AAF@precnapprox@02AB9@precneqq@02AB5@precnsim@022E8@precsim@0227E@primes@02119@Proportion@02237@Proportional@0221D@propto@0221D@quaternions@0210D@questeq@0225F@rangle@027e9@rationals@0211A@rbrace@0007D@rbrack@0005D@Re@0211C@realine@0211B@realpart@0211C@reals@0211D@ReverseElement@0220B@ReverseEquilibrium@021CB@ReverseUpEquilibrium@0296F@RightAngleBracket@027e9@RightArrow@02192@Rightarrow@021D2@rightarrow@02192@RightArrowBar@021E5@RightArrowLeftArrow@021C4@rightarrowtail@021A3@RightCeiling@02309@RightDoubleBracket@0301B@RightDownVector@021C2@RightFloor@0230B@rightharpoondown@021C1@rightharpoonup@021C0@rightleftarrows@021C4@rightleftharpoons@021CC@rightrightarrows@021C9@rightsquigarrow@0219D@RightTee@022A2@RightTeeArrow@021A6@rightthreetimes@022CC@RightTriangle@022B3@RightTriangleEqual@022B5@RightUpVector@021BE@RightVector@021C0@risingdotseq@02253@rmoustache@023B1@Rrightarrow@021DB@Rsh@021B1@searrow@02198@setminus@02216@ShortDownArrow@02193@ShortLeftArrow@02190@shortmid@02223@shortparallel@02225@ShortRightArrow@02192@ShortUpArrow@02191@simeq@02243@SmallCircle@02218@smallsetminus@02216@spadesuit@02660@Sqrt@0221A@sqsubset@0228F@sqsubseteq@02291@sqsupset@02290@sqsupseteq@02292@Square@025A1@SquareIntersection@02293@SquareSubset@0228F@SquareSubsetEqual@02291@SquareSuperset@02290@SquareSupersetEqual@02292@SquareUnion@02294@Star@022C6@straightepsilon@003F5@straightphi@003D5@Subset@022D0@subset@02282@subseteq@02286@subseteqq@02AC5@SubsetEqual@02286@subsetneq@0228A@subsetneqq@02ACB@succ@0227B@succapprox@02AB8@succcurlyeq@0227D@Succeeds@0227B@SucceedsEqual@02AB0@SucceedsSlantEqual@0227D@SucceedsTilde@0227F@succeq@02AB0@succnapprox@02ABA@succneqq@02AB6@succnsim@022E9@succsim@0227F@SuchThat@0220B@Sum@02211@Superset@02283@SupersetEqual@02287@Supset@022D1@supset@02283@supseteq@02287@supseteqq@02AC6@supsetneq@0228B@supsetneqq@02ACC@swarrow@02199@Therefore@02234@therefore@02234@thickapprox@02248@thicksim@0223C@ThinSpace@02009@Tilde@0223C@TildeEqual@02243@TildeFullEqual@02245@TildeTilde@02248@toea@02928@tosa@02929@triangle@025B5@triangledown@025BF@triangleleft@025C3@trianglelefteq@022B4@triangleq@0225C@triangleright@025B9@trianglerighteq@022B5@TripleDot@020DB@twoheadleftarrow@0219E@twoheadrightarrow@021A0@ulcorner@0231C@Union@022C3@UnionPlus@0228E@UpArrow@02191@Uparrow@021D1@uparrow@02191@UpArrowDownArrow@021C5@UpDownArrow@02195@Updownarrow@021D5@updownarrow@02195@UpEquilibrium@0296E@upharpoonleft@021BF@upharpoonright@021BE@UpperLeftArrow@02196@UpperRightArrow@02197@upsilon@003C5@UpTee@022A5@UpTeeArrow@021A5@upuparrows@021C8@urcorner@0231D@varepsilon@003F5@varkappa@003F0@varnothing@02205@varphi@003C6@varpi@003D6@varpropto@0221D@varrho@003F1@varsigma@003C2@vartheta@003D1@vartriangleleft@022B2@vartriangleright@022B3@Vee@022C1@vee@02228@Vert@02016@vert@0007C@VerticalBar@02223@VerticalTilde@02240@VeryThinSpace@0200A@Wedge@022C0@wedge@02227@wp@02118@wr@02240@zeetrf@02128@af@02061@asympeq@0224D@Cross@02A2F@DD@02145@dd@02146@DownArrowBar@02913@DownBreve@00311@DownLeftRightVector@02950@DownLeftTeeVector@0295E@DownLeftVectorBar@02956@DownRightTeeVector@0295F@DownRightVectorBar@02957@ee@02147@EmptySmallSquare@025FB@EmptyVerySmallSquare@025AB@Equal@02A75@FilledSmallSquare@025FC@FilledVerySmallSquare@025AA@GreaterGreater@02AA2@Hat@0005E@HorizontalLine@02500@ic@02063@ii@02148@it@02062@larrb@021E4@LeftDownTeeVector@02961@LeftDownVectorBar@02959@LeftRightVector@0294E@LeftTeeVector@0295A@LeftTriangleBar@029CF@LeftUpDownVector@02951@LeftUpTeeVector@02960@LeftUpVectorBar@02958@LeftVectorBar@02952@LessLess@02AA1@mapstodown@021A7@mapstoleft@021A4@mapstoup@021A5@MediumSpace@0205F@NewLine@0000A@NoBreak@02060@NotCupCap@0226D@OverBar@000AF@OverBrace@023DE@OverBracket@023B4@OverParenthesis@023DC@planckh@0210E@Product@0220F@rarrb@021E5@RightDownTeeVector@0295D@RightDownVectorBar@02955@RightTeeVector@0295B@RightTriangleBar@029D0@RightUpDownVector@0294F@RightUpTeeVector@0295C@RightUpVectorBar@02954@RightVectorBar@02953@RoundImplies@02970@RuleDelayed@029F4@Tab@00009@UnderBar@00332@UnderBrace@023DF@UnderBracket@023B5@UnderParenthesis@023DD@UpArrowBar@02912@Upsilon@003A5@VerticalLine@0007C@VerticalSeparator@02758@ZeroWidthSpace@0200B@omicron@003BF@amalg@02210@NegativeThinSpace@0E000@Iopf@1d540@"
|
11
|
+
oldWebeq = "infty@221e@partial@2202@iint@222c@neq@2260@nsubset@2284@nsupset@2285@exists@2203@ldots@2026@vdots@22ee@cdots@22ef@ddots@22f1@bar@00af@hat@005e@vec@21c0@ddot@00A8@"
|
12
|
+
MATHML_ENTITIES = (s1+s2)+oldWebeq
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,515 @@
|
|
1
|
+
module WirisPlugin
|
2
|
+
include Wiris
|
3
|
+
require('com/wiris/util/xml/WEntities.rb')
|
4
|
+
require('com/wiris/common/WInteger.rb')
|
5
|
+
class WXmlUtils
|
6
|
+
include Wiris
|
7
|
+
|
8
|
+
def initialize()
|
9
|
+
super()
|
10
|
+
end
|
11
|
+
def self.getElementContent(element)
|
12
|
+
sb = StringBuf.new()
|
13
|
+
if (element::nodeType==Xml::Document)||(element::nodeType==Xml::Element)
|
14
|
+
i = element::iterator()
|
15
|
+
while i::hasNext()
|
16
|
+
sb::add(i::next()::toString())
|
17
|
+
end
|
18
|
+
end
|
19
|
+
return sb::toString()
|
20
|
+
end
|
21
|
+
def self.getElementsByAttributeValue(nodeList,attributeName,attributeValue)
|
22
|
+
nodes = Array.new()
|
23
|
+
while nodeList::hasNext()
|
24
|
+
node = nodeList::next()
|
25
|
+
if (node::nodeType==Xml::Element)&&(attributeValue==WXmlUtils::getAttribute(node,attributeName))
|
26
|
+
nodes::push(node)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
return nodes
|
30
|
+
end
|
31
|
+
def self.getElementsByTagName(nodeList,tagName)
|
32
|
+
nodes = Array.new()
|
33
|
+
while nodeList::hasNext()
|
34
|
+
node = nodeList::next()
|
35
|
+
if (node::nodeType==Xml::Element)&&(node::nodeName==tagName)
|
36
|
+
nodes::push(node)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
return nodes
|
40
|
+
end
|
41
|
+
def self.getElements(node)
|
42
|
+
nodes = Array.new()
|
43
|
+
nodeList = node::iterator()
|
44
|
+
while nodeList::hasNext()
|
45
|
+
item = nodeList::next()
|
46
|
+
if item::nodeType==Xml::Element
|
47
|
+
nodes::push(item)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
return nodes
|
51
|
+
end
|
52
|
+
def self.getDocumentElement(doc)
|
53
|
+
nodeList = doc::iterator()
|
54
|
+
while nodeList::hasNext()
|
55
|
+
node = nodeList::next()
|
56
|
+
if node::nodeType==Xml::Element
|
57
|
+
return node
|
58
|
+
end
|
59
|
+
end
|
60
|
+
return nil
|
61
|
+
end
|
62
|
+
def self.getAttribute(node,attributeName)
|
63
|
+
value = node::get(attributeName)
|
64
|
+
if value==nil
|
65
|
+
return nil
|
66
|
+
end
|
67
|
+
if PlatformSettings::PARSE_XML_ENTITIES
|
68
|
+
return WXmlUtils::htmlUnescape(value)
|
69
|
+
end
|
70
|
+
return value
|
71
|
+
end
|
72
|
+
def self.setAttribute(node,name,value)
|
73
|
+
if (value!=nil)&&PlatformSettings::PARSE_XML_ENTITIES
|
74
|
+
value = WXmlUtils::htmlEscape(value)
|
75
|
+
end
|
76
|
+
node::set(name,value)
|
77
|
+
end
|
78
|
+
def self.getNodeValue(node)
|
79
|
+
value = node::getNodeValue_()
|
80
|
+
if value==nil
|
81
|
+
return nil
|
82
|
+
end
|
83
|
+
if PlatformSettings::PARSE_XML_ENTITIES&&(node::nodeType==Xml::PCData)
|
84
|
+
return WXmlUtils::htmlUnescape(value)
|
85
|
+
end
|
86
|
+
return value
|
87
|
+
end
|
88
|
+
def self.createPCData(node,text)
|
89
|
+
if PlatformSettings::PARSE_XML_ENTITIES
|
90
|
+
text = WXmlUtils::htmlEscape(text)
|
91
|
+
end
|
92
|
+
return node::createPCData_(text)
|
93
|
+
end
|
94
|
+
def self.htmlEscape(input)
|
95
|
+
output = StringTools::replace(input,"&","&")
|
96
|
+
output = StringTools::replace(output,"<","<")
|
97
|
+
output = StringTools::replace(output,">",">")
|
98
|
+
output = StringTools::replace(output,"\"",""")
|
99
|
+
output = StringTools::replace(output,"'","\'")
|
100
|
+
return output
|
101
|
+
end
|
102
|
+
def self.htmlUnescape(input)
|
103
|
+
output = ""
|
104
|
+
start = 0
|
105
|
+
position = input::indexOf('&',start)
|
106
|
+
while position!=-1
|
107
|
+
output+=Std::substr(input,start,position-start)
|
108
|
+
if input::charAt(position+1)=='#'
|
109
|
+
startPosition = position+2
|
110
|
+
endPosition = input::indexOf(';',startPosition)
|
111
|
+
if endPosition!=-1
|
112
|
+
number = Std::substr(input,startPosition,endPosition-startPosition)
|
113
|
+
if StringTools::startsWith(number,"x")
|
114
|
+
number = "0"+number
|
115
|
+
end
|
116
|
+
charCode = Std::parseInt(number)
|
117
|
+
output+=Utf8::uchr(charCode)
|
118
|
+
start = endPosition+1
|
119
|
+
else
|
120
|
+
output+='&'
|
121
|
+
start = position+1
|
122
|
+
end
|
123
|
+
else
|
124
|
+
output+='&'
|
125
|
+
start = position+1
|
126
|
+
end
|
127
|
+
position = input::indexOf('&',start)
|
128
|
+
end
|
129
|
+
output+=Std::substr(input,start,input::length()-start)
|
130
|
+
output = StringTools::replace(output,"<","<")
|
131
|
+
output = StringTools::replace(output,">",">")
|
132
|
+
output = StringTools::replace(output,""","\"")
|
133
|
+
output = StringTools::replace(output,"'","\'")
|
134
|
+
output = StringTools::replace(output,"&","&")
|
135
|
+
return output
|
136
|
+
end
|
137
|
+
@@entities = nil
|
138
|
+
def self.entities
|
139
|
+
@@entities
|
140
|
+
end
|
141
|
+
def self.entities=(entities)
|
142
|
+
@@entities = entities
|
143
|
+
end
|
144
|
+
def self.parseXML(xml)
|
145
|
+
xml = filterMathMLEntities(xml)
|
146
|
+
x = Xml::parse(xml)
|
147
|
+
return x
|
148
|
+
end
|
149
|
+
def self.serializeXML(xml)
|
150
|
+
s = xml::toString()
|
151
|
+
s = filterMathMLEntities(s)
|
152
|
+
return s
|
153
|
+
end
|
154
|
+
def self.resolveEntities(text)
|
155
|
+
initEntities()
|
156
|
+
sb = StringBuf.new()
|
157
|
+
i = 0
|
158
|
+
n = text::length()
|
159
|
+
while i<n
|
160
|
+
c = getUtf8Char(text,i)
|
161
|
+
if ((c==60)&&((i+12)<n))&&(Std::charCodeAt(text,i+1)==33)
|
162
|
+
if (Std::substr(text,i,9)=="<![CDATA[")
|
163
|
+
e = text::indexOf("]]>",i)
|
164
|
+
if e!=-1
|
165
|
+
sb::add(Std::substr(text,i,(e-i)+3))
|
166
|
+
i = e+3
|
167
|
+
next
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
if c>127
|
172
|
+
special = Utf8::uchr(c)
|
173
|
+
sb::add(special)
|
174
|
+
i+=special::length()-1
|
175
|
+
else
|
176
|
+
if c==38
|
177
|
+
i+=1
|
178
|
+
c = Std::charCodeAt(text,i)
|
179
|
+
if isNameStart(c)
|
180
|
+
name = StringBuf.new()
|
181
|
+
name::addChar(c)
|
182
|
+
i+=1
|
183
|
+
c = Std::charCodeAt(text,i)
|
184
|
+
while isNameChar(c)
|
185
|
+
name::addChar(c)
|
186
|
+
i+=1
|
187
|
+
c = Std::charCodeAt(text,i)
|
188
|
+
end
|
189
|
+
ent = name::toString()
|
190
|
+
if ((c==59)&&@@entities::exists(ent))&&!(isXmlEntity(ent))
|
191
|
+
val = @@entities::get(ent)
|
192
|
+
sb::add(Utf8::uchr(Std::parseInt(val)))
|
193
|
+
else
|
194
|
+
sb::add("&")
|
195
|
+
sb::add(name)
|
196
|
+
sb::addChar(c)
|
197
|
+
end
|
198
|
+
else
|
199
|
+
if c==35
|
200
|
+
i+=1
|
201
|
+
c = Std::charCodeAt(text,i)
|
202
|
+
if c==120
|
203
|
+
hex = StringBuf.new()
|
204
|
+
i+=1
|
205
|
+
c = Std::charCodeAt(text,i)
|
206
|
+
while isHexDigit(c)
|
207
|
+
hex::addChar(c)
|
208
|
+
i+=1
|
209
|
+
c = Std::charCodeAt(text,i)
|
210
|
+
end
|
211
|
+
hent = hex::toString()
|
212
|
+
if (c==59)&&!isXmlEntity("#x"+hent)
|
213
|
+
dec = Std::parseInt("0x"+hent)
|
214
|
+
sb::add(Utf8::uchr(dec))
|
215
|
+
else
|
216
|
+
sb::add("&#x")
|
217
|
+
sb::add(hent)
|
218
|
+
sb::addChar(c)
|
219
|
+
end
|
220
|
+
else
|
221
|
+
if ((48<=c)&&(c<=57))
|
222
|
+
dec = StringBuf.new()
|
223
|
+
while ((48<=c)&&(c<=57))
|
224
|
+
dec::addChar(c)
|
225
|
+
i+=1
|
226
|
+
c = Std::charCodeAt(text,i)
|
227
|
+
end
|
228
|
+
if (c==59)&&!isXmlEntity("#"+dec.to_s)
|
229
|
+
sb::add(Utf8::uchr(Std::parseInt(dec::toString())))
|
230
|
+
else
|
231
|
+
sb::add("&#"+dec::toString().to_s)
|
232
|
+
sb::addChar(c)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else
|
239
|
+
sb::addChar(c)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
i+=1
|
243
|
+
end
|
244
|
+
return sb::toString()
|
245
|
+
end
|
246
|
+
def self.filterMathMLEntities(text)
|
247
|
+
text = resolveEntities(text)
|
248
|
+
text = nonAsciiToEntities(text)
|
249
|
+
return text
|
250
|
+
end
|
251
|
+
def self.getUtf8Char(text,i)
|
252
|
+
c = Std::charCodeAt(text,i)
|
253
|
+
d = c
|
254
|
+
if PlatformSettings::UTF8_CONVERSION
|
255
|
+
if d>127
|
256
|
+
j = 0
|
257
|
+
c = 128
|
258
|
+
loop do
|
259
|
+
c = c>>1
|
260
|
+
j+=1
|
261
|
+
break if not (d&c)!=0
|
262
|
+
end
|
263
|
+
d = (c-1)&d
|
264
|
+
while j-=1>0
|
265
|
+
i+=1
|
266
|
+
c = Std::charCodeAt(text,i)
|
267
|
+
d = (d<<6)+(c&63)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
else
|
271
|
+
if (d>=55296)&&(d<=56319)
|
272
|
+
c = Std::charCodeAt(text,i+1)
|
273
|
+
d = (((d-55296)<<10)+((c-56320)))+65536
|
274
|
+
end
|
275
|
+
end
|
276
|
+
return d
|
277
|
+
end
|
278
|
+
def self.nonAsciiToEntities(s)
|
279
|
+
sb = StringBuf.new()
|
280
|
+
i = 0
|
281
|
+
n = s::length()
|
282
|
+
while i<n
|
283
|
+
c = getUtf8Char(s,i)
|
284
|
+
if c>127
|
285
|
+
hex = WInteger::toHex(c,5)
|
286
|
+
j = 0
|
287
|
+
while j<hex::length()
|
288
|
+
if !((Std::substr(hex,j,1)=="0"))
|
289
|
+
hex = Std::substr(hex,j)
|
290
|
+
break
|
291
|
+
end
|
292
|
+
j+=1
|
293
|
+
end
|
294
|
+
sb::add(("&#x"+hex)+";")
|
295
|
+
i+=(Utf8::uchr(c))::length()
|
296
|
+
else
|
297
|
+
sb::addChar(c)
|
298
|
+
i+=1
|
299
|
+
end
|
300
|
+
end
|
301
|
+
return sb::toString()
|
302
|
+
end
|
303
|
+
def self.isNameStart(c)
|
304
|
+
if (65<=c)&&(c<=90)
|
305
|
+
return true
|
306
|
+
end
|
307
|
+
if (97<=c)&&(c<=122)
|
308
|
+
return true
|
309
|
+
end
|
310
|
+
if (c==95)||(c==58)
|
311
|
+
return true
|
312
|
+
end
|
313
|
+
return false
|
314
|
+
end
|
315
|
+
def self.isNameChar(c)
|
316
|
+
if isNameStart(c)
|
317
|
+
return true
|
318
|
+
end
|
319
|
+
if (48<=c)&&(c<=57)
|
320
|
+
return true
|
321
|
+
end
|
322
|
+
if (c==46)||(c==45)
|
323
|
+
return true
|
324
|
+
end
|
325
|
+
return false
|
326
|
+
end
|
327
|
+
def self.isHexDigit(c)
|
328
|
+
if (c>=48)&&(c<=57)
|
329
|
+
return true
|
330
|
+
end
|
331
|
+
if (c>=65)&&(c<=70)
|
332
|
+
return true
|
333
|
+
end
|
334
|
+
if (c>=97)&&(c<=102)
|
335
|
+
return true
|
336
|
+
end
|
337
|
+
return false
|
338
|
+
end
|
339
|
+
def self.resolveMathMLEntity(name)
|
340
|
+
initEntities()
|
341
|
+
if @@entities::exists(name)
|
342
|
+
code = @@entities::get(name)
|
343
|
+
return Std::parseInt(code)
|
344
|
+
end
|
345
|
+
return -1
|
346
|
+
end
|
347
|
+
def self.initEntities()
|
348
|
+
if @@entities==nil
|
349
|
+
e = WEntities::MATHML_ENTITIES
|
350
|
+
@@entities = Hash.new()
|
351
|
+
start = 0
|
352
|
+
while (mid = e::indexOf("@",start))!=-1
|
353
|
+
name = Std::substr(e,start,mid-start)
|
354
|
+
mid+=1
|
355
|
+
start = e::indexOf("@",mid)
|
356
|
+
if start==-1
|
357
|
+
break
|
358
|
+
end
|
359
|
+
value = Std::substr(e,mid,start-mid)
|
360
|
+
num = Std::parseInt("0x"+value)
|
361
|
+
@@entities::set(name,""+num.to_s)
|
362
|
+
start+=1
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
def self.getText(xml)
|
367
|
+
if xml::nodeType==Xml::PCData
|
368
|
+
return xml::getNodeValue_()
|
369
|
+
end
|
370
|
+
r = ""
|
371
|
+
iter = xml::iterator()
|
372
|
+
while iter::hasNext()
|
373
|
+
r+=getText(iter::next())
|
374
|
+
end
|
375
|
+
return r
|
376
|
+
end
|
377
|
+
def self.copyXml(elem)
|
378
|
+
return importXml(elem,elem)
|
379
|
+
end
|
380
|
+
def self.importXml(elem,model)
|
381
|
+
n = nil
|
382
|
+
if elem::nodeType==Xml::Element
|
383
|
+
n = model::createElement_(elem::nodeName)
|
384
|
+
keys = elem::attributes()
|
385
|
+
while keys::hasNext()
|
386
|
+
key = keys::next()
|
387
|
+
n::set(key,elem::get(key))
|
388
|
+
end
|
389
|
+
children = elem::iterator()
|
390
|
+
while children::hasNext()
|
391
|
+
n::addChild(importXml(children::next(),model))
|
392
|
+
end
|
393
|
+
else
|
394
|
+
if elem::nodeType==Xml::Document
|
395
|
+
n = importXml(elem::firstElement(),model)
|
396
|
+
else
|
397
|
+
if elem::nodeType==Xml::CData
|
398
|
+
n = model::createCData_(elem::getNodeValue_())
|
399
|
+
else
|
400
|
+
if elem::nodeType==Xml::PCData
|
401
|
+
n = model::createPCData_(elem::getNodeValue_())
|
402
|
+
else
|
403
|
+
raise Exception,"Unsupported node type: "+elem::nodeType.to_s
|
404
|
+
end
|
405
|
+
end
|
406
|
+
end
|
407
|
+
end
|
408
|
+
return n
|
409
|
+
end
|
410
|
+
def self.copyXmlNamespace(elem,customNamespace)
|
411
|
+
return importXmlNamespace(elem,elem,customNamespace)
|
412
|
+
end
|
413
|
+
def self.importXmlNamespace(elem,model,customNamespace)
|
414
|
+
n = nil
|
415
|
+
if elem::nodeType==Xml::Element
|
416
|
+
n = model::createElement_((customNamespace+":")+elem::nodeName.to_s)
|
417
|
+
keys = elem::attributes()
|
418
|
+
while keys::hasNext()
|
419
|
+
key = keys::next()
|
420
|
+
keyNamespaced = key
|
421
|
+
if key::indexOf(":")==-1
|
422
|
+
keyNamespaced = (customNamespace+":")+key
|
423
|
+
end
|
424
|
+
n::set(keyNamespaced,elem::get(key))
|
425
|
+
end
|
426
|
+
children = elem::iterator()
|
427
|
+
while children::hasNext()
|
428
|
+
n::addChild(importXmlNamespace(children::next(),model,customNamespace))
|
429
|
+
end
|
430
|
+
else
|
431
|
+
if elem::nodeType==Xml::Document
|
432
|
+
n = importXmlNamespace(elem::firstElement(),model,customNamespace)
|
433
|
+
else
|
434
|
+
if elem::nodeType==Xml::CData
|
435
|
+
n = model::createCData_(elem::getNodeValue_())
|
436
|
+
else
|
437
|
+
if elem::nodeType==Xml::PCData
|
438
|
+
n = model::createPCData_(elem::getNodeValue_())
|
439
|
+
else
|
440
|
+
raise Exception,"Unsupported node type: "+elem::nodeType.to_s
|
441
|
+
end
|
442
|
+
end
|
443
|
+
end
|
444
|
+
end
|
445
|
+
return n
|
446
|
+
end
|
447
|
+
def self.indentXml(xml,space)
|
448
|
+
depth = 0
|
449
|
+
opentag = EReg.new("^<([\\w-_]+)[^>]*>$","")
|
450
|
+
autotag = EReg.new("^<([\\w-_]+)[^>]*/>$","")
|
451
|
+
closetag = EReg.new("^</([\\w-_]+)>$","")
|
452
|
+
cdata = EReg.new("^<!\\[CDATA\\[[^\\]]*\\]\\]>$","")
|
453
|
+
res = StringBuf.new()
|
454
|
+
_end = 0
|
455
|
+
while (_end<xml::length())&&((start = xml::indexOf("<",_end))!=-1)
|
456
|
+
text = start>_end
|
457
|
+
if text
|
458
|
+
res::add(Std::substr(xml,_end,start-_end))
|
459
|
+
end
|
460
|
+
_end = xml::indexOf(">",start)+1
|
461
|
+
aux = Std::substr(xml,start,_end-start)
|
462
|
+
if autotag::match(aux)
|
463
|
+
res::add("\n")
|
464
|
+
for i in 0..depth-1
|
465
|
+
res::add(space)
|
466
|
+
i+=1
|
467
|
+
end
|
468
|
+
res::add(aux)
|
469
|
+
else
|
470
|
+
if opentag::match(aux)
|
471
|
+
res::add("\n")
|
472
|
+
for i in 0..depth-1
|
473
|
+
res::add(space)
|
474
|
+
i+=1
|
475
|
+
end
|
476
|
+
res::add(aux)
|
477
|
+
depth+=1
|
478
|
+
else
|
479
|
+
if closetag::match(aux)
|
480
|
+
depth-=1
|
481
|
+
if !text
|
482
|
+
res::add("\n")
|
483
|
+
for i in 0..depth-1
|
484
|
+
res::add(space)
|
485
|
+
i+=1
|
486
|
+
end
|
487
|
+
end
|
488
|
+
res::add(aux)
|
489
|
+
else
|
490
|
+
if cdata::match(aux)
|
491
|
+
res::add(aux)
|
492
|
+
else
|
493
|
+
Std::trace((("WARNING! malformed XML at character "+_end.to_s)+":")+xml)
|
494
|
+
res::add(aux)
|
495
|
+
end
|
496
|
+
end
|
497
|
+
end
|
498
|
+
end
|
499
|
+
end
|
500
|
+
return StringTools::trim(res::toString())
|
501
|
+
end
|
502
|
+
def self.isXmlEntity(ent)
|
503
|
+
if Std::charCodeAt(ent,0)==35
|
504
|
+
if Std::charCodeAt(ent,1)==120
|
505
|
+
c = Std::parseInt("0x"+Std::substr(ent,2).to_s)
|
506
|
+
else
|
507
|
+
c = Std::parseInt(Std::substr(ent,1))
|
508
|
+
end
|
509
|
+
return (((((c==34)||(c==38))||(c==39))||(c==60))||(c==62))
|
510
|
+
else
|
511
|
+
return (((((ent=="amp")||(ent=="lt"))||(ent=="gt"))||(ent=="quot"))||(ent=="apos"))
|
512
|
+
end
|
513
|
+
end
|
514
|
+
end
|
515
|
+
end
|