Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm struggling to get an XPath defined to return the value of the uniqueappversionid from the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<manifest package="air.com.vzw.Foo" 
          android:versionCode="0" 
          android:versionName="0.0.0" 
          android:installLocation="auto"
          xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:label="FooAIR">
        <meta-data android:name="autoOrients" android:value="true" />
        <meta-data android:name="fullScreen" android:value="false" />
        <meta-data android:name="uniqueappversionid" 
                   android:value="b1e1bfa8-20b4-4724-a9c3-34b79bc50b8d" />
        <meta-data android:name="initialcontent" android:value="FooAIR.swf" />
    </application>
</manifest>

More specifically, I need to get the value of the android:value attribute from the meta-data element with a android:name equal to uniqueappversionid.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
996 views
Welcome To Ask or Share your Answers For Others

1 Answer

With a prefix bound to http://schemas.android.com/apk/res/android namespace:

/manifest
   /application
      /meta-data[@a:name='uniqueappversionid']
         /@a:value

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...