<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A Dullard's Guide : sample code</title><link>http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx</link><description>Tags: sample code</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Blackjack, Silverlight 1.0 Edition, Part I</title><link>http://blogs.msdn.com/amyd/archive/2008/05/16/blackjack-silverlight-1-0-edition-part-i.aspx</link><pubDate>Fri, 16 May 2008 23:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8514979</guid><dc:creator>Amy</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/amyd/comments/8514979.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=8514979</wfw:commentRss><description>One of my favorite HDi apps was blackjack , so I have been just itching to turn it into a Silverlight application. Now, this one wasn't quite so easy. My goal in writing blackjack for HDi originally was to take advantage of the timing element and remove...(&lt;a href="http://blogs.msdn.com/amyd/archive/2008/05/16/blackjack-silverlight-1-0-edition-part-i.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8514979" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/8514979.ashx" length="1449927" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category><category domain="http://blogs.msdn.com/amyd/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Sliding Puzzle, Silverlight 1.0 Edition</title><link>http://blogs.msdn.com/amyd/archive/2008/04/25/sliding-puzzle-silverlight-edition.aspx</link><pubDate>Fri, 25 Apr 2008 23:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8423269</guid><dc:creator>Amy</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/amyd/comments/8423269.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=8423269</wfw:commentRss><description>If you're an HDi developer who spends anytime reading this blog or the MSDN forum , you've probably noticed that I've mentioned Silverlight more than a couple of times recently. Silverlight is, of course, Microsoft's platform for delivering rich interactive...(&lt;a href="http://blogs.msdn.com/amyd/archive/2008/04/25/sliding-puzzle-silverlight-edition.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8423269" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/8423269.ashx" length="91792" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category><category domain="http://blogs.msdn.com/amyd/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Advanced Subtitles</title><link>http://blogs.msdn.com/amyd/archive/2007/11/21/advanced-subtitles.aspx</link><pubDate>Thu, 22 Nov 2007 02:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6460835</guid><dc:creator>Amy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/amyd/comments/6460835.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=6460835</wfw:commentRss><description>&lt;P&gt;In HD DVD subtitling can be done via a subpicture stream or an Advanced Subtitle.&amp;nbsp; An advanced subtitle is very similar in structure to an advanced application.&amp;nbsp; It has a manifest, markup file, and font and is declared with its resources in the playlist.&amp;nbsp; But, an advanced subtitle has some unique characteristics as well.&amp;nbsp; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The markup for an advanced subtitle uses the .xas extension rather than .xmu. &lt;/LI&gt;
&lt;LI&gt;The markup may not contain event, area, button, input, or option elements. &lt;/LI&gt;
&lt;LI&gt;Inline styles are not permitted. &lt;/LI&gt;
&lt;LI&gt;The markup may never receive focus. &lt;/LI&gt;
&lt;LI&gt;An advanced subtitle may not use script files.&lt;/LI&gt;
&lt;LI&gt;An advanced subtitle is rendered as part of the sub-picture plane and not the graphics plane so zOrder may not be modified&lt;/LI&gt;
&lt;LI&gt;An advanced subtitle may not be active at the same time as a subpicture subtitle.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;One of the great things about advanced subtitles is that they can be downloaded and run in time with the movie after the disc ships.&amp;nbsp; This could significantly increase the potential audience for your movie.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Playlist Reference&lt;BR&gt;&lt;/STRONG&gt;An advanced subtitle in a playlist is slightly different from and advanced application in that it must include track information and many not specify zOrder.&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AdvancedSubtitleSegment&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;titleTimeBegin&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;00:00:00:00&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;titleTimeEnd&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;02:00:00:00&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;src&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;file:///dvddisc/ADV_OBJ/as_manifest.xmf&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;sync&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;hard&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Subtitle&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;description&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;English Test&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;track&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ApplicationResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;priority&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;size&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;99999&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;multiplexed&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;src&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;file:///dvddisc/ADV_OBJ/as_manifest.xmf&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ApplicationResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;priority&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;size&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;99999&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;multiplexed&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;src&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;file:///dvddisc/ADV_OBJ/as_markup.xas&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ApplicationResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;priority&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;size&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;99999&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;multiplexed&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;src&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;file:///dvddisc/ADV_OBJ/Miramo.ttf&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AdvancedSubtitleSegment&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Generating an Advanced Subtitle Markup Page&lt;BR&gt;&lt;/STRONG&gt;When generating subtitles, the primary information needed is the text being spoken, when it appears on screen, when it ends.&amp;nbsp; The simplicity and regular structure of this data lends itself nicely to automation, of which I am a big fan.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;At the end of this project you will find a sample advanced subtitles project.&amp;nbsp; In this project is an Excel file with a macro that will generate an advanced subtitle markup page with the data entered on the first tab (Subtitles).&amp;nbsp; The default x and y positioning and alignment may be overridden by enter a new value in the override columns. &amp;nbsp;&amp;nbsp;Default values for your markup page are set on the second tab (Settings). &lt;/P&gt;
&lt;P&gt;When opening the Excel file, be sure to enable macros.&amp;nbsp; There is some low level of data checking.&amp;nbsp; For instance, entering a start or end value in the wrong format will turn the row red.&amp;nbsp; But, always be sure to run the validator on your project to make sure the output is correct.&amp;nbsp; And, once you're ready to export your markup file, press the "Export Subtitles" button at the top of the page, or press CTRL+r.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6460835" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/6460835.ashx" length="169651" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HD+DVD/default.aspx">HD DVD</category><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/markup/default.aspx">markup</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Virtual Keyboards</title><link>http://blogs.msdn.com/amyd/archive/2007/10/24/virtual-keyboards.aspx</link><pubDate>Wed, 24 Oct 2007 10:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5641659</guid><dc:creator>Amy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/amyd/comments/5641659.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=5641659</wfw:commentRss><description>&lt;P&gt;The input tag has four options for mode: password, singleline, multiline or display. When an input element with singleline, multiline, or password mode receives focus, the player &lt;EM&gt;&lt;STRONG&gt;may&lt;/STRONG&gt;&lt;/EM&gt; launch an onscreen keyboard to allow user input or a software player may enable use of the computer keyboard. This is not required, though (currently, only the Xbox presents the user with a keyboard). And, there's no guarantee on how a player's keyboard will look and if they will implement all the keys you want. Maybe you want an alphabetical keyboard. Maybe you want “.com” and “.net” keys to make entering email addresses easier. If you need user input, your best bet is to use the display mode on your input tag and implement your own virtual keyboard. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/hddvd/images/5641670/original.aspx" border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;The project at the end of this blog has 3 sample virtual keyboards to choose from - alphabetical (for me), &lt;A class="" href="http://en.wikipedia.org/wiki/Qwerty" target=_blank mce_href="http://en.wikipedia.org/wiki/Qwerty"&gt;QWERTY&lt;/A&gt;, and &lt;A class="" href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard" target=_blank mce_href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard"&gt;Dvorak&lt;/A&gt;&amp;nbsp;(for Chris).&amp;nbsp; They all use the same markup, styles, timing, and script files.&amp;nbsp; Only the markup files are different.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here's a sample of what the "A" key looks like:&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;key col1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;uppercase&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;key btn&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;key_btn&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;accessKey&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;VK_A_BUTTON&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;custom:key&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;A&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;p&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;A&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;p&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;class&lt;BR&gt;&lt;/B&gt;The parent div has a class attribute.&amp;nbsp; A class is a way to group similar elements.&amp;nbsp; It doesn't apply a style like the same attribute would in HTML.&amp;nbsp; Class is used here to group which elements are hid or shown when the shift button is actioned.&amp;nbsp; Class is also used to group all the keyboard keys so only one cue is needed for all buttons with the class applied.&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;cue&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;begin&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;class('key')[state:actioned()]&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;end&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;defaultNode()[not(state:actioned())]&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;event&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;key_action&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;cue&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;Custom Namespace&lt;BR&gt;&lt;/B&gt;The buttons of the keyboard also have a "custom:key" attribute.&amp;nbsp; The markup is extensible and custom attributes can be added if you add the namespace to the root element of the document.&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;xmlns:custom&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;http://custom&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;This allows us to pass custom information on the button that has been actioned to the script by calling getNamedItem on the target of the action&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; element = evt.target;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; attr = element.attributes.getNamedItem(&lt;SPAN style="COLOR: #a31515"&gt;"custom:key"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; key = attr.value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;&lt;BR&gt;accessKey&lt;BR&gt;&lt;/B&gt;Adding accessKey to a button adds a shortcut to actioning that button.&amp;nbsp; This is particularly useful for the number keys because it allows users to navigate the keyboard or use the number panel on the remote.&amp;nbsp; Note that for the letter keys, only keys A, B, C, and D are required to be supported.&amp;nbsp; Letters E-L are optionally supported.&amp;nbsp; Letters M-Z are not supported.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;&lt;BR&gt;computeImplicitNav&lt;BR&gt;&lt;/B&gt;As I stated earlier, shift is being handled by hiding or showing uppercase or lowercase classes.&amp;nbsp; By setting style:display to none, the disabled keys are removed from display.&amp;nbsp; However, changing a key's display from none to auto does not automatically add the element to the keyboard's navigation.&amp;nbsp; So, when display has been updated, an event is sent to the script and computeImplicitNav re-calculates the keyboard's implicit navigation. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5641659" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/5641659.ashx" length="71255" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/markup/default.aspx">markup</category><category domain="http://blogs.msdn.com/amyd/archive/tags/simulator/default.aspx">simulator</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Dynamic Content</title><link>http://blogs.msdn.com/amyd/archive/2007/10/18/dynamic-content.aspx</link><pubDate>Thu, 18 Oct 2007 19:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5498354</guid><dc:creator>Amy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/amyd/comments/5498354.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=5498354</wfw:commentRss><description>&lt;P mce_keep="true"&gt;Today's sample was created upon a request from my&amp;nbsp;very nice&amp;nbsp;and hard working office-mate Chris.&amp;nbsp; Last week Chris began learning HDi.&amp;nbsp; He whizzed through all the Jumpstart samples and the projects on my blog, and jumped into creating a project that would dynamically generate content on the fly.&amp;nbsp; After messing around with his project for a few days, Chris said I should write a blog how to do this for other people who had questions like his.&amp;nbsp; So, here it is.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There is a sample project is attached at the end of this blog.&amp;nbsp; In this project, an XML file is parsed, data is extracted using XPath, text is dynamically added to the markup, and new "skins" are applied to the data by changing the loaded markup file.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;XML Data&lt;BR&gt;&lt;/B&gt;Let's say you have a project where you want to separate your data from your presentation layer.&amp;nbsp; Maybe you want to download new content from the network.&amp;nbsp; Maybe you want to be able to apply different skins to the same piece of content.&amp;nbsp; The obvious way to separate your data is by using XML.&amp;nbsp; &lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;xml&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;version&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1.0&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;utf-8&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;?&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;data&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;headline&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;This Is The Header&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;subheading&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Here's a Subheading&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;paragraph&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Lorem ipsum . . .&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;paragraph&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;paragraph&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Lorem ipsum . . .&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;paragraph&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;data&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;In this project, the data is in a file called data.xml and it is included with the project.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;XMLParser&lt;BR&gt;&lt;/B&gt;Before the application does anything with this XML, we need to use the XMLParser to create a DOM.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;XMLParser.parse(&lt;SPAN style="COLOR: #a31515"&gt;uri&lt;/SPAN&gt;, parseCallback);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;function &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;parseCallback(status, dom)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (status == XMLParser.OK)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//do something with dom&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;XMLParser.parse takes two arguments - uri is the full path of the xml file (file:///dvddisc/ADV_OBJ/data.xml in this project) and the callback function which is called when the XMLParser has completed and is ready to return the DOM.&lt;/P&gt;
&lt;P&gt;XMLParser also has a method called parseString which will create a DOM from a string.&amp;nbsp; The parseString function returns the DOM directly without the callback.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;var dom = &lt;SPAN style="mso-no-proof: yes"&gt;XMLParser.parseString(&lt;SPAN style="COLOR: #a31515"&gt;&lt;FONT color=#333333&gt;"&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;data&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;headline&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=\&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;This Is The Header\&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;data&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;FONT color=#333333&gt;&lt;SPAN style="COLOR: #a31515"&gt;"&lt;/SPAN&gt;);&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;This can be very handy to use if your XML comes from getResponseString() from a network request or if you want to create a new empty DOM on the fly. (For more information on networking, read &lt;A href="http://blogs.msdn.com/amyd/archive/2007/09/20/very-simple-network-example.aspx"&gt;http://blogs.msdn.com/amyd/archive/2007/09/20/very-simple-network-example.aspx&lt;/A&gt;)&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;BR&gt;evaluateXPath&lt;BR&gt;&lt;/B&gt;There are a couple of ways to can go through the newly created DOM.&amp;nbsp; We could cycle through all the childNodes using DOM Level 2 &lt;A class="" href="http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html" target=_blank mce_href="http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html"&gt;ECMAScript Language Binding&lt;/A&gt;.&amp;nbsp; Or, we can use XPath.&amp;nbsp; (Note, Xpath &lt;A class="" href="http://www.w3.org/TR/xpath#axes" target=_blank mce_href="http://www.w3.org/TR/xpath#axes"&gt;axes&lt;/A&gt; are not supported).&amp;nbsp; In this project, I've chosen to use some simple XPath calls to extract my data using evaluateXPath.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; nodes = dom.evaluateXPath(&lt;SPAN style="COLOR: #a31515"&gt;"//headline"&lt;/SPAN&gt;, dom.documentElement);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;evaluateXPath returns a &lt;A class="" href="http://blogs.msdn.com/ptorr/archive/2006/11/07/live-vs-loaded-dom.aspx" target=_blank mce_href="http://blogs.msdn.com/ptorr/archive/2006/11/07/live-vs-loaded-dom.aspx"&gt;nodeList&lt;/A&gt;.&amp;nbsp; Since I know I'm only expecting one headline here, if I do get a non-empty nodelist, I only need the first item and its value attribute.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; headline = nodes.item(0).getAttribute(&lt;SPAN style="COLOR: #a31515"&gt;"value"&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;The call to evaluteXPath for paragraph from my DOM will return more than one node.&amp;nbsp; Also, the data here is in a text node, not an attribute.&amp;nbsp; This text node is the first child of the paragraph tag and its contents can be retrieved by calling nodeValue.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;for&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; i = 0; i &amp;lt; nodes.length; i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// do something with nodes.item(i).firstChild.nodeValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;I could go back to this DOM every time I need to get this data, but my application would take a performance hit.&amp;nbsp; So once I get my data, I cache it for use later.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;Adding Text to Markup&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Okay, the XML has been parsed and data cached, so now we can put it in the markup.&amp;nbsp; Here we will use the DOM Level 2 &lt;A class="" href="http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html" target=_blank mce_href="http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html"&gt;ECMAScript Language Binding&lt;/A&gt; to create new paragraph tags (elements that can hold text) and text nodes inside.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;DIV style="COLOR: #333333; BACKGROUND-COLOR: #ffffff"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; addText(element, txt) &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; p = document.createElement(&lt;SPAN style="COLOR: #a31515"&gt;"p"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; text = document.createTextNode(txt);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;p.appendChild(text);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;element.appendChild(p);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;And, of course once this is complete, we load the changes to the modified markup by calling document.load.&amp;nbsp; For more information on why you need to call document.load, read Peter Torr's blog on &lt;A class="" href="http://blogs.msdn.com/ptorr/archive/2006/11/07/live-vs-loaded-dom.aspx" target=_blank mce_href="http://blogs.msdn.com/ptorr/archive/2006/11/07/live-vs-loaded-dom.aspx"&gt;Live vs. Load DOM&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;Switching Between Markup Files&lt;BR&gt;&lt;/B&gt;And, finally, just for kicks, I've added the ability to load new markup pages in order to reskin the data using the link() function.&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Happy Programming!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5498354" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/5498354.ashx" length="67258" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/markup/default.aspx">markup</category><category domain="http://blogs.msdn.com/amyd/archive/tags/simulator/default.aspx">simulator</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Saving Resume Information</title><link>http://blogs.msdn.com/amyd/archive/2007/08/19/saving-resume-information.aspx</link><pubDate>Mon, 20 Aug 2007 04:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4471015</guid><dc:creator>Amy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amyd/comments/4471015.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=4471015</wfw:commentRss><description>&lt;P&gt;If you've purchased a DVD player in the last few years or used a software player, likely you've experienced a built in player feature that remembers where you last left off in the movie and allows you to resume play from that point.&amp;nbsp; That functionality is player dependent - and usually the memory is discarded when you eject the disc. Because HD DVD has persistent storage, you can add this resume playback feature to your disc so that the user experience will be consistent from player to player - even if the user ejects the disc before resuming playback at another time. &lt;/P&gt;
&lt;P&gt;To determine when the user has stopped playback on the disc, you should listen for the application_end event.&amp;nbsp; Once this event fires, you have approximately 2 seconds to capture the necessary information and save it before the player shuts down.&amp;nbsp; This is plenty of time to capture the elapsed time of the current title and set a key in the content's info.txt file.&lt;/P&gt;
&lt;P&gt;The code to do this is simple and straight forward:&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier"&gt;function handleApplicationEnd(evt)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pstoreDevices = PersistentStorageManager.getPersistentStorageDevices(PersistentStorageManager.STORAGE_REQUIRED);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var psd = pstoreDevices[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; psd.setContentInformation(PersistentStorageManager.contentId, "resume", Player.playlist.currentTitle.elapsedTime, function(result, key){});&lt;BR&gt;}&lt;BR&gt;addEventListener("application_end", handleApplicationEnd, false);&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;BR&gt;Then, next time your discs plays, call getContentInformation on that key you just set to obtain your restart point.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In the attached project, the resume application runs as a title app.&amp;nbsp; When leaving a title (either by jumping or stopping the player), the application_end event will fire and a key related to the title id will be saved with the title's resume information.&amp;nbsp; On return to the title, if valid resume information is saved, the user will be asked if they wish to resume from the point they left off. &amp;nbsp;If the resume time is greater than or equal to the title duration, the user will not be prompted and the title will start from the beginning.&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Note that the simulator does not fire the application_end event when you shut it down.&amp;nbsp; So, if you want to test this on the simulator, while the title with the application is playing, press CTRL+F to jump to the next title in the playlist which will trigger application_end.&lt;/I&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4471015" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/4471015.ashx" length="63099" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HD+DVD/default.aspx">HD DVD</category><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Persistent Storage Management</title><link>http://blogs.msdn.com/amyd/archive/2007/08/15/persistent-storage-management.aspx</link><pubDate>Thu, 16 Aug 2007 00:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4405064</guid><dc:creator>Amy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amyd/comments/4405064.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=4405064</wfw:commentRss><description>&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;One of the great features mandatory on every HD DVD player is at least 128 MB of persistent storage.&amp;nbsp; Many discs on the market are taking advantage of this feature to allow you to do things like save bookmarked scenes, download new trailers, or cache your login information to access network enabled content.&lt;/P&gt;
&lt;P&gt;The players do have a persistent storage management interface that will allow users to delete this saved content if the user so chooses.&amp;nbsp; However, the player's persistent storage management menu only allows the user to delete ALL the content for a disc.&amp;nbsp; So, it is &lt;B&gt;HIGHLY RECOMMENDED&lt;/B&gt; that if you are using persistent storage for your disc, that you...&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Provide your users with the ability to modify the contents saved on persistent storage for your disc from outside the player's persistent storage management menu. For instance, if your disc allows for the downloading trailers, make sure you also provide your user with the ability to delete these trailers from persistent storage via an application on the disc.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Label your content and provider folders by setting a &lt;EM&gt;[language]-explanation&lt;/EM&gt; and/or &lt;EM&gt;[language]-icon&lt;/EM&gt; key as specified in chapter 10 of the DVD Specification for High Definition Video. (sample code and downloadable sample application provided below). When a user does use the player's persistent storage management menu, your disc's folder will be appropriately labeled and the user can avoid confusing it with another disc and accidentally deleting it.&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;Launching the Persistent Storage Management Menu&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;To access the player's persistent storage management menu on a Toshiba player:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Press "SETUP" on the remote. &lt;/LI&gt;
&lt;LI&gt;From the Setup menu, navigate to General &amp;gt; Maintenance &amp;gt; Persistent Storage&lt;/LI&gt;
&lt;LI&gt;Press "SETUP" on the remote again to launch the Persistent Storage Management Menu&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;To access the player's persistent storage management menu on the Xbox:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Launch the Xbox dashboard&lt;/LI&gt;
&lt;LI&gt;Navigate to the System blade&lt;/LI&gt;
&lt;LI&gt;Select Memory&lt;/LI&gt;
&lt;LI&gt;Choose HD DVD&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;There is a good possibility that you will see several folders labeled "Unknown Provider" and "Unknown Content".&amp;nbsp; When a disc saves content to persistent storage, a unique folder is created based on that disc's content ID and nested under a folder based on its provider ID. The content and provider IDs are set in the DISCID.DAT file on the disc.&amp;nbsp; If a disc sets the &lt;EM&gt;[language]-explanation&lt;/EM&gt; and/or &lt;EM&gt;[language]-icon&lt;/EM&gt; keys, the user will be provided with meaningful labels.&amp;nbsp; If the disc does not set these keys, the specification states that the player should use "Unknown Provider" and "Unknown Content" as a label.&amp;nbsp; As you can probably imagine or even see for yourself - it quickly becomes difficult to distinguish between your content and provider folders if you do not set these keys.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;Creating Labels for the Content and Provider Directories&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The simplest way to create a label for your content and provider directories is to set the &lt;EM&gt;[language]-explanation&lt;/EM&gt; keys for these directories to a string that describes your disc title and studio.&amp;nbsp; The value selected by the persistent storage management menu is determined by the user's menu language. So, if you only set the content folder's &lt;I&gt;en-explanation&lt;/I&gt; key and the user's menu language is set to Spanish (es), the user will still see "Unknown Content".&amp;nbsp; Thus, you will want to specify several languages in order to cover your anticipated audience.&lt;/P&gt;
&lt;P&gt;To set the key for your content directory, on the PersistentStorageDevice object for your required persistent storage, you would call&lt;/P&gt;
&lt;P&gt;setContentInformation(PersistentStorageManager.contentId, "en-explanation", "Title of My Movie", contentCallbackFunction)&lt;/P&gt;
&lt;P&gt;where contentCallbackFunction is the callback function that handles the result from your call.&lt;/P&gt;
&lt;P&gt;And, similarly, to set the key for your provider directory, on the PersistentStorageDevice object for your required persistent storage, you would call&lt;/P&gt;
&lt;P&gt;setProviderInformation("en-explanation", "Title of Movie Studio", providerCallbackFunction)&lt;/P&gt;
&lt;P&gt;where providerCallbackFunction is the callback function that handles the result from your call.&lt;/P&gt;
&lt;P&gt;But, as I stated earlier, you will want to set this key for multiple languages.&amp;nbsp; And, as you noticed, these functions have a callback and thus operate asynchronously.&amp;nbsp; So, to set multiple language keys without stepping on a previous call, you will need to wait for the callback from the previous call before calling the function a second time.&lt;/P&gt;
&lt;P&gt;The code to do this for the provider folder looks something like:&lt;/P&gt;
&lt;DIV style="FONT-FAMILY: courier"&gt;
&lt;P&gt;function setProviderLabel(providerInfo, languages)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;//get reference to required p-storage devices&lt;BR&gt;&amp;nbsp; var pstoreDevices = PersistentStorageManager.getPersistentStorageDevices(PersistentStorageManager.STORAGE_REQUIRED);&lt;BR&gt;&amp;nbsp; var psd = pstoreDevices[0];&lt;BR&gt;&amp;nbsp; var provider_index = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function setProviderExplanation( ) &lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; psd.setProviderInformation( languages[ provider_index ] + "-explanation", providerInfo, setProviderExCB);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&amp;nbsp; function setProviderExCB( result, key ) &lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result == PersistentStorageManager.SUCCEEDED &amp;amp;&amp;amp; provider_index &amp;lt; languages.length - 1) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //interate through languages&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; provider_index++;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setProviderExplanation();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;setProviderLabel("Title of Movie Studio", ["en","es","fr"]);&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;At the end of this post is a sample application which sets the &lt;EM&gt;[language]-explanation&lt;/EM&gt; keys for both provider and content using a function called setPStorLabel which takes your content description(s), provider description(s), and array of languages as arguments.&amp;nbsp; Including this script in your project will allow you to specify the labels for your provider and content folders in a single call:&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier"&gt;setPStorLabel("Title of My Movie", "My Movie Studio", ["en","es","fr"]);&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;BR&gt;A Note About [language]-icon&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;10.8 in the spec states that you may also set the &lt;EM&gt;[language]-icon&lt;/EM&gt; key as a way to label your content and provider directories.&amp;nbsp; This requires creating a 1024x96 pixel PNG or JPEG, copying it to the content or provider directory, and setting the [language]-icon key to the location of the image.&amp;nbsp; However, it should be noted that the player may only use the [language]-explanation key and not the [language]-icon key, so if you should chose to use &lt;EM&gt;[language]-icon&lt;/EM&gt;, be sure to set &lt;EM&gt;[language]-explanation&lt;/EM&gt; as a backup.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4405064" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/4405064.ashx" length="20268" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HD+DVD/default.aspx">HD DVD</category><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Blackjack</title><link>http://blogs.msdn.com/amyd/archive/2007/07/31/blackjack.aspx</link><pubDate>Tue, 31 Jul 2007 22:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4152129</guid><dc:creator>Amy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/amyd/comments/4152129.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=4152129</wfw:commentRss><description>Today's game example is inspired by Ocean's 13 (available on HD DVD this fall).&amp;nbsp; Blackjack is one of my favorite casino games, but I was too busy at NAB this year to make it to the tables.&amp;nbsp; So, here it is for you in HDi (with some graphics assistance from John Green - Thanks, John!).&amp;nbsp;&amp;nbsp; 
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/hddvd/images/3531964/640x380.aspx" border=0&gt;&lt;/P&gt;
&lt;P&gt;Writing the script for blackjack is pretty simple.&amp;nbsp; So, the trick here is take advantage of what you can do via markup in HDi (see &lt;A class="" href="http://blogs.msdn.com/amyd/archive/2007/06/26/making-the-most-of-markup.aspx" target=_blank mce_href="http://blogs.msdn.com/amyd/archive/2007/06/26/making-the-most-of-markup.aspx"&gt;my last post&lt;/A&gt;).&amp;nbsp; If you open this project up (a zip file is attached at the end of this blog) you will see that the only time the script modifies the markup is to change the value of the bet and the bank (setting state), to update the value of the hand total (again, setting state), and to set the background frame of the card container (this is the only time style is ever changed via script).&amp;nbsp; Buttons focusing or disabling, divs hiding, showing, or moving is all done via markup cues triggered by XPath variables.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Suggested upgrades (read: exercise for the reader) to this app include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Allow user to set up game&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Decks in shoe&lt;/LI&gt;
&lt;LI&gt;Starting bank&lt;/LI&gt;
&lt;LI&gt;Minimum bet and bet increment&lt;/LI&gt;
&lt;LI&gt;Username&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Add a mode to accept insurance when the dealer is showing an ace&lt;/LI&gt;
&lt;LI&gt;Add option to save bank at end of game to persistent storage&lt;/LI&gt;
&lt;LI&gt;Add option to upload score and download high scores from network&lt;/LI&gt;
&lt;LI&gt;Create a "hint" option that tells the user the recommended move&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4152129" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/4152129.ashx" length="3053762" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HD+DVD/default.aspx">HD DVD</category><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/markup/default.aspx">markup</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item><item><title>Sliding Puzzle</title><link>http://blogs.msdn.com/amyd/archive/2007/06/01/sliding-puzzle.aspx</link><pubDate>Sat, 02 Jun 2007 04:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3033367</guid><dc:creator>Amy</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/amyd/comments/3033367.aspx</comments><wfw:commentRss>http://blogs.msdn.com/amyd/commentrss.aspx?PostID=3033367</wfw:commentRss><description>There have been a lot of JavaScript games created for the web.&amp;nbsp; And, because HDi is based on web standards, with a little tweaking, you can easily turn many of them into games for HD DVD.&amp;nbsp; And, as long as we're tweaking, we might as well add the cool additional features where we can -&amp;nbsp;like screen capture. 
&lt;P&gt;At the end of this blog is an attachment for a &lt;A class="" href="http://en.wikipedia.org/wiki/Sliding_puzzle" target=_blank mce_href="http://en.wikipedia.org/wiki/Sliding_puzzle"&gt;sliding puzzle&lt;/A&gt; that takes a screen capture when the user hits the A button (F1 if you're using the simulator) and scrambles the screen.&amp;nbsp; The up/down/left/right keys move the blocks into the empty space.&amp;nbsp; When the puzzle is complete, the full screen image fades into view and play resumes.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Full screen:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/hddvd/images/3033381/original.aspx" border=0&gt;&lt;/P&gt;
&lt;P&gt;Puzzle:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/hddvd/images/3033398/original.aspx" border=0&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;No video file is included in the attachment, so be sure to add one to your HVDVD_TS folder to take advantage of the screen capture.&lt;/P&gt;
&lt;P mce_keep="true"&gt;For more games in HDi, check out Peter's &lt;A href="http://blogs.msdn.com/ptorr/archive/2007/04/02/coloured-blocks-advancing-on-a-moving-block.aspx"&gt;Space Invaders&lt;/A&gt; and &lt;A href="http://blogs.msdn.com/ptorr/archive/2007/05/16/a-game-of-chance-that-pirates-like-to-play.aspx"&gt;Liar's Dice&lt;/A&gt; if you haven't already.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3033367" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/amyd/attachment/3033367.ashx" length="72184" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/amyd/archive/tags/HD+DVD/default.aspx">HD DVD</category><category domain="http://blogs.msdn.com/amyd/archive/tags/HDi/default.aspx">HDi</category><category domain="http://blogs.msdn.com/amyd/archive/tags/script/default.aspx">script</category><category domain="http://blogs.msdn.com/amyd/archive/tags/sample+code/default.aspx">sample code</category></item></channel></rss>