Re: [問題] xmlns:aaa="Main"
謝謝邦邦大大..
加了<td/>之後的確就不會再跑出namespace了..
另外我試著把下面幾行
catalog.body.shopNS::table.table.tr.td = "Item";
catalog.body.shopNS::table.table.tr.td += <td/>;
catalog.body.shopNS::table.table.tr.td[1] = "Price";
catalog.body.shopNS::table.table.tr.td += <td/>;
catalog.body.shopNS::table.table.tr.td[2] = "Price2";
改成
catalog.body.shopNS::table.table.tr.appendChild(<td></td>);
catalog.body.shopNS::table.table.tr.td = "Item";
catalog.body.shopNS::table.table.tr.appendChild(<td></td>);
catalog.body.shopNS::table.table.tr.td[1] = "Price";
catalog.body.shopNS::table.table.tr.appendChild(<td></td>);
catalog.body.shopNS::table.table.tr.td[2] = "Price2";
結果也不會出現namespace...
所以Essential ActionScript 3.0 上 原本的example codes 在你的flex builder上執行也是有問題的囉?
請問邦邦大大知道原因嗎?
謝謝.
※ 引述《ben0209 (邦邦)》之銘言:
: 使用 FB 3 搭配 SDK 3
: package {
: import flash.display.Sprite;
: public class TestXmlNameSpace extends Sprite
: {
: public function TestXmlNameSpace()
: {
: var htmlNS:Namespace = new Namespace("html",
: "http://www.w3.org/1999/xhtml");
: var shopNS:Namespace = new Namespace("shop",
: "http://example.com/furniture");
: default xml namespace = htmlNS;
: var catalog:XML = <html/>;
: catalog.addNamespace(shopNS);
: catalog.head.title = "Catalog";
: catalog.body.shopNS::table = "";
: catalog.body.shopNS::table.@shopNS::id = "4875";
: catalog.body.shopNS::table.table = "";
: catalog.body.shopNS::table.table.@border = "1";
: catalog.body.shopNS::table.table.tr.td = "Item";
: catalog.body.shopNS::table.table.tr.td += <td/>;
: catalog.body.shopNS::table.table.tr.td[1] = "Price";
: catalog.body.shopNS::table.table.tr.td += <td/>;
: catalog.body.shopNS::table.table.tr.td[2] = "Price2";
: trace(catalog.toXMLString());
: }
: }
: }
: 輸出結果:
: <html xmlns:shop="http://example.com/furniture"
: xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
: <head>
: <title>Catalog</title>
: </head>
: <body>
: <shop:table shop:id="4875">
: <table border="1">
: <tr>
: <td>Item</td>
: <td>Price</td>
: <td>Price2</td>
: </tr>
: </table>
: </shop:table>
: </body>
: </html>
: [SWF] D:\works_test\TestXmlNameSpace\bin-debug\TestXmlNameSpace.swf - 1,878
: bytes after decompression
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.117.162
→
08/30 11:03, , 1F
08/30 11:03, 1F
→
08/30 11:05, , 2F
08/30 11:05, 2F
→
08/30 11:06, , 3F
08/30 11:06, 3F
→
08/30 11:06, , 4F
08/30 11:06, 4F
→
08/30 11:15, , 5F
08/30 11:15, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 4 之 4 篇):