c++xmlxsdcodesynthesis

CodeSynthesis C++Tree 'time' in namespace '::' does not name a type


I'm trying to use CodeSynthesis C++/Tree to translate a xsd into C++ classes. In the xsd I have an element named time looks like this:

<xs:element name="time">
<xs:complexType>
  <xs:attribute name="seconds" use="required" type="xs:double"/>
  ... other attributes
</xs:complexType>

In the converted C++ header it's defined as:

typedef ::time time_type;

and when compiling it gives me an error message saying

'time' in namespace '::' does not name a type

However if I change the element's name to 'times' or anything else, it would compile fine. What could possibly be the reason behind this behavior? Many thanks!


Solution

  • It's because ::time is the same as std::time.