使用XML名字空间

MXML标签中的xmlns属性可指定一个XML名字空间。可用一个前缀简化名字空间。

例如,在<s:Application>标签的xmlns属性使用了前缀s来对应Spark组件的名字空间。

<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"

xmlns:s="library://ns.adobe.com/flex/spark" > 

 

1.xmlns:fx="http://ns.adobe.com/mxml/2009"说明

    The MXML language namespace URI. This namespace includes the top-level ActionScript language elements, such as Object, Number, Boolean, and Array. For a complete list of the top-level elements, see the Top Level package in the ActionScript 3.0 Reference for the Adobe Flash Platform.

 名字空间也包含内建于MXML编译器的标签,如<fx:Script>,<fx:Declarations> 和<fx:Style>标签2.xmlns:mx="library://ns.adobe.com/flex/mx" 说明

The MX component set namespace URI. This namespace includes all of the components in the Flex mx.* packages, the Flex charting components, and the Flex data visualization components. 

 3.xmlns:s="library://ns.adobe.com/flex/spark"说明

 The Spark component set namespace URI. This namespace includes all of the components in the Flex spark.* packages and the text framework classes in the flashx.* packages. 

posted @ 2012-05-28 20:42  thinkpore  阅读(127)  评论(0)    收藏  举报