XML Schema quiz on default values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Schema quiz on default values

Costello, Roger L.
Hello Folks,

Recall that when you declare an element (or attribute) you can give it a default value.

For example, I give the Altitude element a default value of 100:

        <xs:element name="Altitude" type="xs:integer" default="100" />

In an instance document, if you wish for Altitude to have the default value, then you can simply create it as an empty element:

        <Altitude></Altitude>

The value of Altitude is 100.

Let's take another example. Here I declare the Title element to be of type string and give it a default value, "Hello World":

        <xs:element name="Title" type="xs:string" default="Hello World" />

Now in my instance document I create an empty Title element:

        <Title></Title>

Quiz: What is the value of Title?

Scroll down to see the answer ...

























Answer: the value of Title is the empty string, not the default value. The reason is that the empty string is a valid value of the string data type. If you want Title to have the default value then you must explicitly enter the default value:

        <Title>Hello World</Title>

/Roger

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Michael Kay
Answer: the value of Title is the empty string, not the default value.
The reason is that the empty string is a valid value of the string data
type. If you want Title to have the default value then you must
explicitly enter the default value: <Title>Hello World</Title>

WRONG. The default applies when the element is empty, not when it is
invalid.

Michael Kay
Saxonica


Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Costello, Roger L.
In reply to this post by Costello, Roger L.

Hello Michael,

 

I am confused. The Title element is declared to be of type string, so a valid value of Title is a string of length zero, right? According to SAXON, that is the case.

 

/Roger

 

Answer: the value of Title is the empty string, not the default value.

The reason is that the empty string is a valid value of the string data

type. If you want Title to have the default value then you must

explicitly enter the default value: <Title>Hello World</Title>

 

WRONG. The default applies when the element is empty, not when it is

invalid.

 

Michael Kay

Saxonica

 

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

C. M. Sperberg-McQueen-2
In reply to this post by Costello, Roger L.

On Aug 23, 2012, at 3:47 PM, Costello, Roger L. wrote:

> Hello Folks,
>
> Recall that when you declare an element (or attribute) you can give it a default value.
> ...
>
> Let's take another example. Here I declare the Title element to be of type string and give it a default value, "Hello World":
>
> <xs:element name="Title" type="xs:string" default="Hello World" />
>
> Now in my instance document I create an empty Title element:
>
> <Title></Title>
>
> Quiz: What is the value of Title?...

> Answer: the value of Title is the empty string, not the default value. The reason is that the empty string is a valid value of the string data type. If you want Title to have the default value then you must explicitly enter the default value:
>
> <Title>Hello World</Title>



Why do you believe this?

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Michael Kay
In reply to this post by Costello, Roger L.
I've tried to explain it twice and I'm having difficulty finding a third way to express it.

The relevant rules are Validation Rule: Element Locally Valid (Element) clause 5 which says

5 The appropriate case among the following is true:
5.1 If D has a {value constraint}, and E has neither element nor character [children], and E is not ·nilled· with respect to D , then all of the following are true:
5.1.1 If E's ·governing type definition· is an ·instance-specified type definition·, then D.{value constraint} is a valid default for the ·governing type definition· as defined in Element Default Valid (Immediate) (§3.3.6.2).
5.1.2 The element information item with D.{value constraint}.{lexical form} used as its ·normalized value· is locally ·valid· with respect to the ·governing type definition· as defined by Element Locally Valid (Type) (§3.3.4.4).

and Schema Information Set Contribution: Element Validated by Type, [schema normalized value] and [schema actual value], in particular:

1.1 If clause 5.1 of Element Locally Valid (Element) (§3.3.4.3) above has applied, then (the [schema normalized value] is) the {lexical form} of the {value constraint}

The net effect of these rules is that the [schema actual value] of the element is taken from the default value given in the schema if and only if the element is empty (has no children). You seem to have convinced yourself that a different rule applies, something like

"the [schema actual value] of the element is taken from the default value given in the schema if and only if the supplied value is invalid"

but there is no basis for that in the specification.

Michael Kay
Saxonica


On 24/08/2012 00:51, Costello, Roger L. wrote:

Hello Michael,

 

I am confused. The Title element is declared to be of type string, so a valid value of Title is a string of length zero, right? According to SAXON, that is the case.

 

/Roger

 

Answer: the value of Title is the empty string, not the default value.

The reason is that the empty string is a valid value of the string data

type. If you want Title to have the default value then you must

explicitly enter the default value: <Title>Hello World</Title>

 

WRONG. The default applies when the element is empty, not when it is

invalid.

 

