<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>Hi list
members,</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>I have a structured
content type that I'm using a lot, and I'm wondering if it is possible to
assign an (empty string) default value to an element defined as
optional in the XML schema (XSD), or - in other words - make an optional
element "present" in the editor as default, rather than "not
present".</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>Example: my XSD
that has this element definition:<BR><xsd:element name="Title"
type="OpenCmsString" minOccurs="0"
maxOccurs="1" /></FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>The editor
correctly notes that this element is optional, and consequently
makes it "non-present", you'll have to click on the [+] button to add it.
</FONT></SPAN><SPAN class=073164413-30042009><FONT face=Arial size=2>I want it
the other way around - "present" by default, so I will have to press
the [x] button to remove it.</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009></SPAN><SPAN class=073164413-30042009><FONT
face=Arial size=2>I do not want minOccurs="1" and maxOccurs="1", since
sometimes the "Title" element will not be given a value. But 90% of the
time, the "Title" element will be given a value, and it's very frustrating
to have to click on the [+] icon for each one, and waiting for the page to
reload each time (there are usually many occurences of
this element, and similar elements, in a
single page).</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>I tried changing the
definition to</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=073164413-30042009> </SPAN><xsd:element name="Title"
type="OpenCmsString" minOccurs="0" maxOccurs="1"<SPAN
class=073164413-30042009> default=""</SPAN> /></FONT></FONT></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2> and also</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=073164413-30042009></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=073164413-30042009> </SPAN><xsd:element name="Title"
type="OpenCmsString" minOccurs="0" maxOccurs="1"<SPAN
class=073164413-30042009> default="xx"</SPAN> /></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>but that didn't
work, as the element will not be "present" until you click the [+]
button.</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial size=2>Is it at all
possible to accomplish what I want, or is the only solution to make it
non-optional (skip the minOccurs="0" part)?</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=073164413-30042009><FONT face=Arial
size=2>Paul</FONT></SPAN></DIV></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>