[DEV] rework compleate
This commit is contained in:
parent
0e507add7e
commit
c5589ebc8f
@ -17,7 +17,8 @@ exml::Element::Element(ememory::SharedPtr<exml::internal::Node> _internalNode) :
|
||||
if (m_data == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (m_data->isElement() == false) {
|
||||
if ( m_data->isElement() == false
|
||||
&& m_data->isDocument() == false) {
|
||||
// try to set wrong type inside ... ==> remove it ...
|
||||
m_data = nullptr;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ bool exml::Node::isElement() const {
|
||||
if (m_data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return m_data->isElement();
|
||||
return m_data->isElement() || m_data->isDocument();
|
||||
}
|
||||
|
||||
bool exml::Node::isText() const {
|
||||
|
@ -24,7 +24,7 @@ void appl::read() {
|
||||
TEST_INFO(" " << it);
|
||||
}
|
||||
TEST_INFO("list of sub-node:");
|
||||
for (const auto it: doc) {
|
||||
for (const auto it: doc.nodes) {
|
||||
TEST_INFO(" " << it);
|
||||
if (it.isElement() == false) {
|
||||
continue;
|
||||
@ -38,7 +38,7 @@ void appl::read() {
|
||||
TEST_INFO(" " << itElem);
|
||||
}
|
||||
TEST_INFO(" list of sub-node:");
|
||||
for (const auto itElem: elem) {
|
||||
for (const auto itElem: elem.nodes) {
|
||||
TEST_INFO(" " << itElem);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user