Exmaralda-Org / exmaralda

26 stars 15 forks source link

Use of apostrophes in Key Names #10

Open berndmoos opened 8 years ago

berndmoos commented 8 years ago

COMA allows the use of apostrophe's in key names (i.e. you can enter apostrophes in the descriptions table, like: Father's profession), but these apostrophes cause trouble. For instance, you cannot select a key name with an apostrophe to be deisplayed as the second column. This is probably because apostrophes are not allowed in XML attribute values. Users should probably be prevented from entering them in the first place.

berndmoos commented 8 years ago

org.exmaralda.coma.models.CommunicationTableModel.setSecondColumn(CommunicationTableModel.java:114)

Herrner commented 7 years ago

The problem also effective with values, since the xpaths are generated directly from the string entered. Don't know how to deal with this yet.

daniel-jettka commented 7 years ago

Part of the problem could be caused here, or it might at least be an indicator for the general problem: https://github.com/EXMARaLDA/exmaralda/blob/master/src/org/exmaralda/coma/filters/ComaFilter.java#L273

The complete XPath is split by single quote to generate the display name for the filter. This method does not work properly if single quotes are used as part of values in the XPath, e.g. if the XPath is changed manually in Coma filter to (two single quotes '' often used to represent single quote in an XPath value): [node()[contains(.,'Krasnosel''')]] which is displayed as [Krasnosel] []

Proposed solution: show complete XPath instead of display name