我想使用条件进行XSLT转换以找到某个值。
我的XML文件摘录如下:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="sample.xslt"?>
<ValuesList>
<Values ID="ZLOV1FD23146" ParentID="ZLOV1GR00001" AllowUserValueAddition="true" UseValueID="false">
<Name QualifierID="std.lang.all">MG1_01 USP [MPRD]</Name>
<Validation BaseType="text" MinValue="" MaxValue="" MaxLength="511" InputMask=""/>
<Language DimensionID="Language"/>
<ValueGroup>
<Value QualifierID="lang_ZPIM1ID">ABC</Value>
<Value QualifierID="std.lang.all">minimised recess depth enables use in ceilings with compact space</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">DEF</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="lang_ZPIM1ID">ASD</Value>
<Value QualifierID="std.lang.all">qwer</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">FGH</Value>
<Value QualifierID="lang_ZPIM1ID">dfghy</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">RST</Value>
</ValueGroup>
</Values>
<Values ID="ZLOV1FDsdasda" ParentID="ZLOV1GR00002" AllowUserValueAddition="true" UseValueID="false">
<Name QualifierID="std.lang.all">MG1_01 USP [MPRD]</Name>
<Validation BaseType="text" MinValue="" MaxValue="" MaxLength="511" InputMask=""/>
<Language DimensionID="Language"/>
<ValueGroup>
<Value QualifierID="lang_ZPIM1ID">ABC</Value>
<Value QualifierID="std.lang.all">minimised recess depth enables use in ceilings with compact space</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">asdas</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="lang_ZPIM1ID">ASD</Value>
<Value QualifierID="std.lang.all">qwer</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">FGH</Value>
<Value QualifierID="lang_ZPIM1ID">dfghy</Value>
</ValueGroup>
<ValueGroup>
<Value QualifierID="std.lang.all">iyi</Value>
</ValueGroup>
</Values>
</ValuesList>
我需要创建sample.XSLT文件以满足以下条件:
我已经创建了XSLT文件,如下面的代码段,但不起作用:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ValuesList/Values/ValueGroup">
<xsl:text> ID | Value</xsl:text>
<xsl:text>
</xsl:text>
<xsl:if test="count(Value)='1' and Value/@QualifierID='std.lang.all'">
<xsl:value-of select="concat(//Values/@ID,' |',Value,'
')"></xsl:value-of>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
请帮助我......谢谢。
答案 0 :(得分:1)
你可以这样:
<强> EDITED 强>
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
}