Michael Kay

Saxonica

 


Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Pete Cordell-5
In reply to this post by Costello, Roger L.
Hi Roger,

But the issue is not whether the empty string is valid or not for the
relevant type, but simply whether it's empty.  Translating the paragraph
that Ken mentioned into something more intelligible you get:

...In particular, an element with a
   [default value] whose simple type definition
   includes the empty string in its lexical space will
   nonetheless never receive that [empty string] value,
   because the [default value] will override it.

HTH,

Pete Cordell
Codalogic Ltd
Twitter: http://twitter.com/petecordell
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
----- Original Message -----
From: "Costello, Roger L." <[hidden email]>
To: <[hidden email]>
Sent: Friday, August 24, 2012 12:51 AM
Subject: Re: XML Schema quiz on default values


Hello Michael,

I am confused. The Title element is declared to be of type string, so a
valid value of Title is a string of length zero, right? According to SAXON,
that is the case.

/Roger

Answer: the value of Title is the empty string, not the default value.
The reason is that the empty string is a valid value of the string data
type. If you want Title to have the default value then you must
explicitly enter the default value: <Title>Hello World</Title>

WRONG. The default applies when the element is empty, not when it is
invalid.

Michael Kay
Saxonica



Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Pete Cordell-5
P.S. That should have said:

...In particular, an element with a
   _non-empty_ [default value]...

Pete Cordell
Codalogic Ltd
Twitter: http://twitter.com/petecordell
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
----- Original Message -----
From: "Pete Cordell" <[hidden email]>
To: "Costello, Roger L." <[hidden email]>; <[hidden email]>
Sent: Friday, August 24, 2012 9:14 AM
Subject: Re: XML Schema quiz on default values


> Hi Roger,
>
> But the issue is not whether the empty string is valid or not for the
> relevant type, but simply whether it's empty.  Translating the paragraph
> that Ken mentioned into something more intelligible you get:
>
> ...In particular, an element with a
>   [default value] whose simple type definition
>   includes the empty string in its lexical space will
>   nonetheless never receive that [empty string] value,
>   because the [default value] will override it.
>
> HTH,
>
> Pete Cordell
> Codalogic Ltd
> Twitter: http://twitter.com/petecordell
> Interface XML to C++ the easy way using C++ XML
> data binding to convert XSD schemas to C++ classes.
> Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
> for more info
> ----- Original Message -----
> From: "Costello, Roger L." <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, August 24, 2012 12:51 AM
> Subject: Re: XML Schema quiz on default values
>
>
> Hello Michael,
>
> I am confused. The Title element is declared to be of type string, so a
> valid value of Title is a string of length zero, right? According to
> SAXON, that is the case.
>
> /Roger
>
> Answer: the value of Title is the empty string, not the default value.
> The reason is that the empty string is a valid value of the string data
> type. If you want Title to have the default value then you must
> explicitly enter the default value: <Title>Hello World</Title>
>
> WRONG. The default applies when the element is empty, not when it is
> invalid.
>
> Michael Kay
> Saxonica
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: XML Schema quiz on default values

Costello, Roger L.
In reply to this post by Costello, Roger L.
Thank you Michael and Pete for correcting my misunderstanding.

Allow me to correct the answer to my quiz:

I wrote this as the answer to my quiz:

    >  Answer: the value of Title is the empty string, not the default value.
    >  The reason is that the empty string is a valid value of the string data type.

However, the correct answer is:

 Answer: the value of Title is the default value ("Hello World"). The XML Schema specification explains why:

    An element with a non-empty default value whose
    simple type definition includes the empty string in
    its lexical space will nonetheless never receive that
    empty string value, because the default value will
    override it.

/Roger


-----Original Message-----
From: Costello, Roger L.
Sent: Thursday, August 23, 2012 5:47 PM
To: [hidden email]
Subject: XML Schema quiz on default values

Hello Folks,

Recall that when you declare an element (or attribute) you can give it a default value.

For example, I give the Altitude element a default value of 100:

        <xs:element name="Altitude" type="xs:integer" default="100" />

In an instance document, if you wish for Altitude to have the default value, then you can simply create it as an empty element:

        <Altitude></Altitude>

The value of Altitude is 100.

Let's take another example. Here I declare the Title element to be of type string and give it a default value, "Hello World":

        <xs:element name="Title" type="xs:string" default="Hello World" />

Now in my instance document I create an empty Title element:

        <Title></Title>

Quiz: What is the value of Title?

Scroll down to see the answer ...

























