[gxml] XNode: use all cases for NodeType and DomNode.NodeType



commit 27008f4846a7862817ca1684c9e75f762ea6391e
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Oct 8 10:19:42 2021 -0500

    XNode: use all cases for NodeType and DomNode.NodeType

 gxml/XNode.vala | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/gxml/XNode.vala b/gxml/XNode.vala
index 0981b58..05903e9 100644
--- a/gxml/XNode.vala
+++ b/gxml/XNode.vala
@@ -144,6 +144,10 @@ public abstract class GXml.XNode : GLib.Object,
       case GXml.NodeType.NOTATION:
         n = null;
         break;
+      case GXml.NodeType.CDATA_SECTION:
+      case GXml.NodeType.INVALID:
+        n = null;
+        break;
     }
 
     if (take_node && n != null) {
@@ -181,6 +185,16 @@ public abstract class GXml.XNode : GLib.Object,
           return DomNode.NodeType.DOCUMENT_FRAGMENT_NODE;
         case Xml.ElementType.NOTATION_NODE:
           return DomNode.NodeType.NOTATION_NODE;
+        case Xml.ElementType.ATTRIBUTE_DECL:
+        case Xml.ElementType.XINCLUDE_START:
+        case Xml.ElementType.DTD_NODE:
+        case Xml.ElementType.ENTITY_DECL:
+        case Xml.ElementType.XINCLUDE_END:
+        case Xml.ElementType.ELEMENT_DECL:
+        case Xml.ElementType.NAMESPACE_DECL:
+        case Xml.ElementType.DOCB_DOCUMENT_NODE:
+        case Xml.ElementType.HTML_DOCUMENT_NODE:
+          return DomNode.NodeType.INVALID;
       }
       return DomNode.NodeType.INVALID;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]