CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_schema_element.h
1
2
3#pragma once
4
5#include <xml/schema/xml_schema_particle.h>
6#include <xml/schema/xml_schema_form.h>
7#include <xml/schema/xml_schema_derivation_method.h>
8#include <xml/schema/validation_event_handler.h>
9#include <system/string.h>
10#include <system/enum_helpers.h>
11
12
14namespace System
15{
16namespace Xml
17{
18class DocumentSchemaValidator;
19namespace Schema
20{
21class Compiler;
22class Preprocessor;
23class SchemaCollectionCompiler;
24class SchemaCollectionPreprocessor;
25class SchemaElementDecl;
26class XmlSchema;
27class XmlSchemaComplexType;
28class XmlSchemaInference;
29class XmlSchemaInfo;
30class XmlSchemaObject;
31class XmlSchemaObjectCollection;
32class XmlSchemaSet;
33class XmlSchemaType;
34class XmlSchemaValidator;
35class XsdValidator;
36} // namespace Schema
37class XmlQualifiedName;
38class XmlReader;
39class XmlResolver;
40namespace XPath
41{
42class XPathNavigator;
43} // namespace XPath
44} // namespace Xml
45} // namespace System
47
48namespace System {
49
50namespace Xml {
51
52namespace Schema {
53
59class ASPOSECPP_SHARED_CLASS XmlSchemaElement : public XmlSchemaParticle
60{
63
64 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
65 ASPOSECPP_SHARED_RTTI_INFO_DECL();
66
67public:
68
71
72private:
74 friend class XPath::XPathNavigator;
75 friend class System::Xml::DocumentSchemaValidator;
76 friend class XmlSchemaInference;
77 friend class Preprocessor;
78 friend class SchemaCollectionCompiler;
79 friend class SchemaCollectionPreprocessor;
80 friend class Compiler;
81 friend class XmlSchema;
82 friend class XmlSchemaComplexType;
83 friend class XmlSchemaInfo;
84 friend class XmlSchemaValidator;
85 friend class XsdValidator;
87
88public:
89
92 ASPOSECPP_SHARED_API bool get_IsAbstract();
95 ASPOSECPP_SHARED_API void set_IsAbstract(bool value);
99 ASPOSECPP_SHARED_API XmlSchemaDerivationMethod get_Block();
102 ASPOSECPP_SHARED_API void set_Block(XmlSchemaDerivationMethod value);
105 ASPOSECPP_SHARED_API String get_DefaultValue();
108 ASPOSECPP_SHARED_API void set_DefaultValue(const String& value);
111 ASPOSECPP_SHARED_API XmlSchemaDerivationMethod get_Final();
114 ASPOSECPP_SHARED_API void set_Final(XmlSchemaDerivationMethod value);
117 ASPOSECPP_SHARED_API String get_FixedValue();
120 ASPOSECPP_SHARED_API void set_FixedValue(const String& value);
123 ASPOSECPP_SHARED_API XmlSchemaForm get_Form();
126 ASPOSECPP_SHARED_API void set_Form(XmlSchemaForm value);
129 ASPOSECPP_SHARED_API String get_Name();
132 ASPOSECPP_SHARED_API void set_Name(const String& value);
138 ASPOSECPP_SHARED_API bool get_IsNillable();
142 ASPOSECPP_SHARED_API void set_IsNillable(bool value);
148 ASPOSECPP_SHARED_API void set_RefName(const SharedPtr<XmlQualifiedName>& value);
154 ASPOSECPP_SHARED_API void set_SubstitutionGroup(const SharedPtr<XmlQualifiedName>& value);
160 ASPOSECPP_SHARED_API void set_SchemaTypeName(const SharedPtr<XmlQualifiedName>& value);
166 ASPOSECPP_SHARED_API void set_SchemaType(const SharedPtr<XmlSchemaType>& value);
176 ASPOSECPP_SHARED_API SharedPtr<Object> get_ElementType();
189
191 ASPOSECPP_SHARED_API XmlSchemaElement();
192
193protected:
194
196 bool get_HasNillableAttribute();
197 bool get_HasAbstractAttribute();
198 bool get_HasDefault();
199 bool get_HasConstraints();
200 bool get_IsLocalTypeDerivationChecked();
201 void set_IsLocalTypeDerivationChecked(bool value);
202 SharedPtr<SchemaElementDecl> get_ElementDecl();
203 void set_ElementDecl(const SharedPtr<SchemaElementDecl>& value);
204 ASPOSECPP_SHARED_API String get_NameAttribute() override;
205 ASPOSECPP_SHARED_API void set_NameAttribute(String value) override;
206 ASPOSECPP_SHARED_API String get_NameString() override;
207
208 SharedPtr<XmlReader> Validate(const SharedPtr<XmlReader>& reader, const SharedPtr<XmlResolver>& resolver, const SharedPtr<XmlSchemaSet>& schemaSet, ValidationEventHandler valEventHandler);
209 void SetQualifiedName(const SharedPtr<XmlQualifiedName>& value);
210 void SetElementType(const SharedPtr<XmlSchemaType>& value);
211 void SetBlockResolved(XmlSchemaDerivationMethod value);
212 void SetFinalResolved(XmlSchemaDerivationMethod value);
213 ASPOSECPP_SHARED_API SharedPtr<XmlSchemaObject> Clone() override;
214 SharedPtr<XmlSchemaObject> Clone(const SharedPtr<XmlSchema>& parentSchema);
216
217 virtual ASPOSECPP_SHARED_API ~XmlSchemaElement();
218
220 #ifdef ASPOSE_GET_SHARED_MEMBERS
221 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
222 #endif
224
225private:
226
227 bool _isAbstract;
228 bool _hasAbstractAttribute;
229 bool _isNillable;
230 bool _hasNillableAttribute;
231 bool _isLocalTypeDerivationChecked;
234 XmlSchemaForm _form;
235 String _defaultValue;
236 String _fixedValue;
237 String _name;
239 SharedPtr<XmlQualifiedName> _substitutionGroup;
242 SharedPtr<XmlQualifiedName> _qualifiedName;
243 WeakPtr<XmlSchemaType> _elementType;
244 XmlSchemaDerivationMethod _blockResolved;
245 XmlSchemaDerivationMethod _finalResolved;
247 SharedPtr<SchemaElementDecl> _elementDecl;
248
249 ThisType* CppMemberwiseClone() const override { return new ThisType(*this); }
250
251};
252
253} // namespace Schema
254} // namespace Xml
255} // namespace System
256
257
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Subclass of System::SmartPtr which sets itself to weak mode at construction. Please note that this cl...
Definition: weak_ptr.h:18
The base class for any element that can contain annotation elements.
Definition: xml_schema_annotated.h:35
Represents the complexType element from XML Schema as specified by the World Wide Web Consortium (W3C...
Definition: xml_schema_complex_type.h:64
Represents the element element from XML Schema as specified by the World Wide Web Consortium (W3C)....
Definition: xml_schema_element.h:60
SharedPtr< XmlQualifiedName > get_RefName()
Returns the reference name of an element declared in this schema (or another schema indicated by the ...
SharedPtr< XmlSchemaObjectCollection > get_Constraints()
Returns the collection of constraints on the element.
void set_SubstitutionGroup(const SharedPtr< XmlQualifiedName > &value)
Sets the name of an element that is being substituted by this element.
void set_SchemaTypeName(const SharedPtr< XmlQualifiedName > &value)
Sets the name of a built-in data type defined in this schema or another schema indicated by the speci...
SharedPtr< XmlQualifiedName > get_SchemaTypeName()
Returns the name of a built-in data type defined in this schema or another schema indicated by the sp...
void set_IsNillable(bool value)
Sets information that indicates if xsi:nil can occur in the instance data. Indicates if an explicit n...
void set_SchemaType(const SharedPtr< XmlSchemaType > &value)
Sets the type of the element. This can either be a complex type or a simple type.
XmlSchemaElement()
Initializes a new instance of the XmlSchemaElement class.
bool get_IsNillable()
Returns information that indicates if xsi:nil can occur in the instance data. Indicates if an explici...
String get_DefaultValue()
Returns the default value of the element if its content is a simple type or content of the element is...
void set_RefName(const SharedPtr< XmlQualifiedName > &value)
Sets the reference name of an element declared in this schema (or another schema indicated by the spe...
void set_FixedValue(const String &value)
Sets the fixed value.
void set_IsAbstract(bool value)
Sets information to indicate if the element can be used in an instance document.
SharedPtr< XmlQualifiedName > get_SubstitutionGroup()
Returns the name of an element that is being substituted by this element.
void set_DefaultValue(const String &value)
Sets the default value of the element if its content is a simple type or content of the element is te...
void set_Name(const String &value)
Sets the name of the element.
void set_Form(XmlSchemaForm value)
Sets the form for the element.
bool get_IsAbstract()
Returns information to indicate if the element can be used in an instance document.
String get_FixedValue()
Returns the fixed value.
XmlSchemaDerivationMethod get_Final()
Returns the Final value to indicate that no further derivations are allowed.
XmlSchemaDerivationMethod get_FinalResolved()
Returns the post-compilation interpretation of the Final value.
XmlSchemaForm get_Form()
Returns the form for the element.
SharedPtr< XmlQualifiedName > get_QualifiedName()
Returns the actual qualified name for the given element.
void set_Final(XmlSchemaDerivationMethod value)
Sets the Final value to indicate that no further derivations are allowed.
XmlSchemaDerivationMethod get_BlockResolved()
Returns the post-compilation interpretation of the Block value.
void set_Block(XmlSchemaDerivationMethod value)
Sets a Block derivation.
SharedPtr< XmlSchemaType > get_SchemaType()
Returns the type of the element. This can either be a complex type or a simple type.
SharedPtr< XmlSchemaType > get_ElementSchemaType()
Returns an XmlSchemaType object representing the type of the element based on the XmlSchemaElement::g...
String get_Name()
Returns the name of the element.
XmlSchemaDerivationMethod get_Block()
Returns a Block derivation.
SharedPtr< Object > get_ElementType()
Returns an object based on the XmlSchemaElement or XmlSchemaElement of the element,...
An in-memory representation of an XML Schema, as specified in the World Wide Web Consortium (W3C) XML...
Definition: xml_schema.h:78
Infers an XML Schema Definition Language (XSD) schema from an XML document. The XmlSchemaInference cl...
Definition: infer.h:56
Represents the post-schema-validation infoset of a validated XML node.
Definition: xml_schema_info.h:43
Represents the root class for the Xml schema object model hierarchy and serves as a base class for cl...
Definition: xml_schema_object.h:47
A base class for that is the base class for all particle types (e.g. XmlSchemaAny).
Definition: xml_schema_particle.h:47
Represents an XML Schema Definition Language (XSD) Schema validation engine. The XmlSchemaValidator c...
Definition: xml_schema_validator.h:93
Provides a cursor model for navigating and editing XML data.
Definition: xpath_navigator.h:89
System::MulticastDelegate< void(SharedPtr< Object >, SharedPtr< ValidationEventArgs >)> ValidationEventHandler
Represents the callback method that will handle XML schema validation events and the ValidationEventA...
Definition: validation_event_handler.h:33
XmlSchemaForm
Indicates if attributes or elements need to be qualified with a namespace prefix.
Definition: xml_schema_form.h:17
XmlSchemaDerivationMethod
Provides different methods for preventing derivation.
Definition: xml_schema_derivation_method.h:18
@ Schema
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas....
@ Xml
Serialize according to the XML 1.0 rules.
Definition: db_command.h:9