Answer: the value of Title is the empty string, not the default value. The reason is that the empty string is a valid value of the string data type. If you want Title to have the default value then you must explicitly enter the default value:

        <Title>Hello World</Title>

/Roger

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Daniel Dui
So what should an instance document look like to have the default value "Hello World"? Does this mean that the default value is of no practical use for an xsd:string type?

-d


On 24 August 2012 10:05, Costello, Roger L. <[hidden email]> wrote:
Thank you Michael and Pete for correcting my misunderstanding.

Allow me to correct the answer to my quiz:

I wrote this as the answer to my quiz:

    >  Answer: the value of Title is the empty string, not the default value.
    >  The reason is that the empty string is a valid value of the string data type.

However, the correct answer is:

 Answer: the value of Title is the default value ("Hello World"). The XML Schema specification explains why:

    An element with a non-empty default value whose
    simple type definition includes the empty string in
    its lexical space will nonetheless never receive that
    empty string value, because the default value will
    override it.

/Roger


-----Original Message-----
From: Costello, Roger L.
Sent: Thursday, August 23, 2012 5:47 PM
To: [hidden email]
Subject: XML Schema quiz on default values

Hello Folks,

Recall that when you declare an element (or attribute) you can give it a default value.

For example, I give the Altitude element a default value of 100:

        <xs:element name="Altitude" type="xs:integer" default="100" />

In an instance document, if you wish for Altitude to have the default value, then you can simply create it as an empty element:

        <Altitude></Altitude>

The value of Altitude is 100.

Let's take another example. Here I declare the Title element to be of type string and give it a default value, "Hello World":

        <xs:element name="Title" type="xs:string" default="Hello World" />

Now in my instance document I create an empty Title element:

        <Title></Title>

Quiz: What is the value of Title?

Scroll down to see the answer ...

























Answer: the value of Title is the empty string, not the default value. The reason is that the empty string is a valid value of the string data type. If you want Title to have the default value then you must explicitly enter the default value:

        <Title>Hello World</Title>

/Roger




--
____________________________________________________________
   Daniel Dui - [hidden email] - skype: danieldui
Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Costello, Roger L.
In reply to this post by Costello, Roger L.
Hello Daniel,

Suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" default="Hello World" />

Note that a default value ("Hello World") is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is the default value ("Hello World")

Conversely, suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" />

Note that no default value is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is a string of length zero (the empty string).

/Roger


So what should an instance document look like to have the default value
"Hello World"? Does this mean that the default value is of no practical use
for an xsd:string type?

-d


On 24 August 2012 10:05, Costello, Roger L. <[hidden email]> wrote:

> Thank you Michael and Pete for correcting my misunderstanding.
>
> Allow me to correct the answer to my quiz:
>
> I wrote this as the answer to my quiz:
>
>     >  Answer: the value of Title is the empty string, not the default
> value.
>     >  The reason is that the empty string is a valid value of the string
> data type.
>
> However, the correct answer is:
>
>  Answer: the value of Title is the default value ("Hello World"). The XML
> Schema specification explains why:
>
>     An element with a non-empty default value whose
>     simple type definition includes the empty string in
>     its lexical space will nonetheless never receive that
>     empty string value, because the default value will
>     override it.
>
> /Roger

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Daniel Dui
Roger et al., thanks for the clarification.

I have used XML Schema for a long time and this is definitely a dark corner of the specs.

I always warn people about using default values and often recommend not using them. This non-obvious defaulting behavior looks to me like another reason why many schemas should avoid using default values.

-daniel

On 24 August 2012 12:48, Costello, Roger L. <[hidden email]> wrote:
Hello Daniel,

Suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" default="Hello World" />

Note that a default value ("Hello World") is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is the default value ("Hello World")

Conversely, suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" />

Note that no default value is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is a string of length zero (the empty string).

/Roger


So what should an instance document look like to have the default value
"Hello World"? Does this mean that the default value is of no practical use
for an xsd:string type?

-d


On 24 August 2012 10:05, Costello, Roger L. <[hidden email]> wrote:

> Thank you Michael and Pete for correcting my misunderstanding.
>
> Allow me to correct the answer to my quiz:
>
> I wrote this as the answer to my quiz:
>
>     >  Answer: the value of Title is the empty string, not the default
> value.
>     >  The reason is that the empty string is a valid value of the string
> data type.
>
> However, the correct answer is:
>
>  Answer: the value of Title is the default value ("Hello World"). The XML
> Schema specification explains why:
>
>     An element with a non-empty default value whose
>     simple type definition includes the empty string in
>     its lexical space will nonetheless never receive that
>     empty string value, because the default value will
>     override it.
>
> /Roger




