Closed tkelman closed 9 years ago
xp_parse(open(readall, "repomd.xml"))
ought to work. xp_parse takes in a string.
duh, thanks, I'm misreading what WinRPM is calling xp_parse
on
julia> xml = xp_parse(readall("repomd.xml"));
julia> xml[xpath"/repomd/data[@type='primary']"]
ERROR: type: instantiate_type: expected TypeConstructor, got Type{(Any...,)}
works on 0.4 but not 0.3
Where did this come from?
julia> using LibExpat
julia> LibExpat.Tuple
(Any...,)
Since Base is automatically available, all exported entities from Base are available in all modules.
julia> using JSON
julia> JSON.Tuple
Tuple
I think the problem is due to how @compact
is resolving Tuple{Symbol,Any}
on 0.3
yeah, about to submit a PR which should fix this
this is what I was seeing in 0.3:
julia> macroexpand(:(xpath"/repomd/data[@type='primary']"))
:((LibExpat.XPath{ASCIIString,Array{ETree,1}})((:xpath,LibExpat.push!(LibExpat.push!(LibExpat.push!(LibExpat.push!(LibExpat.push!(LibExpat.push!(LibExpat.Array(LibExpat.Tuple{LibExpat.Symbol,LibExpat.Any},0),(:root,:node)),(:child,:element)),(:name,"repomd")),(:child,:element)),(:name,"data")),(:filter,(:binop,(:(=),(:xpath_str,LibExpat.push!(LibExpat.Array(LibExpat.Tuple{LibExpat.Symbol,LibExpat.Any},0),(:attribute,"type"))),(:string,"primary"))))))))
The xml file looks okay here from a visual inspection (https://gist.github.com/392165b87c4139e4ce23, libxml2/LightXML also parse it okay), is expat wrong?
On Windows I get a slightly different error, "not well-formed (invalid token), 1, 3, 3".