summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/slice2xsd/Gen.cpp40
-rw-r--r--cpp/src/slice2xsd/ice.xsd61
2 files changed, 101 insertions, 0 deletions
diff --git a/cpp/src/slice2xsd/Gen.cpp b/cpp/src/slice2xsd/Gen.cpp
index 501f8b0d7d7..467bcea40f5 100644
--- a/cpp/src/slice2xsd/Gen.cpp
+++ b/cpp/src/slice2xsd/Gen.cpp
@@ -155,6 +155,13 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p)
startString += "Type\"";
start(startString);
start("xs:complexContent");
+
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>class</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
start("xs:extension base=\"ice:_internal.objectType\"");
start("xs:sequence");
@@ -232,6 +239,13 @@ Slice::Gen::visitExceptionStart(const ExceptionPtr& p)
startString += "Type\"";
start(startString);
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>exception</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
+
start("xs:sequence");
//
@@ -268,6 +282,13 @@ Slice::Gen::visitStructStart(const StructPtr& p)
startString += "Type\"";
start(startString);
+ // TODO: refactor into method
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>struct</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
DataMemberList dataMembers = p->dataMembers();
if (!dataMembers.empty())
{
@@ -308,6 +329,12 @@ Slice::Gen::visitEnum(const EnumPtr& p)
startString += "Type\"";
start(startString);
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>enumeration</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
EnumeratorList enumerators = p->getEnumerators();
assert (!enumerators.empty());
@@ -341,6 +368,12 @@ Slice::Gen::visitSequence(const SequencePtr& p)
start(startString);
start("xs:sequence");
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>sequence</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
O << nl << "<xs:element name=\"e\" type=\"" << toString(p->type())
<< "\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>";
@@ -390,6 +423,13 @@ Slice::Gen::visitDictionary(const DictionaryPtr& p)
start(startString);
start("xs:sequence");
+ start("xs:annotation");
+ start("xs:appinfo");
+ O << nl << "<type>dictionary</type>";
+ end(); // xs:annotation
+ end(); // xs:appinfo
+
+
O << nl << "<xs:element name=\"e\" type=\"tns:" << scopeId + "_internal." + p->name() + "ContentType\"/>";
end(); // xs:sequence
diff --git a/cpp/src/slice2xsd/ice.xsd b/cpp/src/slice2xsd/ice.xsd
new file mode 100644
index 00000000000..382d2a2368c
--- /dev/null
+++ b/cpp/src/slice2xsd/ice.xsd
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+**********************************************************************
+Copyright (c) 2001
+MutableRealms, Inc.
+Huntsville, AL, USA
+
+All Rights Reserved
+**********************************************************************
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ xmlns:tns="http://www.mutablerealms.com"
+ targetNamespace="http://www.mutablerealms.com">
+
+ <xs:simpleType name="_internal.proxyType">
+ <xs:annotation>
+ <xs:appinfo>
+ <type>proxy</type>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+
+ <xs:element name="proxy" type="tns:_internal.proxyType"/>
+
+ <xs:complexType name="_internal.objectType">
+ <xs:annotation>
+ <xs:appinfo>
+ <type>class</type>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="facets" type="tns:_internal.facetType"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:element name="object" type="tns:_internal.objectType"/>
+
+ <xs:complexType name="_internal.facetContentType">
+ <xs:sequence>
+ <xs:element name="key" type="xs:string"/>
+ <xs:element name="value" type="tns:_internal.objectType"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="_internal.facetType">
+ <xs:annotation>
+ <xs:appinfo>
+ <type>dictionary</type>
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="e" type="tns:_internal.facetContentType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="facet" type="tns:_internal.facetType"/>
+
+</xs:schema>