--
____________________________________________________________
   Daniel Dui - [hidden email] - skype: danieldui
Reply | Threaded
Open this post in threaded view
|

RE: XML Schema quiz on default values

Costello, Roger L.
Hello Daniel,

> this [default values] is definitely a dark corner of the specs.

I agree.

Hopefully this discussion has shed some light on it.

/Roger

From: Daniel Dui [mailto:[hidden email]]
Sent: Friday, August 24, 2012 8:33 AM
To: Costello, Roger L.
Cc: [hidden email]
Subject: Re: XML Schema quiz on default values

Roger et al., thanks for the clarification.

I have used XML Schema for a long time and this is definitely a dark corner of the specs.

I always warn people about using default values and often recommend not using them. This non-obvious defaulting behavior looks to me like another reason why many schemas should avoid using default values.

-daniel

On 24 August 2012 12:48, Costello, Roger L. <[hidden email]> wrote:
Hello Daniel,

Suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" default="Hello World" />
Note that a default value ("Hello World") is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is the default value ("Hello World")

Conversely, suppose Title is declared like this:

    <xs:element name="Title" type="xs:string" />

Note that no default value is specified.

Now suppose we have this empty Title element in an instance document:

    <Title></Title>

What is the value of Title? Answer: it is a string of length zero (the empty string).

/Roger


So what should an instance document look like to have the default value
"Hello World"? Does this mean that the default value is of no practical use
for an xsd:string type?

-d


On 24 August 2012 10:05, Costello, Roger L. <[hidden email]> wrote:

> Thank you Michael and Pete for correcting my misunderstanding.
>
> Allow me to correct the answer to my quiz:
>
> I wrote this as the answer to my quiz:
>
>     >  Answer: the value of Title is the empty string, not the default
> value.
>     >  The reason is that the empty string is a valid value of the string
> data type.
>
> However, the correct answer is:
>
>  Answer: the value of Title is the default value ("Hello World"). The XML
> Schema specification explains why:
>
>     An element with a non-empty default value whose
>     simple type definition includes the empty string in
>     its lexical space will nonetheless never receive that
>     empty string value, because the default value will
>     override it.
>
> /Roger




--
____________________________________________________________
   Daniel Dui - [hidden email] - skype: danieldui

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

C. M. Sperberg-McQueen-2
In reply to this post by Daniel Dui

On Aug 24, 2012, at 6:33 AM, Daniel Dui wrote:

> Roger et al., thanks for the clarification.
>
> I have used XML Schema for a long time and this is definitely a dark corner of the specs.
>
> I always warn people about using default values and often recommend not using them. This non-obvious defaulting behavior looks to me like another reason why many schemas should avoid using default values.

I'm puzzled.  The behavior "Empty element gets the default"
seems straightforward enough to me.

Can you clarify in what way you find the behavior non-obvious?

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Daniel Dui
My experience is that a user that sees the default feature in XML schema expects that the default value is the value that an optional element "takes" when it's not included in the instance document.

You might think it's naive, but that's the reality for many C++/Java/C# developers who need to deal with XML from time to time. It's not, I hope, for XML specialists.

The biggest issue that I have found with default values, and why I usually end up not using them, is that the default value is specified only in the schema and not in an instance document. So a consumer app that processes the document in a schema-unaware fashion has no knowledge of the default value..

Usually I work with in organisation that want to build schema-aware producers and schema-unaware consumers. If the consumer can't use the default value, why specify it in the schema?

Another scenario is when there are multiple consumers, some schema-aware and some schema-unaware. Using default values can introduce inconsistent behavior across different consumers within the same organisations.

-daniel



On 24 August 2012 16:56, C. M. Sperberg-McQueen <[hidden email]> wrote:

On Aug 24, 2012, at 6:33 AM, Daniel Dui wrote:

> Roger et al., thanks for the clarification.
>
> I have used XML Schema for a long time and this is definitely a dark corner of the specs.
>
> I always warn people about using default values and often recommend not using them. This non-obvious defaulting behavior looks to me like another reason why many schemas should avoid using default values.

I'm puzzled.  The behavior "Empty element gets the default"
seems straightforward enough to me.

Can you clarify in what way you find the behavior non-obvious?

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************







--
____________________________________________________________
   Daniel Dui - [hidden email] - skype: danieldui
Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

C. M. Sperberg-McQueen-2

On Aug 24, 2012, at 10:16 AM, Daniel Dui wrote:

