Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlMergeSequenceWriter.cs
Go to the documentation of this file.
2
4
6{
7 private readonly XmlRawWriter _xwrt;
8
9 private bool _lastItemWasAtomic;
10
16
26
27 public override void EndTree()
28 {
29 _lastItemWasAtomic = false;
30 }
31
32 public override void WriteItem(XPathItem item)
33 {
34 if (item.IsNode)
35 {
37 if (xPathNavigator.NodeType == XPathNodeType.Attribute || xPathNavigator.NodeType == XPathNodeType.Namespace)
38 {
40 }
42 _lastItemWasAtomic = false;
43 }
44 else
45 {
46 WriteString(item.Value);
47 }
48 }
49
50 private void WriteString(string value)
51 {
53 {
55 }
56 else
57 {
58 _lastItemWasAtomic = true;
59 }
61 }
62
63 private void CopyNode(XPathNavigator nav)
64 {
65 int num = 0;
66 while (true)
67 {
68 if (CopyShallowNode(nav))
69 {
70 XPathNodeType nodeType = nav.NodeType;
71 if (nodeType == XPathNodeType.Element)
72 {
73 if (nav.MoveToFirstAttribute())
74 {
75 do
76 {
77 CopyShallowNode(nav);
78 }
79 while (nav.MoveToNextAttribute());
80 nav.MoveToParent();
81 }
84 {
86 nav.MoveToParent();
87 }
89 }
90 if (nav.MoveToFirstChild())
91 {
92 num++;
93 continue;
94 }
95 if (nav.NodeType == XPathNodeType.Element)
96 {
98 }
99 }
100 while (true)
101 {
102 if (num == 0)
103 {
104 return;
105 }
106 if (nav.MoveToNext())
107 {
108 break;
109 }
110 num--;
111 nav.MoveToParent();
112 if (nav.NodeType == XPathNodeType.Element)
113 {
115 }
116 }
117 }
118 }
119
121 {
122 bool result = false;
123 switch (nav.NodeType)
124 {
125 case XPathNodeType.Element:
127 result = true;
128 break;
129 case XPathNodeType.Attribute:
133 break;
134 case XPathNodeType.Text:
136 break;
137 case XPathNodeType.SignificantWhitespace:
138 case XPathNodeType.Whitespace:
140 break;
141 case XPathNodeType.Root:
142 result = true;
143 break;
144 case XPathNodeType.Comment:
146 break;
147 case XPathNodeType.ProcessingInstruction:
149 break;
150 case XPathNodeType.Namespace:
152 break;
153 }
154 return result;
155 }
156
158 {
159 string localName = nav.LocalName;
160 string value = nav.Value;
162 {
164 }
166 }
167}
static string XmlIl_TopLevelAttrNmsp
Definition SR.cs:2052
Definition SR.cs:7
bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope)
bool MoveToNextNamespace(XPathNamespaceScope namespaceScope)
override void WriteEndElement()
override void WriteFullEndElement()
void WriteNamespaceDeclaration(string prefix, string ns)
override void WriteWhitespace(string ws)
void WriteComment(string? text)
void WriteProcessingInstruction(string name, string? text)
void WriteString(string? text)
void WriteStartAttribute(string localName, string? ns)
Definition XmlWriter.cs:67
void WriteStartElement(string localName, string? ns)
Definition XmlWriter.cs:30
void CopyNamespaces(XPathNavigator nav, XPathNamespaceScope nsScope)
override XmlRawWriter StartTree(XPathNodeType rootType, IXmlNamespaceResolver nsResolver, XmlNameTable nameTable)