<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DigiTechLog Dot Com &#187; Flash Player</title>
	<atom:link href="http://digitechlog.com/tag/flash-player/feed" rel="self" type="application/rss+xml" />
	<link>http://digitechlog.com</link>
	<description>Adobe AIR、Flex、Flash、Java</description>
	<lastBuildDate>Tue, 08 Nov 2011 12:46:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する</title>
		<link>http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html</link>
		<comments>http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:26:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Project]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[PyAMF]]></category>

		<guid isPermaLink="false">http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html</guid>
		<description><![CDATA[この前はPHPからAMFメソッドを呼び出すライブラリ「SabreAMF: FlexをPHP5と連携させるフレームワーク」などと．NETの「FluorineFx: Flexと.NET間でAMF通信できるライブラリ」を紹介しましたね。フリーなオブジェクト指向プログラミング言語Pythonは、動的な型付け、ガベージコレクション、マルチパラダイム、モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能など幾つか特徴があるので、Google App EngineもPythonがサポートされています。 
PythonからAMF通信できますか。今回紹介PyAMFとは、オープンソースプロジェクトとして、PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供しています。
 
  
PyAMFにより、Flash、Flex またはAIRで、Pythonによって起動しているWebサーバとリッチインターネットアプリケーション(RIA)クライアント間のAMFベースの通信を可能になります。Google App Engine Webアプリケーション向けの新たなAMFゲートウェイも導入されました。
この前にも紹介したことがあり、AMFはリモートプロシージャーコール(RPC)を、 HTTP/HTTPSまたはRTMP/RTMPSプロトコルを介して転送されるコンパクトなバイナリ表現にエンコードする。PyAMFは、 GAEバックエンドと共にFlexベースのRIAアプリケーションの開発を可能にし、RIAをGoogleクラウドコンピューティングプラットフォームに配置する。
以下はPyAMFの使用方法を簡単で紹介します。
・PyAMFのインストール
easy_installで、もしくはできなければダウンロードしてきてsetup.py installでもいい
easy_install pyamf
・AMFの配備
デフォルトのまま利用する場合は8000のportはあけておく必要があります。
以下のコマンドでserver.xmlを起動します。
python server.py
正常だったら、http://IPアドレス:8000/にAMFでアクセスすることが可能になります。
・クライアントからの接続確認
FlashDevelopを使って、簡単にRemoteObjectで接続してみて、http://pyamf.org/wiki/HelloWorld/Flex のサンプルに従って「Hello World」のサンプルを作れます。どう？簡単でしょう？  
【関連リンク】
http://pyamf.org/ 公式サイト
Related Posts

s2x: Flashのcookieファイル(*.sol)とXMLフォーマットの互换用Pythonスクリプトソース
リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した
python-crawler：Pythonのクローラーライブラリ
8 Adobe ActionScriptのチュートリアルフラッシュ
GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう
15+綺麗な車に関するアドビPhotoShopの.PSDファイル
5個アドビFlashメニューとナビゲーションのチュートリアル
トップ７個アドビAIRビデオアプリケーション

]]></description>
			<content:encoded><![CDATA[<p>この前はPHPからAMFメソッドを呼び出すライブラリ「<a href="http://digitechlog.com/2009/08/28/sabreamf-is-a-flash-remoting-server-and-client-for-php.html">SabreAMF: FlexをPHP5と連携させるフレームワーク</a>」などと．NETの「<a href="http://digitechlog.com/2009/09/30/fluorine-flash-remoting-for-dot-net.html">FluorineFx: Flexと.NET間でAMF通信できるライブラリ</a>」を紹介しましたね。フリーなオブジェクト指向プログラミング言語Pythonは、動的な型付け、ガベージコレクション、マルチパラダイム、モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能など幾つか特徴があるので、Google App EngineもPythonがサポートされています。 </p>
<p>PythonからAMF通信できますか。今回紹介PyAMFとは、オープンソースプロジェクトとして、PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供しています。</p>
<p><a href="http://digitechlog.com/wp-content/uploads/2009/10/pythonlogomasterv3trans.png"><img title="python-logo-master-v3-trans" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="216" alt="python-logo-master-v3-trans" src="http://digitechlog.com/wp-content/uploads/2009/10/pythonlogomasterv3trans_thumb.png" width="480" border="0" /></a> </p>
<p><span id="more-611"></span>  </p>
<p>PyAMFにより、Flash、Flex またはAIRで、Pythonによって起動しているWebサーバとリッチインターネットアプリケーション(RIA)クライアント間のAMFベースの通信を可能になります。Google App Engine Webアプリケーション向けの新たなAMFゲートウェイも導入されました。</p>
<p>この前にも紹介したことがあり、AMFはリモートプロシージャーコール(RPC)を、 HTTP/HTTPSまたはRTMP/RTMPSプロトコルを介して転送されるコンパクトなバイナリ表現にエンコードする。PyAMFは、 GAEバックエンドと共にFlexベースのRIAアプリケーションの開発を可能にし、RIAをGoogleクラウドコンピューティングプラットフォームに配置する。</p>
<p>以下はPyAMFの使用方法を簡単で紹介します。</p>
<p><strong>・PyAMFのインストール</strong></p>
<p>easy_installで、もしくはできなければダウンロードしてきてsetup.py installでもいい</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">easy_install pyamf</span></li></ol></div>
<p><strong>・AMFの配備</strong></p>
<p>デフォルトのまま利用する場合は8000のportはあけておく必要があります。</p>
<p>以下のコマンドでserver.xmlを起動します。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">python server.py</span></li></ol></div>
<p>正常だったら、http://IPアドレス:8000/にAMFでアクセスすることが可能になります。</p>
<p><strong>・クライアントからの接続確認</strong></p>
<p>FlashDevelopを使って、簡単にRemoteObjectで接続してみて、<a title="http://pyamf.org/wiki/HelloWorld/Flex" href="http://pyamf.org/wiki/HelloWorld/Flex">http://pyamf.org/wiki/HelloWorld/Flex</a> のサンプルに従って「Hello World」のサンプルを作れます。どう？簡単でしょう？ <img src='http://digitechlog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>【関連リンク】</strong></p>
<p><a title="http://pyamf.org/" href="http://pyamf.org/">http://pyamf.org/</a> 公式サイト</p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://digitechlog.com/2009/02/22/s2x-is-a-python-script-that-allows-the-sol-file-format-represented-as-xml.html" title="s2x: Flashのcookieファイル(*.sol)とXMLフォーマットの互换用Pythonスクリプトソース">s2x: Flashのcookieファイル(*.sol)とXMLフォーマットの互换用Pythonスクリプトソース</a></li>
<li><a href="http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html" title="リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した">リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した</a></li>
<li><a href="http://digitechlog.com/2011/11/03/python-crawler%ef%bc%9apython%e3%81%ae%e3%82%af%e3%83%ad%e3%83%bc%e3%83%a9%e3%83%bc%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa.html" title="python-crawler：Pythonのクローラーライブラリ">python-crawler：Pythonのクローラーライブラリ</a></li>
<li><a href="http://digitechlog.com/2010/06/06/8-helpfull-adobe-flash-actionscript.html" title="8 Adobe ActionScriptのチュートリアルフラッシュ">8 Adobe ActionScriptのチュートリアルフラッシュ</a></li>
<li><a href="http://digitechlog.com/2009/12/01/gplflash-another-alternative-flash-runtime.html" title="GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう">GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう</a></li>
<li><a href="http://digitechlog.com/2009/11/02/collection-of-15-beautiful-adobe-photoshop-psd-files-for-car.html" title="15+綺麗な車に関するアドビPhotoShopの.PSDファイル">15+綺麗な車に関するアドビPhotoShopの.PSDファイル</a></li>
<li><a href="http://digitechlog.com/2009/10/31/5-useful-aadobe-flash-menu-and-navigation-tutorials.html" title="5個アドビFlashメニューとナビゲーションのチュートリアル">5個アドビFlashメニューとナビゲーションのチュートリアル</a></li>
<li><a href="http://digitechlog.com/2009/07/25/top-7-adobe-air-apps-for-videos-you-should-know.html" title="トップ７個アドビAIRビデオアプリケーション">トップ７個アドビAIRビデオアプリケーション</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AnimationPackage: Flash Player 6以降サポートされてるActionScriptライブラリ</title>
		<link>http://digitechlog.com/2009/04/08/animationpackage-an-actionscript-library-compatible-to-flash-player-6-and-above.html</link>
		<comments>http://digitechlog.com/2009/04/08/animationpackage-an-actionscript-library-compatible-to-flash-player-6-and-above.html#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:02:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash Project]]></category>
		<category><![CDATA[AnimationPackage]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[ライブラリ]]></category>

		<guid isPermaLink="false">http://digitechlog.com/2009/04/08/animationpackage-an-actionscript-library-compatible-to-flash-player-6-and-above.html</guid>
		<description><![CDATA[AnimationPackageというものは、Flash Player 6以降サポートされてるオープンソースのActionScriptライブラリです。AnimationPackageを使うとントロールポイントとか曲線のパスとかの計算は簡単となれます。以下は公式サイトにAnimationPackageについて紹介；　&#8221;AnimationPackage is an ActionScript library compatible to Flash Player 6 and above. It helps you to create powerful, maintainable animations and primitive shapes in an efficient and easy way, resulting in small file sizes.&#8221;。

現時点までAnimationPackageは三つのバージョンがあります。ActionScript 2とFlash Player 6以降対応しているAnimationPackage 1、ActionScript 2とFlash Player 8以降対応しているAnimationPackage 2とActionScript 3とFlash Player 8以降対応しているAnimationPackage 3のです。
以下ではAnimationPackageの使い方です。

まずダウンロードは次のURLからできます。ヴァージョンは2.00です。僕が上記のサンプルで使っているものと同じものをご紹介させていただきます。
http://www.alex-uhlmann.de/flash/animationpackage/ap2/download.htm
AnimationPackage_v2_00.zipというファイルのダウンロードが終わったら、解凍し2_00というフォルダ内にdeというフォルダがあると思います。これがAnimationPackageの核です。
それではインポートしていきましょう。
flaファイルを開いて、フレームに
import de.alex_uhlmann.animationpackage.*;import de.alex_uhlmann.animationpackage.animation.*;import de.alex_uhlmann.animationpackage.drawing.*;import de.alex_uhlmann.animationpackage.utility.*;
と書いてください。これで全ての機能がflashにインポートされます。さらに、AnimationPackageを使うには初期化も必要なので、
APCore.initialize();
この一行もお忘れなくつけてください。
これで使用する準備はできました。
次に紹介するのは基本的なアニメーションの作り方です。すごい簡単に書くとこんな感じです。
var myMOC:MoveOnCurve = new [...]]]></description>
			<content:encoded><![CDATA[<p>AnimationPackageというものは、Flash Player 6以降サポートされてるオープンソースのActionScriptライブラリです。AnimationPackageを使うとントロールポイントとか曲線のパスとかの計算は簡単となれます。以下は公式サイトにAnimationPackageについて紹介；　&#8221;AnimationPackage is an ActionScript library compatible to Flash Player 6 and above. It helps you to create powerful, maintainable animations and primitive shapes in an efficient and easy way, resulting in small file sizes.&#8221;。</p>
<p><span id="more-380"></span>
<p>現時点までAnimationPackageは三つのバージョンがあります。ActionScript 2とFlash Player 6以降対応しているAnimationPackage 1、ActionScript 2とFlash Player 8以降対応しているAnimationPackage 2とActionScript 3とFlash Player 8以降対応しているAnimationPackage 3のです。</p>
<p>以下ではAnimationPackageの使い方です。<br />
<blockquote>
<p>まずダウンロードは次のURLからできます。ヴァージョンは2.00です。僕が上記のサンプルで使っているものと同じものをご紹介させていただきます。
<p><a href="http://www.alex-uhlmann.de/flash/animationpackage/ap2/download.htm">http://www.alex-uhlmann.de/flash/animationpackage/ap2/download.htm</a>
<p>AnimationPackage_v2_00.zipというファイルのダウンロードが終わったら、解凍し2_00というフォルダ内にdeというフォルダがあると思います。これがAnimationPackageの核です。
<p>それではインポートしていきましょう。
<p>flaファイルを開いて、フレームに
<p>import de.alex_uhlmann.animationpackage.*;<br />import de.alex_uhlmann.animationpackage.animation.*;<br />import de.alex_uhlmann.animationpackage.drawing.*;<br />import de.alex_uhlmann.animationpackage.utility.*;
<p>と書いてください。これで全ての機能がflashにインポートされます。さらに、AnimationPackageを使うには初期化も必要なので、
<p>APCore.initialize();
<p>この一行もお忘れなくつけてください。
<p>これで使用する準備はできました。
<p>次に紹介するのは基本的なアニメーションの作り方です。すごい簡単に書くとこんな感じです。
<p>var myMOC:MoveOnCurve = new MoveOnCurve(mc,pathArray);<br />myMOC.animationStyle(1000,Circ.easeInOut);<br />myMOC.animate(0,100);
<p>それでは解説します。
<p>var myMOC:MoveOnCurve = new MoveOnCurve(mc,pathArray);
<p>では、myMOCというインスタンスを作っています。その際、
<p>第一引数に動かしたいMovieClipを指定、第二引数にMovieClipが沿って動いて欲しいパスを入れた配列を指定しています。
<p>pathArrayの中身はこんな感じです。
<p>pathArray[{x:0, y:0}];
<p>pathArray[{x:100, y:200}];
<p>pathArray[{x:350, y:350}];
<p>これでMCという名前のMovieClipがこの指定したポイントに沿って動けと指定しました。
<p>次のmyMOC.animationStyle(1000,Circ.easeInOut);は秒数とアニメーションの指定です。秒数はミリ秒で指定してください。
<p>最後にmyMOC.animate(0,100);です。
<p>これは指定したパスの何パーセント（第一引数）から何パーセント部分（第二引数）を動けという指定です。通常はまぁ0~100ですよね。</p>
</blockquote>
<p><strong>関連リンク</strong></p>
<p>公式サイト <a title="http://www.alex-uhlmann.de/flash/animationpackage/" href="http://www.alex-uhlmann.de/flash/animationpackage/">http://www.alex-uhlmann.de/flash/animationpackage/</a></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://digitechlog.com/2010/03/12/7-asynchronous-processing-open-source-actionscript-library.html" title="７+ AS3で非同期処理のオープンソースのライブラリ一覧">７+ AS3で非同期処理のオープンソースのライブラリ一覧</a></li>
<li><a href="http://digitechlog.com/2009/05/11/tweener-is-a-class-used-to-create-tweenings-via-actionscript-code-on-flash-platform.html" title="Tweener: 画像を簡単に演出をつけるActionScriptのアニメーション用オープンソースのライブラリ">Tweener: 画像を簡単に演出をつけるActionScriptのアニメーション用オープンソースのライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/05/02/casa-lib-is-a-flexible-actionscript-library-designed-to-streamline-common-chores-and-act-as-a-solid.html" title="CASA Lib: 柔軟なActionScript共通基盤としてオープンソースのライブラリ">CASA Lib: 柔軟なActionScript共通基盤としてオープンソースのライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/04/13/as3mathlib-provide-rudimentary-numerical-analysis-toolkit-for-actionscript-flex.html" title="as3mathlib: ActionScript3の各種数学演算のルーチン集">as3mathlib: ActionScript3の各種数学演算のルーチン集</a></li>
<li><a href="http://digitechlog.com/2009/04/10/as3cannonball-dom-html-css-browser-library-for-actionscript-3.html" title="as3cannonball: DOM+HTML+CSS+BrowserのActionScript 3ライブラリ">as3cannonball: DOM+HTML+CSS+BrowserのActionScript 3ライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/04/09/as3-crypto-a-cryptography-library-written-in-actionscript-3-provides-several-common-algorithms.html" title="as3crypto: MD5やSHA、Base64機能を提供するActionScript3用暗号＆ハッシュ化オーポンソースのライブラリ">as3crypto: MD5やSHA、Base64機能を提供するActionScript3用暗号＆ハッシュ化オーポンソースのライブラリ</a></li>
<li><a href="http://digitechlog.com/2011/02/27/as3%e3%81%aetween%e7%b3%bb%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa%e3%80%8ctweenlite%e3%80%8d%e3%81%ae%e7%b4%b9%e4%bb%8b%e3%81%ae%e7%ba%8f%e3%82%81.html" title="AS3のTween系ライブラリ「TweenLite」の紹介の纏め">AS3のTween系ライブラリ「TweenLite」の紹介の纏め</a></li>
<li><a href="http://digitechlog.com/2010/06/06/8-helpfull-adobe-flash-actionscript.html" title="8 Adobe ActionScriptのチュートリアルフラッシュ">8 Adobe ActionScriptのチュートリアルフラッシュ</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitechlog.com/2009/04/08/animationpackage-an-actionscript-library-compatible-to-flash-player-6-and-above.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>s2x: Flashのcookieファイル(*.sol)とXMLフォーマットの互换用Pythonスクリプトソース</title>
		<link>http://digitechlog.com/2009/02/22/s2x-is-a-python-script-that-allows-the-sol-file-format-represented-as-xml.html</link>
		<comments>http://digitechlog.com/2009/02/22/s2x-is-a-python-script-that-allows-the-sol-file-format-represented-as-xml.html#comments</comments>
		<pubDate>Sun, 22 Feb 2009 12:04:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Project]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[s2x]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[スクリプト]]></category>

		<guid isPermaLink="false">http://digitechlog.com/2009/02/22/s2x-is-a-python-script-that-allows-the-sol-file-format-represented-as-xml.html</guid>
		<description><![CDATA[すみませんけど、「古い」の話だかも＾＾）、WINDOWSシステムに、「Application Data」→「Macromedia」（現在はAdobe）→「Flash Player」の配下の何にかフォルダの下には、「.sol」ファイルというのがある可能性があります。これって一体何ですか？
SOLファイルというのは、Flashのcookieファイルです。「Flash Player が利異様するクッキー（.solファイル）には、システムファイルの場所を推定できるような情報が含まれている。一方、リモートからその場所にファイルを保存させることができるので、クッキーにスクリプトを含ませておけばローカルのスクリプトとしてブラウザから実行させることができてしまう。ただし、そのためには攻撃者がローカルのユーザ名を知っている必要がある。」という弱点があります（現在のバージョンはその問題がなくなるね）。
 
以前、solファイルの内容を見に安いXMLに変換するため「s2x」というPythonスクリプトがあります。持っているリリースされた公式サイトには、すでにアクセスできないようです。そのスクリプト、現在のFlash Player環境などでは、すでに意味がないと思いますが、開発者に対しては、いい資料だと思います。
※XMLとは、文書やデータの意味や構造を記述するためのマークアップ言語の一つ。マークアップ言語とは、「タグ」と呼ばれる特定の文字列で地の文に構造を埋め込んでいく言語のことで、XMLはユーザが独自のタグを指定できることから、マークアップ言語を作成するためのメタ言語とも言われる。
ソースは以下のようです。
import sys
from&#160;struct import *
from&#160;xml.dom import minidom
#s2x Runtime Error Class Definition:
class&#160;s2xErr(Exception):
&#160; &#160; def&#160;__init__(self,msg):
&#160; &#160; &#160; &#160; self.msg=msg
#constants start:
#------------------------------------------------------------#
NUMBER='\x00'
BOOLEAN='\x01'
STRING='\x02'
OBJOBJ='\x03'
NULL='\x05'
UNDEF='\x06'
OBJARR='\x08'
#RAWARR='\x0A'
OBJDATE='\x0B'
OBJM='\x0D'
OBJXML='\x0F'
OBJCC='\x10'
#constants end.
#------------------------------------------------------------#
argv=sys.argv
if&#160;len(argv)&#60;3:
&#160; &#160; print&#160;'s2x v 0.75 by iceeLyne, Dec., 2003.'
&#160; &#160; print&#160;'usage:'
&#160; &#160; print&#160;'python s2x.py -x foo.sol [foo.xml]'
&#160; &#160; print&#160;'python s2x.py -s foo.xml [foo.sol]'
else:
&#160; &#160; argvSw=argv[1]
&#160; &#160; argvInpFile=argv[2]
&#160; &#160; if&#160;len(argv)&#62;3:
&#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>すみませんけど、「古い」の話だかも＾＾）、WINDOWSシステムに、「Application Data」→「Macromedia」（現在はAdobe）→「Flash Player」の配下の何にかフォルダの下には、「.sol」ファイルというのがある可能性があります。これって一体何ですか？</p>
<p>SOLファイルというのは、Flashのcookieファイルです。「Flash Player が利異様するクッキー（.solファイル）には、システムファイルの場所を推定できるような情報が含まれている。一方、リモートからその場所にファイルを保存させることができるので、クッキーにスクリプトを含ませておけばローカルのスクリプトとしてブラウザから実行させることができてしまう。ただし、そのためには攻撃者がローカルのユーザ名を知っている必要がある。」という弱点があります（現在のバージョンはその問題がなくなるね）。</p>
<p><span id="more-327"></span> </p>
<p>以前、solファイルの内容を見に安いXMLに変換するため「s2x」というPythonスクリプトがあります。持っているリリースされた公式サイトには、すでにアクセスできないようです。そのスクリプト、現在のFlash Player環境などでは、すでに意味がないと思いますが、開発者に対しては、いい資料だと思います。</p>
<p>※XMLとは、文書やデータの意味や構造を記述するためのマークアップ言語の一つ。マークアップ言語とは、「タグ」と呼ばれる特定の文字列で地の文に構造を埋め込んでいく言語のことで、XMLはユーザが独自のタグを指定できることから、マークアップ言語を作成するためのメタ言語とも言われる。</p>
<p>ソースは以下のようです。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">import</span><span style="color: Gray;"> </span><span style="color: Blue;">sys</span></li>
<li><span style="color: Green;">from</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">struct</span><span style="color: Gray;"> </span><span style="color: Green;">import</span><span style="color: Gray;"> *</span></li>
<li><span style="color: Green;">from</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">xml</span><span style="color: Gray;">.</span><span style="color: Blue;">dom</span><span style="color: Gray;"> </span><span style="color: Green;">import</span><span style="color: Gray;"> </span><span style="color: Blue;">minidom</span></li>
<li><span style="color: #ffa500;">#s2x Runtime Error Class Definition:</span></li>
<li><span style="color: Green;">class</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: Green;">Exception</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">__init__</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">,</span><span style="color: Blue;">msg</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">msg</span><span style="color: Gray;">=</span><span style="color: Blue;">msg</span></li>
<li><span style="color: #ffa500;">#constants start:</span></li>
<li><span style="color: #ffa500;">#------------------------------------------------------------#</span></li>
<li><span style="color: Blue;">NUMBER</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">BOOLEAN</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">01</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">STRING</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">02</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">OBJOBJ</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">03</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">NULL</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">05</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">UNDEF</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">06</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">OBJARR</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">08</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: #ffa500;">#RAWARR='\x0A'</span></li>
<li><span style="color: Blue;">OBJDATE</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">0B</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">OBJM</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">0D</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">OBJXML</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">0F</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Blue;">OBJCC</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">10</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: #ffa500;">#constants end.</span></li>
<li><span style="color: #ffa500;">#------------------------------------------------------------#</span></li>
<li><span style="color: Blue;">argv</span><span style="color: Gray;">=</span><span style="color: Blue;">sys</span><span style="color: Gray;">.</span><span style="color: Blue;">argv</span></li>
<li><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">argv</span><span style="color: Olive;">)</span><span style="color: Gray;">&lt;</span><span style="color: Maroon;">3</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">s2x v 0.75 by iceeLyne, Dec., 2003.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">usage:</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">python s2x.py -x foo.sol [foo.xml]</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">python s2x.py -s foo.xml [foo.sol]</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">argvSw</span><span style="color: Gray;">=</span><span style="color: Blue;">argv</span><span style="color: Olive;">[</span><span style="color: Maroon;">1</span><span style="color: Olive;">]</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">argvInpFile</span><span style="color: Gray;">=</span><span style="color: Blue;">argv</span><span style="color: Olive;">[</span><span style="color: Maroon;">2</span><span style="color: Olive;">]</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">argv</span><span style="color: Olive;">)</span><span style="color: Gray;">&gt;</span><span style="color: Maroon;">3</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">=</span><span style="color: Blue;">argv</span><span style="color: Olive;">[</span><span style="color: Maroon;">3</span><span style="color: Olive;">]</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">=</span><span style="color: #8b0000;">''</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">argvSw</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">-x</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;"># parse sol to xml</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">try</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">=</span><span style="color: Teal;">open</span><span style="color: Olive;">(</span><span style="color: Blue;">argvInpFile</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">rb</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">IOError</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Could Not Open The Input File: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">argvInpFile</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">num2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">s</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">8</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">7F</span><span style="color: Navy;">\x</span><span style="color: Red;">F0</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">Infinity</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">FF</span><span style="color: Navy;">\x</span><span style="color: Red;">F0</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">-Infinity</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">7F</span><span style="color: Navy;">\x</span><span style="color: Red;">F8</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">NaN</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nValue</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;d</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">s</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#Double,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: Teal;">str</span><span style="color: Olive;">(</span><span style="color: Blue;">nValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">number</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">value</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">bol2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">b</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">b</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">false</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">b</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">true</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Warning: Boolean Value Error.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">true</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">boolean</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">value</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">str2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenStr</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">s</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenStr</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">s</span><span style="color: Gray;">=</span><span style="color: Blue;">s</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">string</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createCDATASection</span><span style="color: Olive;">(</span><span style="color: Blue;">s</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">obj2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: #ffa500;">#is necessary</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">object</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">lastChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">!=</span><span style="color: Maroon;">0</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NUMBER</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">num2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">BOOLEAN</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">bol2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">STRING</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">str2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJARR</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">arr2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJOBJ</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">obj2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJDATE</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">dat2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJXML</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">xml2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJCC</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">occ2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJM</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">ojm2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NULL</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nul2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">UNDEF</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">und2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Teal;">hex</span><span style="color: Olive;">(</span><span style="color: Teal;">ord</span><span style="color: Olive;">(</span><span style="color: Blue;">type</span><span style="color: Olive;">)))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">objend</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#=='\x09'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">parentNode</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">arr2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: #ffa500;">#is necessary</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nArrLength</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">4</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Long,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">array</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">length</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Teal;">str</span><span style="color: Olive;">(</span><span style="color: Blue;">nArrLength</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">lastChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">!=</span><span style="color: Maroon;">0</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NUMBER</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">num2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">BOOLEAN</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">bol2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">STRING</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">str2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJOBJ</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">obj2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJARR</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">arr2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJDATE</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">dat2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJXML</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">xml2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJCC</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">occ2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJM</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">ojm2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NULL</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nul2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">UNDEF</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">und2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Teal;">hex</span><span style="color: Olive;">(</span><span style="color: Teal;">ord</span><span style="color: Olive;">(</span><span style="color: Blue;">type</span><span style="color: Olive;">)))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">objend</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#=='\x09'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">parentNode</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">dat2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nMsec</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;d</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">8</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Double,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nMinOffset</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;h</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nOffset</span><span style="color: Gray;">=</span><span style="color: Blue;">nMinOffset</span><span style="color: Gray;">/</span><span style="color: Maroon;">60</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createComment</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">DateObject:Milliseconds Count From Dec. 1, 1969; Timezone UTC + Offset.</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">date</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">msec</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Teal;">str</span><span style="color: Olive;">(</span><span style="color: Blue;">nMsec</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utcoffset</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Teal;">str</span><span style="color: Olive;">(</span><span style="color: Gray;">-</span><span style="color: Blue;">nOffset</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">xml2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenCData</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">4</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Long,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenCData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">sCData</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">xml</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createCDATASection</span><span style="color: Olive;">(</span><span style="color: Blue;">sCData</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">occ2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: #ffa500;">#is necessary</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenCname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenCname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCname</span><span style="color: Gray;">=</span><span style="color: Blue;">sCname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">c_object</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">class_name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sCname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">lastChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">!=</span><span style="color: Maroon;">0</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NUMBER</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">num2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">BOOLEAN</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">bol2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">STRING</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">str2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJARR</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">arr2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJOBJ</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">obj2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJDATE</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">dat2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJXML</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">xml2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJCC</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">occ2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJM</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">ojm2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NULL</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nul2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">UNDEF</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">und2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Teal;">hex</span><span style="color: Olive;">(</span><span style="color: Teal;">ord</span><span style="color: Olive;">(</span><span style="color: Blue;">type</span><span style="color: Olive;">)))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">objend</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#=='\x09'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">parentNode</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">ojm2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">m_object</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">nul2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">null</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">und2x</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cparent</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">cparent</span><span style="color: Gray;">.</span><span style="color: Blue;">appendChild</span><span style="color: Olive;">(</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">data</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">undefined</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">d</span><span style="color: Gray;">=</span><span style="color: Blue;">minidom</span><span style="color: Gray;">.</span><span style="color: Blue;">parseString</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;solx/&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">try</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">seek</span><span style="color: Olive;">(</span><span style="color: Maroon;">0</span><span style="color: Gray;">,</span><span style="color: Maroon;">2</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenFile</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">tell</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">seek</span><span style="color: Olive;">(</span><span style="color: Maroon;">0</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sHeader</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenData</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">4</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenData</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenData</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#Unsigned Long,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">nLenFile</span><span style="color: Gray;">!=</span><span style="color: Blue;">nLenData</span><span style="color: Gray;">+</span><span style="color: Maroon;">6</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Warning: Data Length Mismatch.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sFileType</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">4</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#=='TCSO'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sth1</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">6</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenSoln</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenSoln</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solname</span><span style="color: Gray;">=</span><span style="color: Blue;">solname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sth2</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">4</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solxroot</span><span style="color: Gray;">=</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">std_version</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">0.75</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">std_author</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">iceeLyne</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">sol_name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">solname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">cparent</span><span style="color: Gray;">=</span><span style="color: Blue;">solxroot</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">tell</span><span style="color: Olive;">()</span><span style="color: Gray;">&lt;</span><span style="color: Blue;">nLenFile</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">,=</span><span style="color: Blue;">unpack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">2</span><span style="color: Olive;">))</span><span style="color: #ffa500;">#Unsigned Short,Big-endian</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NUMBER</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">num2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">BOOLEAN</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">bol2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">STRING</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">str2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJOBJ</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">obj2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJARR</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">arr2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJDATE</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">dat2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJXML</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">xml2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJCC</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">occ2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">OBJM</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">ojm2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">NULL</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nul2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: Blue;">UNDEF</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">und2x</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Teal;">hex</span><span style="color: Olive;">(</span><span style="color: Teal;">ord</span><span style="color: Olive;">(</span><span style="color: Blue;">type</span><span style="color: Olive;">)))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">end</span><span style="color: Gray;">=</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#=='\x00'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sxmloutput</span><span style="color: Gray;">=</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">toprettyxml</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\t</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\n</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">==</span><span style="color: #8b0000;">''</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">=</span><span style="color: Blue;">argvInpFile</span><span style="color: Olive;">[</span><span style="color: Gray;">:</span><span style="color: Blue;">argvInpFile</span><span style="color: Gray;">.</span><span style="color: Blue;">rfind</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">.xml</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">foutput</span><span style="color: Gray;">=</span><span style="color: Teal;">open</span><span style="color: Olive;">(</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">w</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">foutput</span><span style="color: Gray;">.</span><span style="color: Blue;">write</span><span style="color: Olive;">(</span><span style="color: Blue;">sxmloutput</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">foutput</span><span style="color: Gray;">.</span><span style="color: Blue;">close</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Converted File: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;"> Was Successfully Created.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Gray;">,</span><span style="color: Blue;">e</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">e</span><span style="color: Gray;">.</span><span style="color: Blue;">msg</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Error.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">unlink</span><span style="color: Olive;">()</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">close</span><span style="color: Olive;">()</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">argvSw</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">-s</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;"># parse xml to sol</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">try</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">d</span><span style="color: Gray;">=</span><span style="color: Blue;">minidom</span><span style="color: Gray;">.</span><span style="color: Blue;">parse</span><span style="color: Olive;">(</span><span style="color: Blue;">argvInpFile</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">IOError</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Could Not Open The Input File: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">argvInpFile</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Error At Parsing XML File Input.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2num</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">NUMBER</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">value</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sValue</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">Infinity</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">7F</span><span style="color: Navy;">\x</span><span style="color: Red;">F0</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sValue</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">-Infinity</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">FF</span><span style="color: Navy;">\x</span><span style="color: Red;">F0</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sValue</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">NaN</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">7F</span><span style="color: Navy;">\x</span><span style="color: Red;">F8</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nValue</span><span style="color: Gray;">=</span><span style="color: Teal;">float</span><span style="color: Olive;">(</span><span style="color: Blue;">sValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;d</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2bol</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">BOOLEAN</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sValue</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">value</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sValue</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">true</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">01</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sValue</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">false</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Boolean Value: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">sValue</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2str</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">STRING</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: #8b0000;">''</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">for</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cData</span><span style="color: Gray;"> </span><span style="color: Green;">in</span><span style="color: Gray;"> </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">childNodes</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cData</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">4</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#CDATA_SECTION_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">cData</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeValue</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">break</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">sCData</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenCData</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sCData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenCData</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenCData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenCData</span><span style="color: Gray;">+</span><span style="color: Blue;">sCData</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2obj</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJOBJ</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">temp</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">1</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#ELEMENT_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">number</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2num</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">boolean</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2bol</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">string</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2str</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2obj</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">array</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2arr</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">date</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2dat</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">xml</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2xml</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">c_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2occ</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">m_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2ojm</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">null</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2nul</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">undefined</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2und</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">type</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nextSibling</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">09</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">temp</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2arr</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJARR</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nArrLength</span><span style="color: Gray;">=</span><span style="color: Teal;">float</span><span style="color: Olive;">(</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">length</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sArrLength</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nArrLength</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sArrLength</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">temp</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">1</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#ELEMENT_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">number</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2num</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">boolean</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2bol</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">string</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2str</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2obj</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">array</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2arr</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">date</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2dat</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">xml</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2xml</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">c_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2occ</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">m_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2ojm</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">null</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2nul</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">undefined</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2und</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">type</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nextSibling</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">09</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">temp</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2dat</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJDATE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nMsec</span><span style="color: Gray;">=</span><span style="color: Teal;">float</span><span style="color: Olive;">(</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">msec</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nMinOffset</span><span style="color: Gray;">=-</span><span style="color: Maroon;">60</span><span style="color: Gray;">*</span><span style="color: Teal;">int</span><span style="color: Olive;">(</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utcoffset</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;dh</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nMsec</span><span style="color: Gray;">,</span><span style="color: Blue;">nMinOffset</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2xml</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJXML</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: #8b0000;">''</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">for</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cData</span><span style="color: Gray;"> </span><span style="color: Green;">in</span><span style="color: Gray;"> </span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">childNodes</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">cData</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">4</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#CDATA_SECTION_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">cData</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeValue</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">break</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCData</span><span style="color: Gray;">=</span><span style="color: Blue;">sCData</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenCData</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sCData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenCData</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenCData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenCData</span><span style="color: Gray;">+</span><span style="color: Blue;">sCData</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2occ</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJCC</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCname</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">class_name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sCname</span><span style="color: Gray;">=</span><span style="color: Blue;">sCname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenCname</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sCname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenCname</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenCname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenCname</span><span style="color: Gray;">+</span><span style="color: Blue;">sCname</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">temp</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">1</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#ELEMENT_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">number</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2num</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">boolean</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2bol</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">string</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2str</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2obj</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">array</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2arr</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">date</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2dat</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">xml</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2xml</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">c_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2occ</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">m_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2ojm</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">null</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2nul</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">undefined</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2und</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">type</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nextSibling</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">09</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">temp</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2ojm</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">OBJM</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2nul</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">NULL</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">x2und</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">sData</span><span style="color: Gray;">,</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">,</span><span style="color: Blue;">sVname</span><span style="color: Gray;">,</span><span style="color: Blue;">c</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">+</span><span style="color: Blue;">sVname</span><span style="color: Gray;">+</span><span style="color: Blue;">UNDEF</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">try</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solxroot</span><span style="color: Gray;">=</span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">tagName</span><span style="color: Gray;">!=</span><span style="color: #8b0000;">'</span><span style="color: Red;">solx</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">or</span><span style="color: Gray;"> </span><span style="color: Teal;">float</span><span style="color: Olive;">(</span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">std_version</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;">&gt;</span><span style="color: Maroon;">0.75</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Not Solx File Or Incorrect File Version.</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sHeader</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">BF</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenData</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sFileType</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">TCSO</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sth1</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">04</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solname</span><span style="color: Gray;">=</span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">sol_name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">solname</span><span style="color: Gray;">=</span><span style="color: Blue;">solname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenSoln</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">solname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenSoln</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenSoln</span><span style="color: Olive;">)</span><span style="color: #ffa500;">#2 bytes</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sth2</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">=</span><span style="color: Blue;">sFileType</span><span style="color: Gray;">+</span><span style="color: Blue;">sth1</span><span style="color: Gray;">+</span><span style="color: Blue;">sLenSoln</span><span style="color: Gray;">+</span><span style="color: Blue;">solname</span><span style="color: Gray;">+</span><span style="color: Blue;">sth2</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">solxroot</span><span style="color: Gray;">.</span><span style="color: Blue;">firstChild</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nodeType</span><span style="color: Gray;">==</span><span style="color: Maroon;">1</span><span style="color: Gray;">:</span><span style="color: #ffa500;">#ELEMENT_NODE</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sVname</span><span style="color: Gray;">=</span><span style="color: Blue;">sVname</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">nLenVname</span><span style="color: Gray;">=</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenVname</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;H</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">nLenVname</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">getAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">number</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2num</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">boolean</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2bol</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">string</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2str</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2obj</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">array</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2arr</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">date</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2dat</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">xml</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2xml</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">c_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2occ</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">m_object</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2ojm</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">null</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2nul</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">elif</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">type</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">undefined</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">x2und</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">raise</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Unexpected Data Type: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">type</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sData</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Navy;">\x</span><span style="color: Red;">00</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">c</span><span style="color: Gray;">=</span><span style="color: Blue;">c</span><span style="color: Gray;">.</span><span style="color: Blue;">nextSibling</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">==</span><span style="color: #8b0000;">''</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">=</span><span style="color: Blue;">argvInpFile</span><span style="color: Olive;">[</span><span style="color: Gray;">:</span><span style="color: Blue;">argvInpFile</span><span style="color: Gray;">.</span><span style="color: Blue;">rfind</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">.</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">.sol</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">=</span><span style="color: Teal;">open</span><span style="color: Olive;">(</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">wb</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">sLenData</span><span style="color: Gray;">=</span><span style="color: Blue;">pack</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&gt;L</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">sData</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">write</span><span style="color: Olive;">(</span><span style="color: Blue;">sHeader</span><span style="color: Gray;">+</span><span style="color: Blue;">sLenData</span><span style="color: Gray;">+</span><span style="color: Blue;">sData</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Blue;">close</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Converted File: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">argvOutFile</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;"> Was Successfully Created.</span><span style="color: #8b0000;">'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">except</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">s2xErr</span><span style="color: Gray;">,</span><span style="color: Blue;">e</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">e</span><span style="color: Gray;">.</span><span style="color: Blue;">msg</span></li>
<li><span style="color: #ffa500;">##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except:</span></li>
<li><span style="color: #ffa500;">##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print 'Unexpected Error.'</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">d</span><span style="color: Gray;">.</span><span style="color: Blue;">unlink</span><span style="color: Olive;">()</span><span style="color: Gray;">#</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">Invalid Switch: </span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">argvSw</span></li></ol></div>
<p><strong>リソース</strong><br />
・<a title="http://osflash.org/s2x" href="http://osflash.org/s2x">http://osflash.org/s2x</a>　そこだけs2xに関して資料はまだ残してるようです。。。<br />
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html" title="PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する">PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する</a></li>
<li><a href="http://digitechlog.com/2011/11/03/python-crawler%ef%bc%9apython%e3%81%ae%e3%82%af%e3%83%ad%e3%83%bc%e3%83%a9%e3%83%bc%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa.html" title="python-crawler：Pythonのクローラーライブラリ">python-crawler：Pythonのクローラーライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/05/12/how-to-use-json-to-exchange-data-in-flex-flash.html" title="JSON(json.as)でFlex／Flashアプリケーションにデータを交換する">JSON(json.as)でFlex／Flashアプリケーションにデータを交換する</a></li>
<li><a href="http://digitechlog.com/2009/04/08/animationpackage-an-actionscript-library-compatible-to-flash-player-6-and-above.html" title="AnimationPackage: Flash Player 6以降サポートされてるActionScriptライブラリ">AnimationPackage: Flash Player 6以降サポートされてるActionScriptライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/02/25/4-ways-to-read-and-write-xml.html" title="JavaでXMLを操作の４種類方法とサンプルソース">JavaでXMLを操作の４種類方法とサンプルソース</a></li>
<li><a href="http://digitechlog.com/2009/02/11/javaswf2-provides-parsing-and-generating-facilities-for-flash-4-and-flash-5-content.html" title="JavaSWF2: JavaによるFlash解析、生成ライブラリ">JavaSWF2: JavaによるFlash解析、生成ライブラリ</a></li>
<li><a href="http://digitechlog.com/2009/02/01/swfmill-is-an-xml2swf-and-swf2xml-processor-with-import-functionalities.html" title="swfmill: swfファイルとXMLファイルを相互変換するオープンソースツール">swfmill: swfファイルとXMLファイルを相互変換するオープンソースツール</a></li>
<li><a href="http://digitechlog.com/2009/01/15/how-to-parse-xml-in-jquery-with-sample-source-code.html" title="jQueryを使ってXMLを解析操作する（サンプルソースコード含める）">jQueryを使ってXMLを解析操作する（サンプルソースコード含める）</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitechlog.com/2009/02/22/s2x-is-a-python-script-that-allows-the-sol-file-format-represented-as-xml.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した</title>
		<link>http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html</link>
		<comments>http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html#comments</comments>
		<pubDate>Sat, 20 Dec 2008 04:22:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ニュース]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html</guid>
		<description><![CDATA[「古い」のニュースだと思いますが、イベントのメモとして記録します。
リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版、米アドビ システムズは12月18日(米国時間)に正式で公開しました。ダウンロードパッケージはFedora 8、Ubuntu 7.10、openSUSE 10.3に対応していて（統合デスクトップ環境はGNOMEとKDEに対応する）、AdobeはこれまでにWindows版とMac OS X版を提供しています。

Adobe AIRというのは、Adobe AIRが使ったGoogle関係製品のリストにGoogleの関係製品を紹介するとき説明するような、AIRは「Adobe Flash Platform」の中核コンポーネントで，HTML，JavaScript，Flash（ActionScript）などのWeb関連技術をベースとしたアプリケーション実行環境。Webブラウザを使わずに操作性の高いWebアプリケーションを動作できる。AIR対応のアプリケーションの開発には，「Flex 3 SDK」や「Flex Builer 3」などを利用する。
Linux版Adobe AIR 1.5は、Flash Player 10の新機能を統合。Pixel Benderを利用したカスタムフィルタ / エフェクトが可能になったほか、新しいテキストエンジンの採用によりレイアウト機能が向上している。WebKitプロジェクトで開発された JavaScriptエンジン「SquirrelFish」の採用により、JavaScript / Ajaxを使用したWebアプリの処理速度も大幅に向上している。
Adobe AIR 1.5のリリースにあわせ、開発環境のAdobe AIR 1.5 SDKのLinux版も公開されている。動作にはSun Java/JRE 1.4.2以降が必要。
同社のWebサイトから無償でダウンロードできます：
http://get.adobe.com/air/
Related Posts

GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう
PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する
トップ７個アドビAIRビデオアプリケーション
SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション
Adobe AIRアプリケーションのインストールパスにファイルURIを取得するサンプルソースコード
Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード
Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト
Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト

]]></description>
			<content:encoded><![CDATA[<p>「古い」のニュースだと思いますが、イベントのメモとして記録します。</p>
<p>リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版、米アドビ システムズは12月18日(米国時間)に正式で公開しました。ダウンロードパッケージはFedora 8、Ubuntu 7.10、openSUSE 10.3に対応していて（統合デスクトップ環境はGNOMEとKDEに対応する）、AdobeはこれまでにWindows版とMac OS X版を提供しています。</p>
<p><span id="more-210"></span>
<p>Adobe AIRというのは、<a href="http://digitechlog.com/2008/10/29/the-list-of-google-pruduct-in-adobe-air.html">Adobe AIRが使ったGoogle関係製品のリスト</a>にGoogleの関係製品を紹介するとき説明するような、AIRは「Adobe Flash Platform」の中核コンポーネントで，HTML，JavaScript，Flash（ActionScript）などのWeb関連技術をベースとしたアプリケーション実行環境。Webブラウザを使わずに操作性の高いWebアプリケーションを動作できる。AIR対応のアプリケーションの開発には，「Flex 3 SDK」や「Flex Builer 3」などを利用する。</p>
<p>Linux版Adobe AIR 1.5は、Flash Player 10の新機能を統合。Pixel Benderを利用したカスタムフィルタ / エフェクトが可能になったほか、新しいテキストエンジンの採用によりレイアウト機能が向上している。WebKitプロジェクトで開発された JavaScriptエンジン「SquirrelFish」の採用により、JavaScript / Ajaxを使用したWebアプリの処理速度も大幅に向上している。
<p>Adobe AIR 1.5のリリースにあわせ、開発環境のAdobe AIR 1.5 SDKのLinux版も公開されている。動作にはSun Java/JRE 1.4.2以降が必要。
<p>同社のWebサイトから無償でダウンロードできます：</p>
<p><a title="http://get.adobe.com/air/" href="http://get.adobe.com/air/">http://get.adobe.com/air/</a></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://digitechlog.com/2009/12/01/gplflash-another-alternative-flash-runtime.html" title="GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう">GPLFlash: GNU/Linux上でAdobeのFlashムービーを再生しよう</a></li>
<li><a href="http://digitechlog.com/2009/10/04/pyamf-an-amf-actionscript-message-format-decoder-and-encoder-for-python.html" title="PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する">PyAMF: PythonのためにAdobeのFlash Playerに対応しているサポートアクションメッセージ形式（ AMF ）を提供する</a></li>
<li><a href="http://digitechlog.com/2009/07/25/top-7-adobe-air-apps-for-videos-you-should-know.html" title="トップ７個アドビAIRビデオアプリケーション">トップ７個アドビAIRビデオアプリケーション</a></li>
<li><a href="http://digitechlog.com/2009/01/16/the-tutorial-on-how-to-save-swf-file-from-an-image-bitmap-in-adobe-air.html" title="SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション">SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション</a></li>
<li><a href="http://digitechlog.com/2008/12/17/how-to-get-file-uri-in-adobe-air-install-path-with-source-code.html" title="Adobe AIRアプリケーションのインストールパスにファイルURIを取得するサンプルソースコード">Adobe AIRアプリケーションのインストールパスにファイルURIを取得するサンプルソースコード</a></li>
<li><a href="http://digitechlog.com/2008/11/22/encrypt-your-sqlite-database-in-adobe-air-15.html" title="Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード">Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード</a></li>
<li><a href="http://digitechlog.com/2008/11/04/the-list-of-adobe-air-social-network-application-tools.html" title="Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト">Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト</a></li>
<li><a href="http://digitechlog.com/2008/11/03/the-list-of-micrologging-like-twitter-adobe-air-application.html" title="Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト">Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

