Skip to content

position wrong newline #16

@jonny64

Description

@jonny64

pos has already advanced past the current token when linePos is called (via next() doing this.pos += length

  node -e "
    const P = require('./lib/XMLParser'),
      X = require('./lib/XMLSchemata'),
      Path = require('path');
    const xs = new X(Path.join(__dirname, '__data__', 'sequence.xsd'));
    try {
      new P({xs}).process('<ns:client xmlns:ns=\"http://tempuri.org/\">\n<ns:INVALID>x</ns:INVALID>\n</ns:client>');
    } catch (e) {
      console.log(e.message);
    }
  "

Actual: ... at line 2, position 13 (end of ns:INVALID)
Expected: ... at line 2, position 1 (start of ns:INVALID)

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