<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Stéphane,<br>
<br>
never tried that approach. Good to know. <br>
However when you have a complex nested content structure it is easier
to maintain default values, mappings and so on in a single place. <br>
<br>
\Fabian<br>
<br>
Stéphane Martin schrieb:
<blockquote cite="mid:000001c89dfa$c3c45d30$bb64a8c0@webtrio.local"
type="cite">
<pre wrap="">Dear Fabian,
thanks a lot for your help. Meanwhile I have found another solution. I have
included the default values directly in the nested contact, i.e.:
<xsd:complexType name="OpenCmsBBNewsContact">
<xsd:sequence>
<xsd:element name="ContactCompany"
type="OpenCmsString" default="abc" />
<xsd:element name="ContactName" type="OpenCmsString"
default="def" />
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale"
use="optional" />
</xsd:complexType>
Best regards and thank you for your help.
Stéphane
Message: 4
Date: Thu, 10 Apr 2008 14:51:06 +0200
From: Fabian Huschka <a class="moz-txt-link-rfc2396E" href="mailto:fabian.huschka@componio.net"><fabian.huschka@componio.net></a>
Subject: Re: [opencms-dev] small issue with defaults in .xsd
To: The OpenCms mailing list <a class="moz-txt-link-rfc2396E" href="mailto:opencms-dev@opencms.org"><opencms-dev@opencms.org></a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:47FE0D3A.2010301@componio.net"><47FE0D3A.2010301@componio.net></a>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
you have to define the default values within the most outer schema (the one
which is called to create the resource).
Further you have to specify the full path to pick the right node.
For example foo.xsd is nested within bar.xsd by the element name of
SomeElement. Further foo.xsd contains the element AnotherElement. In case
you want to set a default value for all AnotherElement(s) you have to add
the following to *bar.xsd*.
<defaults>
<default element="SomeElement/AnotherElement" value="abc"/>
</defaults>
If you have more than one element you can state explicitly which element you
want to address by appending [# >=1 (index of element)] to the path.
Example picks the second SomeElement and the fifth AnotherElement. In case
these elements do no not exist no error is thrown.
<defaults>
<default element="SomeElement[2]/AnotherElement[5]" value="abc"/>
</defaults>
This works with multi-layer nested schemas too - only the path becomes
longer and longer ;-).
\Fabian
St?phane Martin schrieb:
</pre>
<blockquote type="cite">
<pre wrap="">Dear Fabian,
yes exactly. It is nested in another .xsd.
Best regards
Stephane
Message: 10
Date: Wed, 09 Apr 2008 19:53:15 +0200
From: Fabian Huschka <a class="moz-txt-link-rfc2396E" href="mailto:fabian.huschka@componio.net"><fabian.huschka@componio.net></a>
Subject: Re: [opencms-dev] small issue with defaults in .xsd
To: The OpenCms mailing list <a class="moz-txt-link-rfc2396E" href="mailto:opencms-dev@opencms.org"><opencms-dev@opencms.org></a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:47FD028B.3000403@componio.net"><47FD028B.3000403@componio.net></a>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hello Stephane,
is this xsd nested in another xsd?
Regards,
\Fabian
Stephane Martin schrieb:
</pre>
<blockquote type="cite">
<pre wrap="">Dear list members,
this is a part of my .xsd:
<xsd:annotation>
<xsd:appinfo>
<preview uri="${previewtempfile}" />
<resourcebundle name="de.xx.de.xy.workplace"/>
<mappings>
<mapping element="ContactCompany"
mapto="property:ContactCompany" />
<mapping element="ContactName"
mapto="property:ContactName" />
<mapping element="ContactDepartment"
mapto="property:ContactDepartment" />
</mappings>
<defaults>
<default element="ContactCompany"
value="abc"/>
<default element="ContactName" value="def"/>
<default element="ContactDepartment"
value="ghi"/>
</defaults>
</xsd:appinfo>
</xsd:annotation>
The values set for the elements with <default do no appear when
editing or creating new content articles based on this .xsd. Can
someone explain why the values are not set?
Best regards
Stephane
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change
your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<pre wrap=""><!---->-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/pipermail/opencms-dev/attachments/20080410/8574ccc0">http://lists.opencms.org/pipermail/opencms-dev/attachments/20080410/8574ccc0</a>
/attachment-0001.htm
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
</body>
</html>