Hi Paul,

Just to expand on Bob's posting a bit:

Yes, I think you can specify default values if an element has a
complexType, if that complexType is mixed.  The default value would appear
first in the resulting content model (before the first element child); or
at least that's my reading.

I think the Primer is right that minOccurs="0" precludes use of default;
but I couldn't put my finger on the place where this is specified at the
moment.

I addressed your second question in my post to Bob, and I think Bob took
care of your third question.

Right now, Xerces from CVS supports default/fixed values for elements with
simpleTypes.  Support of these attributes for mixed content models will be
added shortly after we have proper handling of such models in XML Schema
(which should happen soon).  Any alpha-testing you could do would be
greatly appreciated!

Hope that helps,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  [EMAIL PROTECTED]



Paul Jakubik <[EMAIL PROTECTED]> on 04/11/2001 02:26:44 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: default values for elements


A couple more questions about defaults. Is it possible
to provide a default value for a complex type? Is this
allowed by the Schema PR? Will Xerces 1.4 support it?

--Paul

--- Paul Jakubik <[EMAIL PROTECTED]> wrote:
> I have been looking at the Schema PR trying to
> figure
> out exactly what the behavior should be when a
> default
> value has been specified for an element. My real
> interest is how should I expect Xerces 1.4 to
> behave.
> Here are the things that I am most confused about.
>
> 1) Is it legal to specify a default value for an
> element whose minOccurs is anything other than 0?
> The
> primer says that this is an error, but I did not see
> anything in the structure document saying this is an
> error.
>
> 2) When exactly is the default value used? Is it
> only
> when the element does not appear at all? Is it also
> used when the element appears, but is empty?
>
> 3) What is considered an empty element? Are any of
> the
> following Foo elements empty?
>    <Foo/>
>    <Foo></Foo>
>    <Foo> </Foo>
>
> If someone can point me to the right places in the
> Schema PR to get definitive answers to these I'd
> appreciate it. If someone can tell me what Xerces
> 1.4's answers to these questions will be, even
> better.
>
> --Paul
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to