Re: [xmlenc-devel] VOID_WITHIN_ELEMENT and short-circuiting
Brought to you by:
znerd
From: Ernst de H. <zn...@Fr...> - 2003-01-13 07:38:51
|
> I disagree. I think the <tag attr="value"/> pattern is a real plus. It > shortens the length of the XML file considerably, especially if you use > this form a lot (I do) and if the "tag"s you use it with are long (many > of mine are). Keep in mind that most people will use XMLOutputter to > write to disk, and the time involved in disk writes will far outweigh > the time spent doing some logic to see what type of closing tag is > necessary. You'll have a more efficient outputter if you output shorter > XML, and I know efficiency is a primary design goal here. The following code: startTag("html"); attribute("lang", "en"); pcdata(""); endTag(); will produce: <html lang="en"></html> while this code: startTag("html"); attribute("lang", "en"); endTag(); still produces: <html lang="en"/> So the short form is still supported, but it won't be used when zero-length text is outputted using pcdata("") or whitespace(""). > Anyway, I think that at the level of XMLOutputter you should just output > whatever is sent. Omitting comments or elements if empty should probably > be handled at a higher level (the classes Henri is working on). Agreed. Ernst -- Ernst de Haan Development Team Leader Wanadoo Nederland B.V. The Lord has truly risen! Merry Christmas and a blessed New Year! |