所以我手头有一个情况。我有一个需要制作成 XML 文件的 excel 文件,这对于不同的帖子来说是个问题(XSLT 有人吗?)。该 XML 文件将表示大约 400 个项目的列表,这些项目被编码为大约 15 个不同的类别。这是该 XML 的示例:
<?xml version="1.0" encoding="UTF-8"?>
<hotel>
<hfloor number="18">
<d_location d_code="sw18.10N" d_type="sw" description="Ferbludgit thingamabob">
<d_image>3e_pic1</d_image>
<d_image>3e_pic2</d_image>
<d_image>3e_pic3</d_image>
<d_image>3e_pic4</d_image>
<d_image>3e_pic5</d_image>
<d_video>3e_vid_1</d_video>
<d_video>3e_vid_2</d_video>
<d_video></d_video>
</d_location>
</hfloor>
<hfloor number="15">
<d_location d_code="W3" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
<d_location d_code="LB12" d_type="sw" description="Screwed up whosamadingy">
<d_image>media/lb15_12/LB-12 LOOKING NORTH.png</d_image>
<d_image>media/lb15_12/LB-12 LOOKING SOUTH.png</d_image>
<d_image>media/lb15_12/Pages from Level_15_Link_Beam_12.png</d_image>
<d_image>media/lb15_12/Pages from Level_15_Link_Beam_12-2.png</d_image>
<d_image>media/lb15_12/Post Demo from CITC018306365-2.png</d_image>
<d_image>media/lb15_12/Rebuilt from CITC018306365.png</d_image>
<d_image>media/lb15_12/WEI LB 12 level 15.png</d_image>
<d_video>Video 1</d_video>
<d_video>Video 2</d_video>
<d_video>Video 3</d_video>
</d_location>
<d_location d_code="LB17" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
</hfloor>
<hfloor number="s">
<d_location d_code="lbs.6e" d_type="sw" description="Whacked flogatron">
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_video></d_video>
<d_video></d_video>
<d_video></d_video>
</d_location>
</hfloor>
<hfloor number="s2">
<d_location d_code="W1" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
<d_location d_code="SWS2.3" d_type="sw" description="Whacked flogatron">
<d_image>media/sw_s2_3/CITC000155966.png</d_image>
<d_image>media/sw_s2_3/CITC000155983.png</d_image>
<d_image>media/sw_s2_3/CITC000155996.png</d_image>
<d_image>media/sw_s2_3/CITC000156003.png</d_image>
<d_image>media/sw_s2_3/Screen shot 2012-04-19 at 5.54.42 PM.png</d_image>
<d_image>media/sw_s2_3/WEI SWS2.3.png</d_image>
<d_video>lbs.6e vid</d_video>
<d_video></d_video>
<d_video></d_video>
</d_location>
</hfloor>
</hotel>
用户需要能够在列表中查看所有这些 - 没问题,虽然这将是一个大滚动条 - 而且还可以通过上面代码中的 d_type 过滤该列表。如前所述,这些类型有 15 种,用户需要 15 个单选按钮,每个按钮一个,它将重新构建仅显示所选 d_type 的列表。
有没有人对如何做到这一点有任何想法?过滤算法以及如何在 AS3 中正确实现它?我假设我将需要创建第二个某种类型的 XML 对象,并在更新的、已排序的数据中进行转换。