1

How do I put a colon character into an XML property Powershell, using SetAttribute? Something like this:

android:hardwareAccelerated = true

1 Answer 1

4

You pass the URI for the namespace that corresponds to the "android:" prefix.

If your XML looked like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.package.name"
      android:versionCode="2"
      android:versionName="1.1">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
    </application>
</manifest>

(You really should have provided the XML in your question, by the way, instead of making us look it up.)

Note the xmlns:android="http://schemas.android.com/apk/res/android".

Then you can set the attribute by passing that URI:

$myXml.manifest.application.SetAttribute(
    'hardwareAccelerated', 
    'http://schemas.android.com/apk/res/android', 
    'true')
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.