本文整理汇总了C#中System.Xml.Xsl.Compiler.InsertExcludedNamespace方法的典型用法代码示例。如果您正苦于以下问题:C# Compiler.InsertExcludedNamespace方法的具体用法?C# Compiler.InsertExcludedNamespace怎么用?C# Compiler.InsertExcludedNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.Compiler
的用法示例。
在下文中一共展示了Compiler.InsertExcludedNamespace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompileStylesheetAttributes
internal void CompileStylesheetAttributes(Compiler compiler) {
NavigatorInput input = compiler.Input;
string element = input.LocalName;
string badAttribute = null;
string version = null;
if (input.MoveToFirstAttribute()) {
do {
Debug.TraceAttribute(input);
string nspace = input.NamespaceURI;
string name = input.LocalName;
if (! Keywords.Equals(nspace, input.Atoms.Empty)) continue;
Debug.WriteLine("Attribute name: \"" + name + "\"");
if (Keywords.Equals(name, input.Atoms.Version)) {
version = input.Value;
if (1 <= XmlConvert.ToXPathDouble(version)) {
compiler.ForwardCompatibility = (version != Keywords.s_Version10);
}
else {
// XmlConvert.ToXPathDouble(version) an be NaN!
if (! compiler.ForwardCompatibility) {
throw XsltException.InvalidAttrValue(Keywords.s_Version, version);
}
}
Debug.WriteLine("Version found: \"" + version + "\"");
}
else if (Keywords.Equals(name, input.Atoms.ExtensionElementPrefixes)) {
compiler.InsertExtensionNamespace(input.Value);
}
else if (Keywords.Equals(name, input.Atoms.ExcludeResultPrefixes)) {
compiler.InsertExcludedNamespace(input.Value);
}
else if (Keywords.Equals(name, input.Atoms.Id)) {
// Do nothing here.
}
else {
// We can have version atribute later. For now remember this attribute and continue
badAttribute = name;
}
}
while( input.MoveToNextAttribute());
input.ToParent();
}
if (version == null) {
throw new XsltException(Res.Xslt_MissingAttribute, Keywords.s_Version);
}
if (badAttribute != null && ! compiler.ForwardCompatibility) {
throw XsltException.InvalidAttribute(element, badAttribute);
}
}
示例2: CompileLiteralAttributesAndNamespaces
void CompileLiteralAttributesAndNamespaces(Compiler compiler) {
NavigatorInput input = compiler.Input;
if (input.Navigator.MoveToAttribute(Keywords.s_UseAttributeSets, input.Atoms.XsltNamespace)) {
AddAction(compiler.CreateUseAttributeSetsAction());
input.Navigator.MoveToParent();
}
compiler.InsertExcludedNamespace();
if (input.MoveToFirstAttribute()) {
do {
// Skip everything from Xslt namespace
if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace)) {
continue;
}
// Add attribute events
this.AddEvent (compiler.CreateBeginEvent());
this.AddEvents(compiler.CompileAvt(input.Value));
this.AddEvent (new EndEvent(XPathNodeType.Attribute));
}
while (input.MoveToNextAttribute());
input.ToParent();
}
if (input.MoveToFirstNamespace()) {
do {
string uri = input.Value;
if (Keywords.Compare(uri, input.Atoms.XsltNamespace)) {
continue;
}
if (
compiler.IsExcludedNamespace(uri) ||
compiler.IsExtensionNamespace(uri) ||
compiler.IsNamespaceAlias(uri)
) {
continue;
}
this.AddEvent(new NamespaceEvent(input));
}
while (input.MoveToNextNamespace());
input.ToParent();
}
}