Commit 35e40953 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

xsd2ttcn: The namespace http://www.w3.org/XML/1998/namespace now has the xml...

xsd2ttcn: The namespace http://www.w3.org/XML/1998/namespace

 now has the xml namespace prefix by default (Bug 521987)

Change-Id: I3e7d56df715e9ffb9447d53632314ce376d435c1
Signed-off-by: default avatarBenceJanosSzabo <bence.janos.szabo@ericsson.com>
parent 605874c7
......@@ -141,6 +141,7 @@ type record Note
}
with {
variant "name as uncapitalized";
variant (lang) "namespace as 'http://www.w3.org/XML/1998/namespace' prefix 'xml'";
variant (lang) "attribute";
variant (base) "untagged";
};
......
......@@ -129,6 +129,7 @@ type record Name
with {
variant "name as uncapitalized";
variant "element";
variant (lang) "namespace as 'http://www.w3.org/XML/1998/namespace' prefix 'xml'";
variant (lang) "attribute";
variant (base) "untagged";
};
......
......@@ -171,6 +171,6 @@ with {
}
with {
encode "XML";
variant "namespace as 'http://www.w3.org/XML/1998/namespace'";
variant "namespace as 'http://www.w3.org/XML/1998/namespace' prefix 'xml'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
}
......@@ -131,6 +131,6 @@ with {
}
with {
encode "XML";
variant "namespace as 'http://www.w3.org/XML/1998/namespace'";
variant "namespace as 'http://www.w3.org/XML/1998/namespace' prefix 'xml'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
}
......@@ -103,7 +103,16 @@ void ImportStatement::referenceResolving(void) {
}
}
visible = false;
} else module->addImportedModule(source_module);
} else {
// Add the xml namespace to the importing module's declared namespaces
if (from_namespace == "http://www.w3.org/XML/1998/namespace") {
NamespaceType tmp_ns_pair;
tmp_ns_pair.uri = from_namespace;
tmp_ns_pair.prefix = "xml";
module->getDeclaredNamespaces().push_back(tmp_ns_pair);
}
module->addImportedModule(source_module);
}
}
void ImportStatement::printToFile(FILE * file) {
......
......@@ -112,6 +112,10 @@ void TTCN3Module::loadValuesFromSchemaTag(const Mstring& a_targetNamespace,
BlockValue a_blockDefault) {
if (a_targetNamespace.empty()) {
targetNamespace = "NoTargetNamespace";
} else if (a_targetNamespace == "http://www.w3.org/XML/1998/namespace") {
targetNamespace = a_targetNamespace;
// http://www.w3.org/XML/1998/namespace automatically gets the xml namespace prefix
targetNamespace_connectedPrefix = "xml";
} else {
if (a_targetNamespace == XMLSchema) {
notIntoFile();
......
......@@ -216,6 +216,10 @@ public:
const List<NamespaceType> & getDeclaredNamespaces() const {
return declaredNamespaces;
}
List<NamespaceType> & getDeclaredNamespaces() {
return declaredNamespaces;
}
void addImportedModule(const TTCN3Module *mod) {
importedModules.push_back(mod);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment