(Minor) Warning about ambiguous rule match in scrub.xsl
scrub.xsl
produces a warning about an ambiguous rule match. The two templates with overlapping match patterns have the same content, so there is no doubt that the output is correct. However, it would be nice to avoid the warning.
Warning
XTDE0540: Ambiguous rule match for /html/body[1]/div[1]/p[130]/noProof[1]/div[1]/p[2]
Matches both
"element(Q{http://www.w3.org/1999/xhtml}p)//element()[(empty((docOrder(docOrder(descendant::element()))) except (((((docOrder(docOrder(descendant::element(Q{http://www.w3.org/1999/xhtml}tab)))) | (docOrder(docOrder(descendant::element(Q{http://www.w3.org/1999/xhtml}span))))) | (docOrder(docOrder(descendant::element(Q{http://www.w3.org/1999/xhtml}b))))) | (docOrder(docOrder(descendant::element(Q{http://www.w3.org/1999/xhtml}i))))) | (docOrder(docOrder(descendant::element(Q{http://www.w3.org/1999/xhtml}u))))))) and (not(string(.)))]" on line 56 of [path...]/XSweet-core/scripts/../applications/docx-extract/scrub.xsl
and "element(Q{http://www.w3.org/1999/xhtml}p)//element()[not(matches(convertUntyped(data(.)), "\S", ""))]" on line 46 of [path...]/XSweet-core/scripts/../a
The templates in question have these match
patterns:
- Line 46:
p//*[not(matches(.,'\S'))]
(maybe change it top//*[string(.) and not(matches(.,'\S'))]
?) - Line 56:
p//*[empty(.//* except (.//tab|.//span|.//b|.//i|.//u)) and not(string(.))]