EzXML.jl
EzXML.jl copied to clipboard
API changes towards EzXML.jl 1.0 on Julia 1.0.
Some of these changes will need features introduced in Julia 1.0.
Properties
- Add node properties:
type
,path
,name
,content
,namespace
(#54). - Add document properties:
root
,dtd
(#54). - Add tree traversal properties:
document
,parentnode
,firstelement
,lastelement
,nextelement
,prevelement
,firstnode
,lastnode
,nextnode
,prevnode
(#56).
All these properties return a nothing
when it has no corresponding property.
XPath
- Rename
find
tofindall
(#55). - Make
find*
function take an XPath query as the first argument (#55). - Make
findfirst
andfindlast
returnnothing
when there is no such node (#57).
This is because the interface of find*
has changed in Julia 1.0.
StreamReader
- ~Introduce the
ReaderEvent
type.~ - Add some properties:
type
,depth
,name
,content
,namespace
(#58). - ~Add an attribute accessor to
ReaderEvent
(e.g.event["attr"]
).~ - ~Iterate over reader events; not over
ReaderType
s.~
Misc.
- Update docs.
- Drop Julia 0.6.
- Drop Julia 0.7.
Will the accessor functions be deprecated in favor of properties? 😟
Yes, I plan to do that because properties do not import so many names into the current module. Any objections against it?
Yes, I'm very, very much against that. The names this package uses are unlikely to create any conflict, so I don't see why exporting a lot of things would matter.
But I think using properties looks nice for accessing some properties (e.g., node name) and offering multiple ways to do the same thing is not elegant. So, I concluded that deprecating accessor functions would be better.
I disagree that it looks at all better; I think it looks much less like Julia and more like Python. Things like primates.firstelement.prevelement
were what I was most worried about proliferating once getproperty
was introduced.
I disagree with you. node.firstelement.prevelement
looks better than prevelement(firstelement(node))
to me because you don't need to read/write the code from right to left in this case. I think method chaining is not a Julian way but property chaining just looks so good as field chaining as we already do when handling nested structs.
I'll be taking care of some of this in order to get EzXML working on Julia 1.0