Okay, newest commit this morning refactored all of those [0]s out.



From: Jack LaBarba [mailto:notifications@github.com]
Sent: Wednesday, January 15, 2014 5:09 PM
To: PLOS-Web/xmlgroomer
Cc: Kevin Brandt
Subject: Re: [xmlgroomer] Groom update (#18)


In xmlgroomer.py:

> +    Last If statement checks for 'ppub' element, and removes it if it exists.

> +    '''

> +    global output

> +    year = get_singular_node(root, "//pub-date[@pub-type='epub']/year")

> +    if root.xpath("//pub-date[@pub-type='collection']"):

> +        for coll in root.xpath("//pub-date[@pub-type='collection']"):

> +            if root.xpath("//journal-title-group/journal-title")[0].text == "PLoS ONE":

> +                if coll.xpath('month'):

> +                    mo = get_singular_node(coll, 'month')

> +                    mo.getparent().remove(mo)

> +                    output += "correction: removed month from collection tag\n"

> +            if coll.xpath('year'):

> +                pub_val = year.text

> +                xml_val = coll.xpath('year')[0].text

> +                if xml_val != pub_val:

> +                    coll.xpath('year')[0].text = pub_val

get_singular_node()

—
Reply to this email directly or view it on GitHub<https://github.com/PLOS-Web/xmlgroomer/pull/18/files#r8919593>.