Okay, so when I save a document with a blank attribute like this.
It comes out looking like this.Code:<Attrib></Attrib>
Is there any way to prevent this?Code:<Attrib>
</Attrib>
Printable View
Okay, so when I save a document with a blank attribute like this.
It comes out looking like this.Code:<Attrib></Attrib>
Is there any way to prevent this?Code:<Attrib>
</Attrib>
I don't know if there is anyway to prevent it, but if the element is empty you could also use
Code:<Attrib/>
That's a negative, it won't work that way for the situation I'm in.
Nothing? Are you serious?
First, that is an element, NOT an attribute.
Second, if your code does not work with all variations equally well, then you are not standards compliant.
With increasing processing happening to XML content at varying levels, we are seeing more and more variations in format. Providing data contains (or references) a valid schema, and conforms to that schema, NOTHING else should matter.
There are a number of "fuzzing" tools available (they make psuedo random changes to your data that do NOT impact the schema) to help test this aspect.
Well, I seem to have found a solution. I set PreserveWhitespace to true (or false) and it made the document all one line.
It turns out, that the other program that reads the Xml, the file doesn't need to be fancy.