2

Given an xml, something like this:

<?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>

I'm trying to use a powershell script to rewrite it.

when I search for package like this:

$package = $xdoc.manifest.package

I get it "SOMETHING.Presentation.Mobile.Droid"

when I search for android:label (<application android:label="SOME_NAME" android:largeHeap="true">) I get nothing

I tried with non success:

  • $xdoc.manifest.application.android:label
  • $xdoc.manifest.application.android.label
  • $xdoc.manifest.application.[android:label]
  • $xdoc.manifest.application.[android.label]
  • $xdoc.manifest.application.{android.label}
  • $xdoc.manifest.application.{android:label}

How to point to attribute with "colon"?

5
  • 1
    Drop android: namespace and simply access .label Commented Jun 17, 2017 at 15:43
  • it works thak you very much! Commented Jun 17, 2017 at 15:45
  • @wOxxOm care to explain why? Commented Jun 17, 2017 at 16:06
  • welp, what to search for at least? Commented Jun 17, 2017 at 16:22
  • @4c74356b41, hmm, I guess something general like "XML namespace attribute syntax". I'm just not knowledgeable enough to point in the right direction compared to these guys XML Default namespaces for unqualified attribute names? Commented Jun 17, 2017 at 17:54

1 Answer 1

3

try this :

$xml.manifest.application.label
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.