> My experience is that a user that sees the default feature in XML schema expects that the default value is the value that an optional element "takes" when it's not included in the instance document.
>
> You might think it's naive, but that's the reality for many C++/Java/C# developers who need to deal with XML from time to time. It's not, I hope, for XML specialists.
>
> The biggest issue that I have found with default values, and why I usually end up not using them, is that the default value is specified only in the schema and not in an instance document. So a consumer app that processes the document in a schema-unaware fashion has no knowledge of the default value..
>
> Usually I work with in organisation that want to build schema-aware producers and schema-unaware consumers. If the consumer can't use the default value, why specify it in the schema?
>
> Another scenario is when there are multiple consumers, some schema-aware and some schema-unaware. Using default values can introduce inconsistent behavior across different consumers within the same organisations.

Thank you; that's helpful.

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

Pete Cordell-5
In reply to this post by Daniel Dui
Original Message From: "Daniel Dui"

> My experience is that a user that sees the default feature in XML schema
> expects that the default value is the value that an optional element
> "takes" when it's not included in the instance document.
>
> You might think it's naive, but that's the reality for many C++/Java/C#
> developers who need to deal with XML from time to time. It's not, I hope,
> for XML specialists.


I agree.  And to make things even more confusing, that's the behaviour for
attributes I believe.

Pete Cordell
Codalogic Ltd
Twitter: http://twitter.com/petecordell
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info


Reply | Threaded
Open this post in threaded view
|

Re: XML Schema quiz on default values

C. M. Sperberg-McQueen-2

On Aug 24, 2012, at 11:03 AM, Pete Cordell wrote:

> Original Message From: "Daniel Dui"
>
>> My experience is that a user that sees the default feature in XML schema
>> expects that the default value is the value that an optional element
>> "takes" when it's not included in the instance document.
>>
>> You might think it's naive, but that's the reality for many C++/Java/C#
>> developers who need to deal with XML from time to time. It's not, I hope,
>> for XML specialists.
>
>
> I agree.  And to make things even more confusing, that's the behaviour for attributes I believe.


When things don't have an order, it's easy to supply a default value
for them when they don't appear in the surface syntax.  

But consider the content model (a | b | c | d)*, where a and b
have default values.  Suppose the parent turns up with no children.
We want default values for elements to be supplied on the same
lines as for attributes, so we want default values for a and b to
be supplied here.

In which order?

And how many of them?

These questions are trivial for relational databases (order is not
an issue and you get exactly one) and for attributes (ditto and ditto).
For elements, they don't seem to me to have answers.  So
the reason element defaults don't work the same as attribute
defaults is, essentially, that they can't because unlike attributes
elements have position and cardinality.

--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





Reply | Threaded
Open this post in threaded view
|

RE: XML Schema quiz on default values

Paul Spencer
In reply to this post by C. M. Sperberg-McQueen-2
Another use case is archiving. In many cases XML documents will be archived
without their schemas. This is not generally a problem as long as default
and fixed values are not used. That is one reason why some sets of naming
and design rules discourage (or forbid) the use of these features.

Paul

> -----Original Message-----
> From: C. M. Sperberg-McQueen [mailto:[hidden email]]
> Sent: 24 August 2012 5:45 PM
> To: Daniel Dui
> Cc: C. M. Sperberg-McQueen; [hidden email]
> Subject: Re: XML Schema quiz on default values
>
>
> On Aug 24, 2012, at 10:16 AM, Daniel Dui wrote:
>
> > My experience is that a user that sees the default feature in XML schema
> expects that the default value is the value that an optional element
"takes"
> when it's not included in the instance document.
> >
> > You might think it's naive, but that's the reality for many C++/Java/C#
> developers who need to deal with XML from time to time. It's not, I hope,
for
> XML specialists.
> >
> > The biggest issue that I have found with default values, and why I
usually
> end up not using them, is that the default value is specified only in the
> schema and not in an instance document. So a consumer app that processes
the
> document in a schema-unaware fashion has no knowledge of the default
value..
> >
> > Usually I work with in organisation that want to build schema-aware
> producers and schema-unaware consumers. If the consumer can't use the
default
> value, why specify it in the schema?
> >
> > Another scenario is when there are multiple consumers, some schema-aware
and
> some schema-unaware. Using default values can introduce inconsistent
behavior

> across different consumers within the same organisations.
>
> Thank you; that's helpful.
>
> --
> ****************************************************************
> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
> * http://www.blackmesatech.com
> * http://cmsmcq.com/mib
> * http://balisage.net
> ****************************************************************
>
>
>