- 帖子
- 96
- 积分
- 110
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2013-9-3
|
[文本处理] 批处理如何删除/去除xml文件中指定位置/特征的字符串/行内容(元素/节点)?
我这里有两个xml文件:plurals.xml;choose_lock_pattern_tutorial.xml。
它们的内容分别为:
plurals.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="uninstall_dialog_title_format">
<item quantity="other">Uninstall "%1$s" and %2$d other apps?</item>
<item quantity="one">Uninstall \"%s\"</item>
<item quantity="two">Uninstall \"%s\" and 1 other app?</item>
</plurals>
<plurals name="uninstall_result_succeeded">
<item quantity="other">%1$ apps uninstalled</item>
<item quantity="one">App uninstalled</item>
</plurals>
<plurals name="uninstall_result_failed">
<item quantity="other">Couldn't uninstall "%1$s" and %2$d other apps</item>
<item quantity="one">"Couldn't uninstall \"%s\""</item>
<item quantity="two">"Couldn't uninstall \"%s\" and 1 other app"</item>
</plurals>
</resources>
choose_lock_pattern_tutorial.xml:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient android:gravity="center_horizontal" androidrientation="vertical" android:id="@id/topLayout" android:background="@drawable/lock_pattern_background" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="96.0dip">
<TextView android:textAppearance="?android:textAppearanceLarge" android:id="@id/headerText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/lock_intro_message" />
</ScrollView>
<com.android.internal.widget.LockPatternView android:id="@id/lockPattern" android:layout_width="354.0dip" android:layout_height="354.0dip" android:layout_marginTop="80.0dip" aspect="square" />
<View android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_alignParentRight="true" style="@style/SecurityPreferenceButtonContainer">
<Button android:id="@id/skip_button" android:text="@string/lockpattern_tutorial_cancel_label" style="@style/SecurityPreferenceButton" />
<Button android:id="@id/next_button" android:text="@string/lockpattern_tutorial_continue_label" style="@style/SecurityPreferenceButton" />
</LinearLayout>
</RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
我是想用批处理删除这两个文件里带红色的字符串,又麻烦大大帮个忙呀!谢谢了。 |
|