Skip to content

Stream fails to parse if XML file contains a leading BOM character #117

@edds

Description

@edds

If an XML file contains a leading BOM Saxy fails to parse the file.

iex(1)> xml = "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"><foo bar='value'></foo>"
iex(2)> Saxy.parse_string(data, MyEventHandler, [])
"Start parsing document"
{:error,
%Saxy.ParseError{
  reason: {:token, :lt},
  binary: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"><foo bar='value'></foo>",
  position: 0
}}

I'm seeing this when using ExCmd to stream a gziped file into Saxy and can't see any obvious way of stripping it out before passing the stream to Saxy.

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