From 658692f5ae3657c5e16b3958f62707d4dacc34b0 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 16 Feb 2015 13:42:33 +0100 Subject: Included explicit encoding and standalone flag in xml output --- src/plugins/xml/XmlOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/xml/XmlOutput.cpp b/src/plugins/xml/XmlOutput.cpp index 68edc0e..e1f1c31 100644 --- a/src/plugins/xml/XmlOutput.cpp +++ b/src/plugins/xml/XmlOutput.cpp @@ -44,7 +44,7 @@ void XmlTransformer::writeXml(Handle doc, std::ostream &out, transformStructuredEntity(document, doc->getRoot(), logger, pretty); document->addChild(root); // then serialize. - document->serialize(out, "", pretty); + document->serialize(out, "", pretty); } Rooted XmlTransformer::transformStructuredEntity( -- cgit v1.2.3 From e2a765fc4eaf559bce04b53ca1a1538b1f5f1628 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 16 Feb 2015 13:49:47 +0100 Subject: Allow typesystem references in Document --- src/core/model/Document.cpp | 8 ++++++-- src/core/model/Document.hpp | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index 4e101fc..848142d 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -674,6 +674,7 @@ void Document::doResolve(ResolutionState &state) continueResolveCompositum(root, state); } continueResolveReferences(domains, state); + continueResolveReferences(typesystems, state); } bool Document::doValidate(Logger &logger) const @@ -713,11 +714,14 @@ void Document::doReference(Handle node) if (node->isa(&RttiTypes::Domain)) { referenceDomain(node.cast()); } + if (node->isa(&RttiTypes::Typesystem)) { + referenceTypesystem(node.cast()); + } } RttiSet Document::doGetReferenceTypes() const { - return RttiSet{&RttiTypes::Domain}; + return RttiSet{&RttiTypes::Domain, &RttiTypes::Typesystem}; } Rooted Document::createRootStructuredEntity( @@ -821,4 +825,4 @@ const Rtti AnnotationEntity = .parent(&Node) .composedOf({&StructuredEntity, &DocumentPrimitive, &Anchor}); } -} \ No newline at end of file +} diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 5f06eb0..e314304 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -754,6 +754,7 @@ private: Owned root; NodeVector annotations; NodeVector domains; + NodeVector typesystems; protected: void doResolve(ResolutionState &state) override; @@ -771,7 +772,8 @@ public: Document(Manager &mgr, std::string name) : RootNode(mgr, std::move(name), nullptr), annotations(this), - domains(this) + domains(this), + typesystems(this) { } @@ -890,6 +892,25 @@ public: domains.insert(domains.end(), d.begin(), d.end()); } + /** + * Adds a Typesystem reference to this Document. + */ + void referenceTypesystem(Handle d) + { + invalidate(); + typesystems.push_back(d); + } + + /** + * Adds multiple Typesystem references to this Document. + */ + void referenceTypesystems(const std::vector> &d) + { + invalidate(); + typesystems.insert(typesystems.end(), d.begin(), d.end()); + } + + /** * Returns true if and only if the given StructureNode is part of this * document, meaning that there is a path of parent references in the -- cgit v1.2.3 From f69518b192ba5015e7ececddbfcf3a3695487d00 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 16 Feb 2015 14:03:36 +0100 Subject: Renamed oxm files to generic osxml --- data/domain/book.osxml | 3 + data/domain/book.oxm | 3 - data/domain/structure.osxml | 3 + data/domain/structure.oxm | 3 - data/typesystem/color.osxml | 246 ++++++++++++++++++++++++++++ data/typesystem/color.oxm | 246 ---------------------------- test/plugins/filesystem/FileLocatorTest.cpp | 12 +- 7 files changed, 258 insertions(+), 258 deletions(-) create mode 100644 data/domain/book.osxml delete mode 100644 data/domain/book.oxm create mode 100644 data/domain/structure.osxml delete mode 100644 data/domain/structure.oxm create mode 100644 data/typesystem/color.osxml delete mode 100644 data/typesystem/color.oxm diff --git a/data/domain/book.osxml b/data/domain/book.osxml new file mode 100644 index 0000000..9659334 --- /dev/null +++ b/data/domain/book.osxml @@ -0,0 +1,3 @@ + + + diff --git a/data/domain/book.oxm b/data/domain/book.oxm deleted file mode 100644 index 9659334..0000000 --- a/data/domain/book.oxm +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/data/domain/structure.osxml b/data/domain/structure.osxml new file mode 100644 index 0000000..63d0c5c --- /dev/null +++ b/data/domain/structure.osxml @@ -0,0 +1,3 @@ + + + diff --git a/data/domain/structure.oxm b/data/domain/structure.oxm deleted file mode 100644 index 63d0c5c..0000000 --- a/data/domain/structure.oxm +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/data/typesystem/color.osxml b/data/typesystem/color.osxml new file mode 100644 index 0000000..782c856 --- /dev/null +++ b/data/typesystem/color.osxml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/typesystem/color.oxm b/data/typesystem/color.oxm deleted file mode 100644 index 782c856..0000000 --- a/data/typesystem/color.oxm +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/plugins/filesystem/FileLocatorTest.cpp b/test/plugins/filesystem/FileLocatorTest.cpp index 87a9223..361a3ca 100644 --- a/test/plugins/filesystem/FileLocatorTest.cpp +++ b/test/plugins/filesystem/FileLocatorTest.cpp @@ -213,11 +213,11 @@ TEST(FileLocator, testDefaultSearchPaths) FileLocator locator; locator.addDefaultSearchPaths(); - assert_not_located(locator, "book.oxm", "", ResourceType::UNKNOWN); - assert_located(locator, "domain/book.oxm", "", ResourceType::UNKNOWN); - assert_located(locator, "book.oxm", "", ResourceType::DOMAIN_DESC); - assert_not_located(locator, "color.oxm", "", ResourceType::UNKNOWN); - assert_located(locator, "typesystem/color.oxm", "", ResourceType::UNKNOWN); - assert_located(locator, "color.oxm", "", ResourceType::TYPESYSTEM); + assert_not_located(locator, "book.osxml", "", ResourceType::UNKNOWN); + assert_located(locator, "domain/book.osxml", "", ResourceType::UNKNOWN); + assert_located(locator, "book.osxml", "", ResourceType::DOMAIN_DESC); + assert_not_located(locator, "color.osxml", "", ResourceType::UNKNOWN); + assert_located(locator, "typesystem/color.osxml", "", ResourceType::UNKNOWN); + assert_located(locator, "color.osxml", "", ResourceType::TYPESYSTEM); } } -- cgit v1.2.3