<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
you have to define the default values within the most outer schema (the
one which is called to create the resource). <br>
Further you have to specify the full path to pick the right node.<br>
<br>
For example <tt>foo.xsd</tt> is nested within <tt>bar.xsd </tt>by
the element name of <tt>SomeElement</tt>. Further <tt>foo.xsd</tt>
contains the element <tt>AnotherElement</tt>. In case you want to set
a default value for all <tt>AnotherElement</tt>(s) you have to add the
following to <b><tt>bar.xsd</tt></b>.<br>
<br>
<pre wrap=""><defaults>
<default element="SomeElement/AnotherElement" value="abc"/>
</defaults>
</pre>
<br>
If you have more than one element you can state explicitly which
element you want to address by appending<tt> [# >=1 (index of
element)] </tt>to the path.<br>
Example picks the second <tt>SomeElement</tt> and the fifth <tt>AnotherElement</tt>.
In case these elements do no not exist no error is thrown.<br>
<br>
<pre wrap=""><defaults>
<default element="SomeElement[2]/AnotherElement[5]" value="abc"/>
</defaults>
</pre>
<br>
This works with multi-layer nested schemas too - only the path becomes
longer and longer ;-). <br>
<br>
<br>
\Fabian<br>
<br>
<br>
Stéphane Martin schrieb:
<blockquote cite="mid:000301c89afe$f5b241d0$bb64a8c0@webtrio.local"
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>
</body>
</html>