[英]How to read xml attribute with colon in Powershell
给定一个xml,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="SOMETHING.Presentation.Mobile.Droid" android:installLocation="auto" android:versionName="1.13.0" android:versionCode="15">
<uses-sdk android:minSdkVersion="15" />
<permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" />
<application android:label="SOME_NAME" android:largeHeap="true">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="SOMETHING" />
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="SOMETHING.Presentation.Mobile.Droid" />
</intent-filter>
</receiver>
</application>
</manifest>
我正在尝试使用Powershell脚本来重写它。
当我搜索这样的包时:
$package = $xdoc.manifest.package
我得到它“ SOMETHING.Presentation.Mobile.Droid”
当我搜索android:label( <application android:label="SOME_NAME" android:largeHeap="true">
)时,我什么也没得到
我尝试不成功:
如何用“冒号”指向属性?
尝试这个 :
$xml.manifest.application.label
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.