Hi,
I have posted this question a couple of months ago, yet received no
reply. If by my ignorance I have asked stupid questions, please let me
know.
My main issue at this point is that empty elements are created as
<foo></foo>, and wrong indentation. How can I resolve this issue so that
empty elements are rendered correctly?
Thanks in advance,
Vincent van Beveren
________________________________
From: Vincent van Beveren
Sent: donderdag 6 november 2008 15:56
To: 'generateds-users@lists.sourceforge.net'
Subject: Couple of issues writing XML
Hi everyone,
Í've just started using generateDS, and am enjoying it so-far. I have,
however, a couple of issues writing an XML file, and I am unsure if I am
doing something wrong, or whether I'm forgetting something. I will list
them below:
- No header / namespace declaration: When I use the
export(file) method on an element it doesn't write any namespace /
header stuff. Ofcourse that is understandable since the element itself
doesn't know it is the root. Now I can append <?xml version="1.0"?> to
the beginning of the file without modifying the generated code, however,
the namespace declarations must be in the root element. Is there a way
to achieve this automatically, or should I subclass the generated code
and modify a specific method?
- Complex-types always written with open/close tag: If I write
an element which has no child-elements, still an open/close tag are
created, my XML validator starts complaining that "Element
'BinaryVariable' must have no character or element information item
[children], because the type's content type is empty." on the generated
XML. Also the indentation is messed up for the closing-tag (since it
apparently expects children?). Maybe my XSD requires a special way of
creating elements with no child-elements allowed?
- Numeric element attributes initialized to -1: When I define
optional attributes of type xs:int the constructor for the element
containing these attributes initializes them to -1. The export function
of the element checks whether or no the attribute-value is None (which
it is not, its -1), so it writes all attribute values being -1. Now I
have to explicitly set all values to a value, or None. It would seem
more logical to me to set the default value of an attribute to None
(unless its required, maybe). Is there a way to accomplish this?
Thanks in advance for any insights / help!
Regards,
Vincent van Beveren
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users