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.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(); } 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(); } }
internal string ResolveNonAtom(string prefix) { Debug.Assert(prefix != null && prefix.Length > 0); for (NamespaceDecl scope = this.scopes; scope != null; scope = scope.Next) { if (Keywords.Compare(scope.Prefix, prefix)) { Debug.Assert(scope.Uri != null); return(scope.Uri); } } return(null); }
private static XmlSpace TranslateXmlSpace(string space) { if (Keywords.Compare(space, s_SpaceDefault)) { return(XmlSpace.Default); } else if (Keywords.Compare(space, s_SpacePreserve)) { return(XmlSpace.Preserve); } else { return(XmlSpace.None); } }
public string GetNsAlias(ref string prefix) { Debug.Assert( Keywords.Equals(this.input.LocalName, this.input.Atoms.StylesheetPrefix) || Keywords.Equals(this.input.LocalName, this.input.Atoms.ResultPrefix) ); if (Keywords.Compare(this.input.Atoms.HashDefault, prefix)) { prefix = string.Empty; return(this.DefaultNamespace); } else { if (!PrefixQName.ValidatePrefix(prefix)) { throw XsltException.Create(Res.Xslt_InvalidAttrValue, this.input.LocalName, prefix); } return(this.ResolveXPathNamespace(prefix)); } }