Future API Requests or Suggestions #84
Replies: 11 comments
-
@drmohundro: this looks really good. I'm very pleased that XPath support has made it onto this list. XPath is extremely versatile and would greatly enhance the power of this library! |
Beta Was this translation helpful? Give feedback.
-
@DanielAsher well, as I said, I haven't even started on it. I won't rule it out completely, but it is good to know that there is interest - knowing that helps me know which things to prioritize :) |
Beta Was this translation helpful? Give feedback.
-
FYI, I thought about this quite a bit and decided that it made more sense to have a separate API-breaking release than doing it along side Swift 3.0. My thought process was basically - everyone is already doing a lot of source changes. It will be easier on them if they don't have to chase down API changes on top of language changes. (I'm probably a little too conservative with breaking changes... hope everyone can be patient with me!) |
Beta Was this translation helpful? Give feedback.
-
suggestion: could .value() return a valid empty value if the node doesn't have a value for the next API update? for example -> '' / 0 im currently using .element.text to avoid exceptions. |
Beta Was this translation helpful? Give feedback.
-
@useitsoftware I like the idea... I'm certainly a fan of not throwing exceptions all the time and some XML can be inconsistent. I'm not sure if the behavior should totally change or if a new config should be added (e.g. |
Beta Was this translation helpful? Give feedback.
-
What about extending the For example:
If I don't supply the |
Beta Was this translation helpful? Give feedback.
-
👍 good thought @gca3020 - I like that a lot. |
Beta Was this translation helpful? Give feedback.
-
FYI, (once again), some of the above features did not make it into I did try spiking out some of the code around merging Outside of that, I can't see why adding a |
Beta Was this translation helpful? Give feedback.
-
Small suggestion: |
Beta Was this translation helpful? Give feedback.
-
Are there any plans to be able to write to XML? Cheers. |
Beta Was this translation helpful? Give feedback.
-
Hi @transat - likely not any time soon. I wouldn't be opposed to adding that functionality, but there'd have to be a significant effort in terms of coming up with a good API design that feels natural. I can think about what it would look like to support changing individual elements at an index level, but I don't know about building a completely new XML document. The serialization support would probably be the best, but I'd want to ensure that serialization wasn't required. |
Beta Was this translation helpful? Give feedback.
-
Because Swift 3.0 will be releasing soon, I'll also have to release a new and breaking version of SWXMLHash that will be versioned as 3.0.0 (in keeping with semantic versioning).
So... this seems as good a time as any to elicit feedback regarding improvements, suggestions, etc. particularly related to potential changes in the public API. I don't want to go nuts, but I'm open to improvements.
Some API-related thoughts I've had or gathered from other issues:
attributes
collection anywayXMLAttribute
) such that there would be an extension point for things like type conversion versus hanging extensions off ofString
children
properties consistentchildren
property onXMLElement
public because thechildren
property ofXMLIndexer
didn't returnTextElement
s.XMLElement
andTextElement
to be enumsXMLElement
, etc. inXMLIndexer
element
firstIn addition, there is the feature request to support XPath at #9... I don't necessarily see this making it in time for 3.0 as I haven't even looked at it yet 😄
Beta Was this translation helpful? Give feedback.
All reactions