197 if (parentNode ==
null)
289 if (
column.Prefix ==
"xml" &&
column.EncodedColumnName ==
"lang")
328 if (
attribute.NamespaceURI !=
"http://www.w3.org/2000/xmlns/")
408 -1, 1, 2, 4, 4, -1, -1, 7, 8, 0,
409 -1, 0, -1, 6, 5, -1, -1, -1, 0, 0
445 if (
node.NamespaceURI ==
"http://www.w3.org/2000/xmlns/")
458 return ns ==
"http://www.w3.org/2000/xmlns/";
543 if (
dataColumn.Namespace !=
"http://www.w3.org/2000/xmlns/")
559 int i = ((
col !=
null) ? (
col.Ordinal + 1) : 0);
562 for (; i <
count; i++)
654 if (
dataColumn.Namespace !=
"http://www.w3.org/2000/xmlns/")
667 if (
item.NamespaceURI !=
"http://www.w3.org/2000/xmlns/")
680 if (flag &&
item2.NamespaceURI !=
"http://www.w3.org/2000/xmlns/")
704 0 => num == 1 || num == 8 || num == 7,
705 1 => num == 1 || num == 4 || num == 8 || num == 6 || num == 5 || num == 7,
712 return s_xmlNodeType_To_XpathNodeType_Map[(int)parent.
NodeType]
switch
732 for (
DataColumn dataColumn = NextColumn(row, _column, fAttribute:
false); dataColumn !=
null; dataColumn = NextColumn(row, dataColumn, fAttribute:
false))
734 if (IsValidChild(_node, dataColumn))
736 MoveTo(_node, dataColumn, _doc.IsTextOnly(dataColumn));
740 XmlNode xmlNode = _doc.SafeFirstChild(_node);
751 if (parentNode ==
null)
758 xmlNode2 = _doc.SafeNextSibling(xmlNode2);
761 if (xmlNode2 !=
null)
783 for (
DataColumn dataColumn = PreviousColumn(row, _column, fAttribute:
false); dataColumn !=
null; dataColumn = PreviousColumn(row, dataColumn, fAttribute:
false))
785 if (IsValidChild(_node, dataColumn))
787 MoveTo(_node, dataColumn, _doc.IsTextOnly(dataColumn));
796 if (parentNode ==
null)
803 xmlNode = _doc.SafePreviousSibling(xmlNode);
816 DataColumn dataColumn2 = PreviousColumn(row2,
null, fAttribute:
false);
817 if (dataColumn2 !=
null)
819 MoveTo(parentNode, dataColumn2, _doc.IsTextOnly(dataColumn2));
855 for (
DataColumn dataColumn = NextColumn(dataRow,
null, fAttribute:
false); dataColumn !=
null; dataColumn = NextColumn(dataRow, dataColumn, fAttribute:
false))
857 if (IsValidChild(_node, dataColumn))
859 MoveTo(_node, dataColumn, _doc.IsTextOnly(dataColumn));
864 for (
XmlNode xmlNode2 = _doc.SafeFirstChild(xmlNode); xmlNode2 !=
null; xmlNode2 = _doc.SafeNextSibling(xmlNode2))
866 if (IsValidChild(xmlNode, xmlNode2))
896 if (!IsFoliated(_node))
899 for (
DataColumn dataColumn = NextColumn(row,
null, fAttribute:
false); dataColumn !=
null; dataColumn = NextColumn(row, dataColumn, fAttribute:
false))
901 if (IsValidChild(_node, dataColumn))
903 MoveTo(_node, dataColumn, _doc.IsTextOnly(dataColumn));
908 for (
XmlNode xmlNode = _doc.SafeFirstChild(_node); xmlNode !=
null; xmlNode = _doc.SafeNextSibling(xmlNode))
910 if (IsValidChild(_node, xmlNode))
931 if (_fOnValue && !_doc.IsTextOnly(_column))
933 MoveTo(_node, _column, fOnValue:
false);
936 MoveTo(_node,
null, fOnValue:
false);
952 return ConvertNodeType(node)
switch
954 XPathNodeType.Namespace => _parentOfNS,
955 XPathNodeType.Attribute => ((
XmlAttribute)node).OwnerElement,
963 for (
XmlNode xmlNode = _node; xmlNode !=
null; xmlNode = GetParent(xmlNode))
976 if (_column ==
null &&
pointer._column ==
null)
980 return pointer._parentOfNS == _parentOfNS;
986 return pointer._parentOfNS == _parentOfNS;
991 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1011 while (xmlNode2 !=
null)
1020 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1024 other.RealFoliate();
1025 if (IsSamePosition(
other))
1033 if (_parentOfNS ==
other._parentOfNS)
1035 return CompareNamespacePosition(
other);
1037 xmlNode = _parentOfNS;
1038 xmlNode2 =
other._parentOfNS;
1042 if (_parentOfNS ==
other._node)
1044 if (
other._column ==
null)
1050 xmlNode = _parentOfNS;
1051 xmlNode2 =
other._node;
1055 if (_node ==
other._parentOfNS)
1057 if (_column ==
null)
1064 xmlNode2 =
other._parentOfNS;
1068 if (_node ==
other._node)
1070 if (_column ==
other._column)
1078 if (_column ==
null)
1082 if (
other._column ==
null)
1086 if (_column.Ordinal <
other._column.Ordinal)
1093 xmlNode2 =
other._node;
1095 if (xmlNode ==
null || xmlNode2 ==
null)
1101 XmlNode root = GetRoot(xmlNode, ref depth);
1102 XmlNode root2 = GetRoot(xmlNode2, ref depth2);
1109 while (xmlNode !=
null && depth > depth2)
1114 if (xmlNode == xmlNode2)
1119 else if (depth2 > depth)
1121 while (xmlNode2 !=
null && depth2 > depth)
1126 if (xmlNode == xmlNode2)
1131 XmlNode xmlNode3 = GetParent(xmlNode);
1132 XmlNode xmlNode4 = GetParent(xmlNode2);
1134 while (xmlNode3 !=
null && xmlNode4 !=
null)
1136 if (xmlNode3 == xmlNode4)
1138 while (xmlNode !=
null)
1141 if (xmlNode5 == xmlNode2)
1150 xmlNode2 = xmlNode4;
1160 return nodeToCheck == _node;
1165 if (_node == foliatedNode && _column !=
null)
1167 _bNeedFoliate =
true;
1177 _bNeedFoliate =
false;
1179 if (_doc.IsTextOnly(_column))
1185 if (_column.ColumnMapping ==
MappingType.Attribute)
1192 while (xmlNode !=
null && (!(xmlNode.
LocalName == _column.EncodedColumnName) || !(xmlNode.
NamespaceURI == _column.Namespace)))
1197 if (xmlNode !=
null && _fOnValue)
1202 if (xmlNode ==
null)
1209 _bNeedFoliate =
false;
1212 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1229 for (
DataColumn dataColumn = PreviousColumn(row,
null, fAttribute:
true); dataColumn !=
null; dataColumn = PreviousColumn(row, dataColumn, fAttribute:
true))
1231 if (dataColumn.Namespace ==
"http://www.w3.org/2000/xmlns/")
1234 return dataColumn.ConvertObjectToXml(row[dataColumn, version]);
1240 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1246 return "http://www.w3.org/XML/1998/namespace";
1248 return "http://www.w3.org/2000/xmlns/";
1250 if (name.Length == 0)
1262 while (xmlNode !=
null)
1268 if (xmlNode !=
null)
1278 return string.Empty;
1284 if (_parentOfNS ==
null)
1289 if (
text ==
"xmlns")
1291 text =
"xmlns:xmlns";
1293 if (
text !=
null &&
text.Length == 0)
1301 while (xmlNode !=
null)
1305 if (xmlBoundElement2.IsFoliated)
1307 xmlAttribute = xmlBoundElement2.GetAttributeNode(name,
"http://www.w3.org/2000/xmlns/");
1308 if (xmlAttribute !=
null)
1310 MoveTo(xmlAttribute);
1316 DataRow row = xmlBoundElement2.Row;
1321 for (
DataColumn dataColumn = PreviousColumn(row,
null, fAttribute:
true); dataColumn !=
null; dataColumn = PreviousColumn(row, dataColumn, fAttribute:
true))
1323 if (dataColumn.Namespace ==
"http://www.w3.org/2000/xmlns/" && dataColumn.ColumnName == name)
1325 MoveTo(xmlBoundElement2, dataColumn, fOnValue:
false);
1341 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1351 if (curAttr ==
null)
1355 int num = attributes.
Count;
1359 xmlAttribute = attributes[num];
1360 if (flag && xmlAttribute.
NamespaceURI ==
"http://www.w3.org/2000/xmlns/" && !DuplicateNS(be, xmlAttribute.
LocalName))
1362 MoveTo(xmlAttribute);
1365 if (xmlAttribute == curAttr)
1378 for (
DataColumn dataColumn = PreviousColumn(row, col, fAttribute:
true); dataColumn !=
null; dataColumn = PreviousColumn(row, dataColumn, fAttribute:
true))
1380 if (dataColumn.Namespace ==
"http://www.w3.org/2000/xmlns/" && !DuplicateNS(be, dataColumn.ColumnName))
1382 MoveTo(be, dataColumn, fOnValue:
false);
1391 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1396 if (_parentOfNS ==
null)
1404 if (xmlNode !=
null)
1407 if (MoveToNextNamespace(xmlBoundElement,
null,
null))
1422 if (namespaceScope != 0)
1426 MoveTo(_doc._attrXml,
null, fOnValue:
false);
1433 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1436 if (_parentOfNS ==
null || endElem ==
null)
1442 while (xmlBoundElement !=
null && xmlBoundElement != endElem)
1444 if (GetNamespace(xmlBoundElement, lname) !=
null)
1448 xmlNode = xmlBoundElement;
1459 [RequiresUnreferencedCode(
"Members from serialized types may be trimmed if not referenced directly.")]
1464 if (_column !=
null)
1472 for (
DataColumn dataColumn = PreviousColumn(row, _column, fAttribute:
true); dataColumn !=
null; dataColumn = PreviousColumn(row, dataColumn, fAttribute:
true))
1474 if (dataColumn.Namespace ==
"http://www.w3.org/2000/xmlns/")
1476 MoveTo(xmlBoundElement, dataColumn, fOnValue:
false);
1494 if (xmlNode ==
null)
1502 if (MoveToNextNamespace((
XmlBoundElement)xmlNode,
null, xmlAttribute))
1516 while (xmlNode !=
null)
1519 if (MoveToNextNamespace(be,
null,
null))
1531 MoveTo(_doc._attrXml,
null, fOnValue:
false);
1539 return _owner.IsAlive;
static bool IsDBNull([NotNullWhen(true)] object? value)
static readonly DBNull Value
string ConvertObjectToXml(object value)
virtual MappingType ColumnMapping
DataColumnCollection Columns
static string DataDom_Foliation
bool GetRegion(XmlNode node, [NotNullWhen(true)] out XmlBoundElement rowElem)
XmlNodeOrder CompareNamespacePosition(XPathNodePointer other)
DataColumn NextColumn(DataRow row, DataColumn col, bool fAttribute)
XPathNodePointer(DataDocumentXPathNavigator owner, XmlDataDocument doc, XmlNode node)
int ColumnCount(DataRow row, bool fAttribute)
XPathNodePointer(DataDocumentXPathNavigator owner, XmlDataDocument doc, XmlNode node, DataColumn c, bool bOnValue, XmlBoundElement parentOfNS)
string GetNamespace(XmlBoundElement be, string name)
void MoveTo(XmlNode node, DataColumn column, bool fOnValue)
bool IsFoliated(XmlNode node)
readonly WeakReference _owner
bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope)
bool IsNamespaceNode(XmlNodeType nt, string ns)
readonly XmlDataDocument _doc
XmlNodeOrder ComparePosition(XPathNodePointer other)
bool MoveToNextAttribute(bool bFirst)
XPathNodePointer Clone(DataDocumentXPathNavigator owner)
void MoveTo(XmlNode node)
string GetNamespace(string name)
bool MoveToNextNamespace(XmlBoundElement be, DataColumn col, XmlAttribute curAttr)
bool MoveToPreviousSibling()
bool IsValidChild(XmlNode parent, XmlNode child)
DataColumn PreviousColumn(DataRow row, DataColumn col, bool fAttribute)
bool IsSamePosition(XPathNodePointer pointer)
bool IsValidChild(XmlNode parent, DataColumn c)
bool MoveTo(XPathNodePointer pointer)
bool MoveToNextNamespace(XPathNamespaceScope namespaceScope)
bool DuplicateNS(XmlBoundElement endElem, string lname)
static int[] CreateXmlNodeTypeToXpathNodeTypeMap()
XmlBoundElement _parentOfNS
static readonly int[] s_xmlNodeType_To_XpathNodeType_Map
bool MoveToAttribute(string localName, string namespaceURI)
XmlBoundElement GetRowElement()
static XmlNode GetRoot(XmlNode node, ref int depth)
XPathNodePointer(DataDocumentXPathNavigator owner, XPathNodePointer pointer)
XPathNodeType DecideXPNodeTypeForTextNodes(XmlNode node)
XPathNodeType ConvertNodeType(XmlNode node)
XmlNode GetParent(XmlNode node)
bool MoveToNamespace(string name)
virtual ? XmlElement OwnerElement
override string LocalName
override string NamespaceURI
override XmlAttributeCollection Attributes
XmlNode SafeFirstChild(XmlNode n)
bool IsNotMapped(DataColumn c)
void AddPointer(IXmlDataVirtualNode pointer)
XmlNode SafeNextSibling(XmlNode n)
void Foliate(XmlBoundElement node, ElementState newState)
static bool IsTextNode(XmlNodeType nt)
override? XmlNode ParentNode
override string InnerText
virtual ? XmlAttribute GetAttributeNode(string name)
virtual ? XmlNode GetNamedItem(string name)
virtual ? XmlNode ParentNode
virtual ? XmlNode NextSibling
virtual string NamespaceURI
virtual ? XmlNode FirstChild
virtual ? XmlAttributeCollection Attributes
void OnFoliated(XmlNode foliatedNode)
bool IsOnNode(XmlNode nodeToCheck)