问题描述
我想在Android XML转换成的plist,但我所面临的问题,因为Android的XML包含属性名冒号如下:
I am trying to transform the android xml into Plist but i am facing the issue because the Android XML contains COLONS in the attribute names as follows:
<PreferenceCategory android_title="Identity" >
<EditTextPreference
android:key="systemname"
android_title="System Name" />
</PreferenceCategory>
所以,当我尝试使用XSLT它提供了以下错误读取属性值:
So when i try to read the attribute value using XSLT it gives the following error:
XPath evaluation returned no result.
我有点新的XSLT,所以任何一个可以帮助我看完上述具有在其名称中冒号的属性值。
I am bit new to XSLT, So can any one help me reading the attribute value which have colon in their names as mentioned above.
推荐答案
我使用排除-result- prefixes 在XSLT里面的属性进行管理。
我的样式表标签看起来像下面。
I managed by using the exclude-result-prefixes attribute inside in XSLT.My stylesheet tag looked like below.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:android="http://schemas.android.com/apk/res/android"
exclude-result-prefixes="android">
排除-result- prefixes 使用属性,如果你想在编译时排除任何命名空间。
exclude-result-prefixes attribute is used if you want to exclude any namespace during compile time.
这篇关于XSLT:冒号在属性名中源XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!