2012-11-17 37 views
-1

XSL:恢復的錯誤,同時運行XSL

<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" exclude-result-prefixes="wp wne w10 w ve o r m v" version="2.0"> 

<xsl:output method="text"/> 
<xsl:param name="styleName"/> 
<xsl:template match="w:p"> 
    <xsl:apply-templates/><xsl:text>&#10;</xsl:text> 
</xsl:template> 

<xsl:template match="w:r[not 
      ((parent::w:hyperlink[@w:anchor[matches(.,concat('^(',$styleName,')')),'i']]))]"> 
    <xsl:value-of select="replace(., '.', '&#xFF00;')"/> 
</xsl:template> 
</xsl:stylesheet> 

在處理上面的XSL,我收到以下錯誤,

可恢復錯誤:

Recoverable error on line 11 
    FORG0006: An error occurred matching pattern {w:r[not    
    ((parent::w:hyperlink[@w:anchor[matches(.,concat('^(',$styleName,')')),'i']]))]}: 
    Effective boolean value is not defined for a sequence of two or more items starting with a boolean 

請幫助。我無法弄清楚這一點。

+2

我不能重現這個問題,用Saxon 9.1.07運行代碼。可能是因爲你沒有指定你的源XML文檔? –

回答

0

問題出在'i'[添加修飾符以執行不區分大小寫的搜索],它是在matches()方法之後指定的。