Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error when writing content with extensions #191

@helmut8080

Description

@helmut8080

It seems that as soon as I have something like

<extensions><system-message></system-message></extensions>

for example in <trk>...</trk> I get "javax.xml.stream.XMLStreamException: Trying to declare prefix "xmlns" (illegal as per NS 1.1 #4)".

See files below "WithoutExtension.txt" (can not upload ".gpx") when read and write again works. "WithExtension.txt" raises error.

GPX.Reader r = GPX.Reader.of(Version.V11, Mode.LENIENT);
GPX gpxWO = r.read(Path.of("WithoutExtension.txt"));
GPX.write(gpxWO, Path.of("rewriteWoE.gpx"));
GPX gpxW = r.read(Path.of("WithExtension.txt"));
GPX.write(gpxW, Path.of("rewriteWE.gpx")); //Error: javax.xml.stream.XMLStreamException: Trying to declare prefix "xmlns" (illegal as per NS 1.1 #4)

WithExtension.txt
WithoutExtension.txt

Thanks.

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