Dave Brosius wrote:
I have a class that implements an xsd enforcer, ie, it makes sure that an
xml instance follows a schema, and if it doesn't makes corrections in the
instance until it does. Most of that works fine, however i'm having a
problem where if a new simple content element needs to be inserted, because
it is missing in the instance, i don't know what value to give the text
node.
I couldn't find any way to specify 'fixed' or 'default' values for text
in a
schema definition, like you can with attributes. Is this true?
If so, how would you suggest doing this? Can i add processing instructions
into the xsd file? Is that rational?
This really isn't the appropriate list for a question about XML Schema.
Any ideas, Thanks!
Why can't you just used the "default" attribute in the element declaration?
<xs:element name="foo" type="xs:string" default="blah"/>
Dave