[xsd-users] Skip writing the default values of attributes to the XML file

Noel Farrugia noel.farrugia at outlook.com
Thu Jul 3 10:06:20 EDT 2014


Dear Sir/Madam,
 
I am a new user to CodeSynthesis XSD and I managed to read and write to the XML file without any problems. However now I'm building an application and the XSD file has optional attributes that have a default value, for example:
 
<xs:attribute name="Age" use="optional" default="0">
 
Now I want to write to the XML file however I do not want to write attributes with default values into the file.
This can be achieved by removing the default value, for example:
 
<xs:attribute name="Age" use="optional">
 
however I cannot use this method since this will require for the modification of the XSD file and will create compatibility problems with previous versions of my application.
 
I tried to search online for a solution but to no avail.
 
Thanks a lot for your time. Hoping to hear from you soon.
 
Regards,
Noel Farrugia
 
 
 		 	   		  


More information about the xsd-users mailing list