我无法理解为什么GWT不接受在XSL中声明如下的变量:
<html>
<head>
<title>Form</title>
<script type="text/javascript">
function validate()
{
if(document.getElementById("city").value=="-1")
{
alert('Please select a city');
return false;
}
else if (document.getElementById('day').value=='')
{
alert('Please provide date for D.O.B');
document.getElementById("day").style.borderColor="red";
document.getElementById("day").style.backgroundColor="yellow";
document.getElementById("day").style.borderWidth=2;
return false;
}
else if (document.getElementById('month').value=='')
{
alert('Please provide month for D.O.B');
document.getElementById("month").style.borderColor="red";
document.getElementById("month").style.backgroundColor="yellow";
document.getElementById("month").style.borderWidth=2;
return false;
}
else if (document.getElementById('year').value=='')
{
alert('Please provide year for D.O.B');
document.getElementById("year").style.borderColor="red";
document.getElementById("year").style.backgroundColor="yellow";
document.getElementById("year").style.borderWidth=2;
return false;
}
}
</script>
<body>
<form >
City : <select id="city">
<option value="-1">-~Select One~-</option>
<option>City 1</option>
<option>City 2</option>
<option>City 3</option>
<option>City 4</option>
<option>City 5</option>
</select>
<br>
Date of Birth:
Day
<input type="number" name="day" id='day' min="1" max="31" value="" required>
Month
<input type="number" name="month" min="1" id='month' max="12" value="" required>
Year
<input type="number" name="year" min="1950" id='year' max="2020" value="" required>
<input type="submit" value="Login" onclick="return(validate());"
</form>
</body>
</html>
我得到的错误:
'在“fo:block-container”上遇到无效属性:write-mode(没有可用的上下文信息)'
brew install something
有什么想法吗?谢谢。
答案 0 :(得分:0)
修正了它。使用写模式选项时出现了拼写错误:
而不是
write-mode="{$writeMode}"
应该是
writing-mode="{$writingMode}".
当然,我将变量值分配重命名如下:
<xsl:variable name="writingMode">
<xsl:if test="$langue='fa'">
<xsl:value-of select="'rl-tb'"/>
</xsl:if>
</xsl:variable>
因为默认值是lt-tb。 HTH