0

好的。简而言之,我需要一个解析器,它为我用于 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>我需要让网站上的文本框吐出 <> 和标签之间的部分。我该怎么做呢?

4

0 回答 0