std.xml empty element

Jesse Phillips jessekphillips+D at gmail.com
Thu Feb 24 07:38:16 PST 2011


Tom Wrote:

> Hi, how can I create an empty element with current D2 std.xml Element 
> implementation?
> 
> stdout.writeln(new Element("foo")); // Shields <foo></foo> instead of 
> <foo />
> 
> Thanks in advance,
> Tom;

One issue with this is that you can not determine what can be shortened to this form without a DDT. It is only valid if it is specified to be legal in the DDT. Though I think it might only be the case for v1.0 and not v1.1.



More information about the Digitalmars-d-learn mailing list