Skip to content

RegEx does not always find correct start of an attribute #2

@MrBeee

Description

@MrBeee

I'm using QGIS an Open-Source GIS application, that allows you to write a Coordinate Reference System (CRS) to a QDom element, using its WriteXml() function. This produces a WKT string that QCodeEditor incorrectly interprets as the start of an xml attribute. The reason for this is (I believe) that the start of an xml-attribute is simply determined by QRegExp("""). Instead, the expression should first look back one character, to check if this double quote has been preceded by an '=' sign. If not, then the attribute hasn't started yet. Please have a look at the attached xml snippet and load it in QCodeEditor to see what I mean. Please note that I don't use text wrapping in my QCodeEditor widget.

Cheers, Bart

xml-snippet.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions