This really isn't the appropriate list for a question about XML Schema.

*blush* Ha! that's true! Sorry all for the interruption. I'm using transforms in the code, and forgot
that the real question wasn't about xalan. oops.

Why can't you just used the "default" attribute in the element declaration?

again. stupid me. yes of course. I was looking at the <xsd:simpleType> definition for one.

thanks again.
-dave

----- Original Message ----- From: "David Bertoni" <[EMAIL PROTECTED]>
To: <xalan-j-users@xml.apache.org>
Sent: Thursday, January 26, 2006 9:25 PM
Subject: Re: specifying default values for text nodes


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



Reply via email to