Hi all,
first of all thanks for the new version, found it quite easier to work with
then on previous ones. I did however encounter two problems.
1. Working with Enumerations:
Having an element in the schema like this:
<xsd:element name="archiveMode">
<xsd:annotation>
<xsd:documentation>Archive mode for results. 0=logfile,
1=log+inputfiles, 2=all results</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:restriction base="integerBaseType">
<xsd:enumeration value="0" />
<xsd:enumeration value="1" />
<xsd:enumeration value="2" />
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
I do get the following error while parsing.
File "\cpacslib.py", line 17467, in buildChildren
raise NotImplementedError(NotImplementedError: Class not implemented for
<archiveMode> element
while the code looks like this in the generatedDS 2.0a Output:
elif nodeName_ == 'archiveMode':
type_name = child_.attrib.get('type')
if type_name is not None:
class_ = globals()[type_name]
obj_ = class_.factory()
obj_.build(child_)
else:
raise NotImplementedError(
'Class not implemented for <archiveMode> element')
self.set_archiveMode(obj_)
in 1.18f it looked like this and worked fine for me:
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'archiveMode':
archiveMode_ = ''
for text__content_ in child_.childNodes:
archiveMode_ += text__content_.nodeValue
self.archiveMode = archiveMode_
Do you have any ideas how to work around this. Is there a better way to declare
the restrictions in my schema or is this an issue for the code? Any help is
greatly appreciated.
2. Syntax
def get_all_text_(node):
text = node.text if node.text is not None else ''
for child in node:
if child.tail is not None:
text += child.tail
return text
The second line of this code does throw an invalid syntax error (at least in
2.4 I think) Doesn't bother me that much just wanted to give the feedback.
Best Regards
Daniel
--
Daniel Böhnke
[email protected]
mobil: +49 177 411 92 76
Kressenweg. 3
26160 Helle
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
generateds-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/generateds-users