好。简而言之,我需要一个解析器,为我用于RPG游戏的虚拟桌面程序创建一个模块。有一种方法我需要格式化所有不同的变量才能使其工作。
我想创建一个简单的网页,其中所有文本框都与所需的变量相关联,我想简单地用所需信息填充这些框,点击“生成”按钮,它会发出我需要的信息,我需要使用正确的格式和标签。以下是条目示例:
<Aurumvorax>
<librarylink type="windowreference">
<class>npc</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Aurumvorax</name>
<type type="string">N Small magical beast</type>
<hd type="string">12d10+48</hd>
<speed type="string">30 ft., burrow 10 ft.</speed>
<ac type="string">23, touch 15, flat-footed 19; (+4 Dex, +8 natural, +1 size)</ac>
<babgrp type="string">Base Atk +12; CMB +16 (+24 grapple); CMD 30 (42 vs. trip)</babgrp>
<atk type="string">melee bite +18 (1d6+5 plus grab), 4 claws +18 (1d4+5 grab)</atk>
<fullatk type="string">melee bite +18 (1d6+5 plus grab), 4 claws +18 (1d4+5 grab)</fullatk>
<spacereach type="string">-- ft./0 ft.</spacereach>
<specialattacks type="string">rake (4 claws +18, 1d4+5)</specialattacks>
<senses type="string">darkvision 60 ft., low-light vision, scent, Perception +13</senses>
<specialqualities type="string"></specialqualities>
<skills type="string">Perception +13, Stealth +17</skills>
<feats type="string">Bleeding Critical, Critical Focus, Great Fortitude, Improved Initiative, Iron Will, Skill Focus (Perception)</feats>
<environment type="string">temperate plains, hills or forests</environment>
<organization type="string">solitary or pair</organization>
<treasure type="string">standard</treasure>
<alignment type="string">N</alignment>
<leveladjustment type="string"> - </leveladjustment>
<strength type="number">21</strength>
<dexterity type="number">18</dexterity>
<constitution type="number">18</constitution>
<intelligence type="number">2</intelligence>
<wisdom type="number">13</wisdom>
<charisma type="number">11</charisma>
<fortitudesave type="number">+14</fortitudesave>
<reflexsave type="number">+12</reflexsave>
<willsave type="number">+7</willsave>
<hp type="number">114</hp>
<init type="number">+8</init>
<cr type="number">9</cr>
<text type="formattedtext">
<p>Powerful muscles ripple beneath the golden fur of this small yet fearsome eight-legged beast.</p>
<p><b>XP:</b> 6,400</p>
<p><b>Racial Modifiers:</b>-</p>
<p><b>Grab (Ex):</b> An aurumvorax can grab a foe of up to one size category larger than itself. It gains +8 racial bonus on grapple attempts rather than the normal +4 racial bonus offered by the grapple ability.</p>
</text>
</Aurumvorax>
从示例中,您可以看到像<name type="string">Aurumvorax</name>
这样的内容我需要在网站上的文本框中吐出&lt;&gt;之间的文章。和标签。我到底该怎么做呢?