How to show Android’s xml file in wordpress?

I am writing a blog about Android by WP-CodeBox plugin and want to add a layout.xml into blog like this:

<pre><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <ImageView android:id="@+id/icon"
        android:layout_width="@dimen/notification_large_icon_width"
        android:layout_height="@dimen/notification_large_icon_height"
        android:background="@android:drawable/bg_tile"
        android:scaleType="center"
        />

</LinearLayout></pre>

in HTML mode, and when I Change the edit mode to visual mode, the xml is GONE! Please help me how to show the xml without malformed in xml mode. Is there any other xml edit plugin in wordpress? Thanks!

Related posts

Leave a Reply

1 comment

  1. You could use this highlighter. This will give you this output for your XML(with Eclipse style):

    <pre style='color:#000000;background:#ffffff;'><span style='color:#7f0055; '>&lt;</span><span style='color:#7f0055; '>LinearLayout</span> xmlns:android=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>http</span><span style='color:#2a00ff; '>:</span><span style='color:#7f0055; font-weight:bold; '>//</span><span style='color:#3f3fbf; '>schemas.android.com</span><span style='color:#3f3fbf; '>/apk/res/android</span><span style='color:#2a00ff; '>"</span>
    
        android:layout_width=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>match_parent</span><span style='color:#2a00ff; '>"</span>
        android:layout_height=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>match_parent</span><span style='color:#2a00ff; '>"</span>
        <span style='color:#7f0055; '>></span>
        <span style='color:#7f0055; '>&lt;</span><span style='color:#7f0055; '>ImageView</span> android:id=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>@+id/icon</span><span style='color:#2a00ff; '>"</span>
            android:layout_width=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>@dimen/notification_large_icon_width</span><span style='color:#2a00ff; '>"</span>
            android:layout_height=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>@dimen/notification_large_icon_height</span><span style='color:#2a00ff; '>"</span>
            android:background=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>@android:drawable/bg_tile</span><span style='color:#2a00ff; '>"</span>
            android:scaleType=<span style='color:#2a00ff; '>"</span><span style='color:#2a00ff; '>center</span><span style='color:#2a00ff; '>"</span>
            <span style='color:#7f0055; '>/></span>
    
    <span style='color:#7f0055; '>&lt;/</span><span style='color:#7f0055; '>LinearLayout</span><span style='color:#7f0055; '>></span>
    </pre>
    

    It looks like this:

    enter image description here