If an XML/XSD expert is around, maybe he could help me on this one. I've been looking for an alternative for some days but without success.
Here is a copy of the question :
----
n an xsd file I have this element base type :
Code: Select all
<xs:complexType name="event" abstract="true" >
<xs:attribute name="move" type="aos:move_ref" use="required" />
<xs:attribute name="type" type="aos:event_type" use="required" />
</xs:complexType>Code: Select all
<xs:complexType name="signal" >
<xs:complexContent>
<xs:extension base="aos:event">
<xs:attribute name="type" type="aos:event_type" fixed="signal" />
<xs:attribute name="source" type="aos:signal_source" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>error: attribute 'type' is already defined in base
How should I write this? I just want the value of the type attribute to be specific to each different child type.
edit ----
To make the question more clear, I'll write the same thing I want to do but in C++.
Here is the base class :
Code: Select all
class Event
{
public:
std::string name() const { return m_name; }
protected:
// we need the child class to set the name
Event( const std::string& name ) : m_name( name ) {}
// it's a base class
virtual ~Event(){}
private:
std::string m_name;
};Code: Select all
class Signal : public Event
{
public:
Signal() : Event( "signal" ){}
};----
Any idea?