citation-style-language/styles — pull request #1134 by rmzelle (2014-09-21 00:44:05+00:00)
Title: Add "match" attribute in ambiguous cases

I checked all `` and `` elements. If the element doesn't carry the "match" attribute, and carries multiple test attributes and/or has at least one test attribute that contains a space, `match="any"` is added to the element.

I used the following snippet in csl-reindenting-and-info-reordering.py:

```
#test all cs:if and cs:else-if elements
#for those elements without "match", but with either a space in one of the
#conditional values, or with multiple conditionals, add "match" set to "any"
try:
ifElements = styleElement.findall(".//{http://purl.org/net/xbiblio/csl}if")
elseifElements = styleElement.findall(".//{http://purl.org/net/xbiblio/csl}else-if")

ifElements = ifElements + elseifElements

for ifElement in ifElements:
ifElementAttribs = ifElement.attrib
if not("match" in ifElementAttribs):
if(len(ifElementAttribs)>1):
ifElement.set("match","any")
else:
for ifElementAttrib, ifElementAttribValue in ifElementAttribs.iteritems():
if(" " in ifElementAttribValue):
ifElement.set("match","any")
except:
pass
```