androidの「adt-bundle-windows-x86-20140702」開発環境で、 レイアウトファイル(activity_main.xml)のデフォルト生成で、次の内容のファイルが生成されます。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativePackage}.${activityClass}" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> </RelativeLayout>
{"http://schemas.android.com/apk/res/android"}layout_width="match_parent" {"http://schemas.android.com/apk/res/android"}layout_height="match_parent"これにより、layout_widthやlayout_heightやその他の様々な指定を、容易にしています。
<xsl:variable name="activityClass"> MainActivity </xsl:variable>この後で、${activityClass}の表現は、「MainActivity」を使っていることになります。なお上記は次のように書くこともできます。
<xsl:variable name="activityClass" select="MainActivity"/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>