Matthew Newton wrote:
Having empty attributes replaced by "_" could be incredibly annoying depending on the circumstance. But then I hope I'd also have the sense to check what I'm doing to make sure that if an attribute did end up empty it was handled correctly.
Not everyone does that. I think being fail-safe is best.
And what happens if an attribute actually has the value "_"? Unlikely I guess, but possible?
It's possible.
Couldn't it just be configurable? Something just like
xlat_empty_attribute = "_"
for default, but could be set to any string? Gives some possible protection by default, but can be overridden if needed in a global way.
The alternative is to fail the expansion entirely, and return an error. That is MUCH preferable to silently expanding to an empty string. I'll let people here decide. Alan DeKok.