| Author |
Message |
|
2007/08/16 02:44
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick,
Sorry to be a pain but blame M$...their dot net framework code is complaining that it wants to see the nillable attribute otherwise it goes nuts....something to do with how it serializes the objects...
I have hacked the code for xsdElementAttribute to be as follows as a work around. Can you ask your engineers to let me know if there is a more elegant solution?
$attribute.t_prepare($args.get("property"))##
## ===== Output =====
#if( $attribute.isComposite() )
$stacks.getStack("composite").push($class)##
#set($class = $attribute.getType())
$stacks.getStack("referenceAttribute").push($referenceAttribute)##
#set($referenceAttribute = $attribute)
#parse("$template-dir/XsdClassSelection.vm")
#set($referenceAttribute = $stacks.getStack("referenceAttribute").pop())##
#set($class = $stacks.getStack("composite").pop())##
#else
$indenter.getIndentation()<xs:element ##
#if( $attribute.getType().isElement() )
ref##
#else
name="$attribute.getName()" type##
#end
="$attribute.t_getTypePrefix()$attribute.t_getTypePrefixPostfix()$attribute.t_getTypeName()" minOccurs="$attribute.t_getMinOccurs()" maxOccurs="$attribute.t_getMaxOccurs()"##
#if( $attribute.hasDefaultValue() )
${space}default="$attribute.getDefaultValue()"
#end
#if ($attribute.getType().isElement() !=true)
#if ($attribute.t_getMinOccurs()=="0")
$space nillable="true"##
#else
$space nillable="false"##
#end
#end
>##
$indenter.push($indentation)##
$attribute.t_getDocumentation($indenter.getIndentation())
$indenter.pop()##
$indenter.getIndentation()</xs:element>
#end
|
|
|
|
 |
| |
|
2007/08/16 18:09
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Hi Toby,
Please try this:
#if ($attribute.getType().isElement() !=true)
#if ($attribute.t_getMinOccurs()=="0")
${space}nillable="true"##
#else
${space}nillable="false"##
#end
#end |
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/16 19:06
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Thats what I wrote!
|
|
|
|
 |
| |
|
2007/08/17 17:01
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Oh, I didn't aware that. I am sorry that this is already the most elegant way.
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/17 17:12
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Cool - I am finally elegant!
|
|
|
|
 |
| |
|
2007/08/17 17:54
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Hi Toby,
Our engineers just spot a different:
Yours : $space nillable="true"##
Ours : ${space}nillable="true"##
Your approach will produce two spaces. Not a show stopper though
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/17 18:03
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Thats why they are engineers and I am a user...
Any chance of an updated document set with all the calls and functions in? I cheat and look at some of the other InstantGenerator code samples and lift bits and bobs..even if it is an unsupported document set it would be handy.
As I mentioned, I am off to a new project so I am not sure what the requirements will be but anything that you have which is useful is handy...
Cheers Jick, have a good weekend
|
|
|
|
 |
| |
|
2007/08/17 19:09
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Hi Toby,
I have just requested for a more updated version of the API spec. Please find it attached.
Hope you find it useful.
Enjoy your weekend!
Best regards,
Jick
| Description |
|
Download
|
| Filesize |
25 kb
|
| Downloaded: |
134 time(s) |
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/17 21:58
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
|
Hi Jick, to save me from downloading Open Office can you export it as a HTML or PDF?
|
|
|
|
 |
| |
|
2007/08/18 09:26
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Hi Toby,
Certainly. Please find the HTML version attached (zipped).
Best regards,
Jick
| Description |
|
Download
|
| Filesize |
16 kb
|
| Downloaded: |
152 time(s) |
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |