Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
InputScopeManager.cs
Go to the documentation of this file.
2
4
5internal sealed class InputScopeManager
6{
8
9 private string _defaultNS = string.Empty;
10
11 private readonly XPathNavigator _navigator;
12
14
16
18
19 public string DefaultNamespace => _defaultNS;
20
26
34
36 {
38 return _scopeStack;
39 }
40
41 internal void PopScope()
42 {
43 if (_scopeStack != null)
44 {
46 {
47 _defaultNS = namespaceDecl.PrevDefaultNsUri;
48 }
50 }
51 }
52
53 internal void PushNamespace(string prefix, string nspace)
54 {
56 if (prefix == null || prefix.Length == 0)
57 {
59 }
60 }
61
62 private string ResolveNonEmptyPrefix(string prefix)
63 {
64 if (prefix == "xml")
65 {
66 return "http://www.w3.org/XML/1998/namespace";
67 }
68 if (prefix == "xmlns")
69 {
70 return "http://www.w3.org/2000/xmlns/";
71 }
73 {
74 string text = inputScope.ResolveNonAtom(prefix);
75 if (text != null)
76 {
77 return text;
78 }
79 }
81 }
82
83 public string ResolveXmlNamespace(string prefix)
84 {
85 if (prefix.Length == 0)
86 {
87 return _defaultNS;
88 }
90 }
91
92 public string ResolveXPathNamespace(string prefix)
93 {
94 if (prefix.Length == 0)
95 {
96 return string.Empty;
97 }
99 }
100
101 internal void InsertExtensionNamespaces(string[] nsList)
102 {
103 for (int i = 0; i < nsList.Length; i++)
104 {
106 }
107 }
108
109 internal bool IsExtensionNamespace(string nspace)
110 {
112 {
113 if (inputScope.IsExtensionNamespace(nspace))
114 {
115 return true;
116 }
117 }
118 return false;
119 }
120
121 internal void InsertExcludedNamespaces(string[] nsList)
122 {
123 for (int i = 0; i < nsList.Length; i++)
124 {
126 }
127 }
128
129 internal bool IsExcludedNamespace(string nspace)
130 {
132 {
133 if (inputScope.IsExcludedNamespace(nspace))
134 {
135 return true;
136 }
137 }
138 return false;
139 }
140}
static string Xslt_InvalidPrefix
Definition SR.cs:1926
Definition SR.cs:7
static XsltException Create(string res, params string[] args)
NamespaceDecl AddNamespace(string prefix, string uri, string prevDefaultNsUri)
void PushNamespace(string prefix, string nspace)
InputScopeManager(XPathNavigator navigator, InputScope rootScope)
void InsertExcludedNamespace(string nspace)
Definition InputScope.cs:81
void InsertExtensionNamespace(string nspace)
Definition InputScope.cs:63