Notes

From Hackspire
Revision as of 15:57, 29 January 2012 by Excale (talk | contribs) (typo)
Jump to navigation Jump to search

Notes Meta-data

Raw

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
<np:mFlags>1024</np:mFlags>
<np:value>3</np:value>
<np:fmtxt>{TREE}</np:fmtxt>
</wdgt>

Explanation

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">	<!--  -->
<np:mFlags>1024</np:mFlags>					<!--  -->
<np:value>3</np:value>						<!--  -->
<np:fmtxt>{TREE}</np:fmtxt>					<!-- Text is in this tree -->
</wdgt>								<!--  -->


Notes Text-tree

Text is stored in a tree beginning by <r2dtotree> and ending by </r2dtotree>.

All < , > , " , ect... should be written as &lt; , &gt;... Here they are transformed so you can read easily.


Doc

<node name="1doc">{paragraphs}</node> <!-- If you put several 1doc, only the last one will be displayed (at least in "normal" mode) -->


Paragraph

<node name="1para">{lines}</node> <!-- New paragraph each time you're forcing a new line (pressing "enter") -->


Line

<node name="1rtline">{words}</node> <!-- Stupidly recomputed by the nspire, so its useless to create a new line -->


Word

Several types of words: 1word : normal // 1keyword : bold // 1subhead : italic // 1title : underline // 1subscrp : subscript // 1supersc : superscript . Thus, you can't have a bold underline word.

<leaf name="1{typeofword}">{text}</leaf> <!-- There should be a leaf per word, but you can put several word in a leaf (using regular spaces) -->

Raw exemple

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
	<np:mFlags>1024</np:mFlags>
	<np:value>3</np:value>
	<np:fmtxt>
		<r2dtotree>
			<node name="1doc">
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L1
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L2
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L3
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word" continued="1">
							llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
						</leaf>
					</node>
					<node name="1rtline">
						<leaf name="1word" continuation="1">
							llllllllllllllllllllllllllllllllllllllllllllllllllllllll
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							&amp;amp;é&amp;quot;&amp;apos;(-è_çà)=
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word"/>
					</node>
				</node>
					
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L10!
						<cursor index="0"/>
						</leaf>
						</node>
				</node>
				
			</node>
		</r2dtotree>
	</np:fmtxt>
</wdgt>

<!-- Another example (now properly indented) -->

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
 <np:mFlags>1024</np:mFlags>
 <np:value>3</np:value>
 <np:fmtxt>
     <r2dtotree>
         <node name="1doc">
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L1normal</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L2</leaf>
                     <leaf name="1keyword">gras</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L3</leaf>
                     <leaf name="1subhead">italique</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1subhead">L4</leaf>
                     <leaf name="1word">blabla</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1title">L5</leaf>
                     <leaf name="1title">souligné</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L6</leaf>
                     <leaf name="1supersc">up</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L7</leaf>
                     <leaf name="1subscrp">down</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L8</leaf>
                     <leaf name="1word">on</leaf>
                     <leaf name="1title">mixxe|xx|</leaf>
                     <leaf name="1keyword">
                         <cursor index="0"/>eeee</leaf>
                     <leaf name="1keyword">==></leaf>
                     <leaf name="1keyword">fail</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">Et</leaf>
                     <leaf name="1word">ci</leaf>
                     <leaf name="1word">on</leaf>
                     <leaf name="1word">fait</leaf>
                     <leaf name="1word">ça?:</leaf>
                     <leaf name="1word"></leaf>
                     <leaf name="1keyword">11</leaf>
                     <leaf name="1title">22</leaf>
                     <leaf name="1keyword">11</leaf>
                 </node>
             </node>
         </node>
     </r2dtotree>
 </np:fmtxt>
</wdgt>


Catégorie:XML format used in TNS&TNSP files