translatable-exegetical-tools / Abbott-Smith

Abbott-Smith's Manual Greek Lexicon
31 stars 19 forks source link

XML correctness of having 2 different n="Hxxxx" subclauses within one foreign tag-pair #86

Closed destatez closed 7 years ago

destatez commented 7 years ago

Our XML "Editor" / viewer flagged the instance of the subject line as an error. The XML line is shown in the attached file. Is this really an XML error? @cbearden

Possible_Issues.txt

cbearden commented 7 years ago

I’m afraid one of the rules of XML well-formedness is that you can have only one attribute with a particular name (e.g. ‘n’) per element, so you can’t have multiple ‘n’ attributes.

A number of other well-formedness errors have crept in, I’m afraid. I’m at work, so I don’t have time to review them all or where they were merged in.

I apologize if you already know this, but there are two levels of correctness in XML files, much like with program source code:

Just as a compiler will choke on C where statements aren’t terminated with semicolons, or on a Python program that isn’t correctly indented, an XML parser will refuse to parse a document that isn’t well-formed. So think of having multiple attributes with the same name on a single element as being like a Java ‘if’ statement that doesn’t enclose multiple conditional statements in the body in curly braces.

One solution would be to put all the ‘n’ values in a single ‘n’ attribute, separated by commas or spaces or some other unambiguous separator. The downstream software that uses the XML would need to know what to do with these values. If you want the document to be XML, the only other option is to drop all but one ‘n’ attribute.

destatez commented 7 years ago

I updated the XML to combine the multiple n-values into a single n-value