小弟在試 Essential Actionscript 3.0 p.403的範例:
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[1] = "Price";
trace(catalog.toXMLString());
result:
<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>
<aaa:td xmlns:aaa="Main">Price</aaa:td>
</tr>
</table>
</shop:table>
</body>
</html>
請問版上大大為什麼 上面第二個td 會跑出aaa這個namespace呢?
謝謝..
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.117.162
→
08/25 17:44, , 1F
08/25 17:44, 1F
推
08/26 04:16, , 2F
08/26 04:16, 2F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 4 篇):