本文整理汇总了C#中System.Xml.Xsl.XsltOld.Compiler类的典型用法代码示例。如果您正苦于以下问题:C# Compiler类的具体用法?C# Compiler怎么用?C# Compiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Compiler类属于System.Xml.Xsl.XsltOld命名空间,在下文中一共展示了Compiler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CompileAttributes
public void CompileAttributes(Compiler compiler) {
NavigatorInput input = compiler.Input;
string element = input.LocalName;
if (input.MoveToFirstAttribute()) {
do {
if (input.NamespaceURI.Length != 0) continue;
try {
if (CompileAttribute(compiler) == false) {
throw XsltException.Create(Res.Xslt_InvalidAttribute, input.LocalName, element);
}
}catch {
if (! compiler.ForwardCompatibility) {
throw;
}
else {
// In ForwardCompatibility mode we ignoreing all unknown or incorrect attributes
// If it's mandatory attribute we'l notice it absents later.
}
}
}
while (input.MoveToNextAttribute());
input.ToParent();
}
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:26,代码来源:CompiledAction.cs
示例2: CompileContent
private void CompileContent(Compiler compiler)
{
if (compiler.Recurse())
{
NavigatorInput input = compiler.Input;
_text = string.Empty;
do
{
switch (input.NodeType)
{
case XPathNodeType.Text:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
_text += input.Value;
break;
case XPathNodeType.Comment:
case XPathNodeType.ProcessingInstruction:
break;
default:
throw compiler.UnexpectedKeyword();
}
} while (compiler.Advance());
compiler.ToParent();
}
}
开发者ID:Corillian,项目名称:corefx,代码行数:27,代码来源:TextAction.cs
示例3: Compile
internal override void Compile(Compiler compiler)
{
CompileAttributes(compiler);
if (_matchKey == Compiler.InvalidQueryKey)
{
if (_name == null)
{
throw XsltException.Create(SR.Xslt_TemplateNoAttrib);
}
if (_mode != null)
{
throw XsltException.Create(SR.Xslt_InvalidModeAttribute);
}
}
compiler.BeginTemplate(this);
if (compiler.Recurse())
{
CompileParameters(compiler);
CompileTemplate(compiler);
compiler.ToParent();
}
compiler.EndTemplate();
AnalyzePriority(compiler);
}
开发者ID:Corillian,项目名称:corefx,代码行数:27,代码来源:TemplateAction.cs
示例4: Compile
internal override void Compile(Compiler compiler)
{
CompileAttributes(compiler);
CheckRequiredAttribute(compiler, _nameAvt, "name");
_name = PrecalculateAvt(ref _nameAvt);
_nsUri = PrecalculateAvt(ref _nsAvt);
// if both name and ns are not AVT we can calculate qname at compile time and will not need namespace manager anymore
if (_nameAvt == null && _nsAvt == null)
{
if (_name != "xmlns")
{
_qname = CreateAttributeQName(_name, _nsUri, compiler.CloneScopeManager());
}
}
else
{
_manager = compiler.CloneScopeManager();
}
if (compiler.Recurse())
{
CompileTemplate(compiler);
compiler.ToParent();
}
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:27,代码来源:AttributeAction.cs
示例5: Compile
internal override void Compile(Compiler compiler) {
Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets));
this.useString = compiler.Input.Value;
Debug.Assert(this.useAttributeSets == null);
if (this.useString.Length == 0) {
// Split creates empty node is spliting empty string
this.useAttributeSets = new XmlQualifiedName[0];
return;
}
string[] qnames = XmlConvert.SplitString(this.useString);
try {
this.useAttributeSets = new XmlQualifiedName[qnames.Length]; {
for (int i = 0; i < qnames.Length; i++) {
this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]);
}
}
}
catch (XsltException) {
if (!compiler.ForwardCompatibility) {
// Rethrow the exception if we're not in forwards-compatible mode
throw;
}
// Ignore the whole list in forwards-compatible mode
this.useAttributeSets = new XmlQualifiedName[0];
}
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:30,代码来源:UseAttributeSetsAction.cs
示例6: Compile
internal override void Compile(Compiler compiler)
{
this.stylesheetid = compiler.Stylesheetid;
this.baseUri = compiler.Input.BaseURI;
CompileAttributes(compiler);
CheckRequiredAttribute(compiler, this.name, "name");
if (compiler.Recurse())
{
CompileTemplate(compiler);
compiler.ToParent();
if (this.selectKey != Compiler.InvalidQueryKey && this.containedActions != null)
{
throw XsltException.Create(SR.Xslt_VariableCntSel2, this.nameStr);
}
}
if (this.containedActions != null)
{
baseUri = baseUri + '#' + compiler.GetUnicRtfId();
}
else
{
baseUri = null;
}
_varKey = compiler.InsertVariable(this);
}
开发者ID:Corillian,项目名称:corefx,代码行数:29,代码来源:VariableAction.cs
示例7: DbgData
public DbgData(Compiler compiler)
{
DbgCompiler dbgCompiler = (DbgCompiler)compiler;
_styleSheet = dbgCompiler.Input.Navigator.Clone();
_variables = dbgCompiler.LocalVariables;
dbgCompiler.Debugger.OnInstructionCompile(this.StyleSheet);
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:7,代码来源:DbgCompiler.cs
示例8: CompileContent
private void CompileContent(Compiler compiler) {
NavigatorInput input = compiler.Input;
if (compiler.Recurse()) {
do {
switch(input.NodeType) {
case XPathNodeType.Element:
compiler.PushNamespaceScope();
string nspace = input.NamespaceURI;
string name = input.LocalName;
if (Ref.Equal(nspace, input.Atoms.UriXsl) && Ref.Equal(name, input.Atoms.WithParam)) {
WithParamAction par = compiler.CreateWithParamAction();
CheckDuplicateParams(par.Name);
AddAction(par);
}
else {
throw compiler.UnexpectedKeyword();
}
compiler.PopScope();
break;
case XPathNodeType.Comment:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
break;
default:
throw XsltException.Create(Res.Xslt_InvalidContents, "call-template");
}
} while(compiler.Advance());
compiler.ToParent();
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:34,代码来源:CallTemplateAction.cs
示例9: CompileAttribute
internal override bool CompileAttribute(Compiler compiler) {
string name = compiler.Input.LocalName;
string value = compiler.Input.Value;
if (Ref.Equal(name, compiler.Atoms.Match)) {
Debug.Assert(this.matchKey == Compiler.InvalidQueryKey);
this.matchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true);
}
else if (Ref.Equal(name, compiler.Atoms.Name)) {
Debug.Assert(this.name == null);
this.name = compiler.CreateXPathQName(value);
}
else if (Ref.Equal(name, compiler.Atoms.Priority)) {
Debug.Assert(Double.IsNaN(this.priority));
this.priority = XmlConvert.ToXPathDouble(value);
if (double.IsNaN(this.priority) && ! compiler.ForwardCompatibility) {
throw XsltException.Create(Res.Xslt_InvalidAttrValue, "priority", value);
}
}
else if (Ref.Equal(name, compiler.Atoms.Mode)) {
Debug.Assert(this.mode == null);
if (compiler.AllowBuiltInMode && value == "*") {
this.mode = Compiler.BuiltInMode;
}
else {
this.mode = compiler.CreateXPathQName(value);
}
}
else {
return false;
}
return true;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:34,代码来源:TemplateAction.cs
示例10: CompileSingle
internal virtual void CompileSingle(Compiler compiler)
{
_matchKey = compiler.AddQuery("/", /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true);
_priority = Compiler.RootPriority;
CompileOnceTemplate(compiler);
}
开发者ID:Corillian,项目名称:corefx,代码行数:7,代码来源:TemplateAction.cs
示例11: CompileAttribute
internal override bool CompileAttribute(Compiler compiler)
{
string name = compiler.Input.LocalName;
string value = compiler.Input.Value;
if (Ref.Equal(name, compiler.Atoms.Select))
{
_selectKey = compiler.AddQuery(value);
}
else if (Ref.Equal(name, compiler.Atoms.Mode))
{
Debug.Assert(_mode == null);
if (compiler.AllowBuiltInMode && value == "*")
{
_mode = Compiler.BuiltInMode;
}
else
{
_mode = compiler.CreateXPathQName(value);
}
}
else
{
return false;
}
return true;
}
开发者ID:Corillian,项目名称:corefx,代码行数:27,代码来源:ApplyTemplatesAction.cs
示例12: Compile
internal override void Compile(Compiler compiler) {
CheckEmpty(compiler);
if (! compiler.CanHaveApplyImports) {
throw XsltException.Create(Res.Xslt_ApplyImports);
}
this.mode = compiler.CurrentMode;
this.stylesheet = compiler.CompiledStylesheet;
}
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:ApplyImportsAction.cs
示例13: CompileAvt
internal static Avt CompileAvt(Compiler compiler, string avtText) {
Debug.Assert(compiler != null);
Debug.Assert(avtText != null);
bool constant;
ArrayList list = compiler.CompileAvt(avtText, out constant);
return constant ? new Avt(avtText) : new Avt(list);
}
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:Avt.cs
示例14: ReplaceNamespaceAlias
internal override void ReplaceNamespaceAlias(Compiler compiler)
{
int count = _copyEvents.Count;
for (int i = 0; i < count; i++)
{
((Event)_copyEvents[i]).ReplaceNamespaceAlias(compiler);
}
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:8,代码来源:CopyCodeAction.cs
示例15: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileConditions(compiler);
compiler.ToParent();
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:ChooseAction.cs
示例16: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:MessageAction.cs
示例17: Compile
internal override void Compile(Compiler compiler) {
XPathNavigator nav = compiler.Input.Navigator.Clone();
name = nav.Name;
nav.MoveToParent();
parent = nav.Name;
if (compiler.Recurse()) {
CompileSelectiveTemplate(compiler);
compiler.ToParent();
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:10,代码来源:NewInstructionAction.cs
示例18: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (this.type != ConditionType.ConditionOtherwise) {
CheckRequiredAttribute(compiler, this.testKey != Compiler.InvalidQueryKey, "test");
}
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:IfAction.cs
示例19: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
if (this.containedActions == null)
this.empty = true;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:CopyAction.cs
示例20: CompileConditions
private void CompileConditions(Compiler compiler) {
NavigatorInput input = compiler.Input;
bool when = false;
bool otherwise = false;
do {
switch (input.NodeType) {
case XPathNodeType.Element:
compiler.PushNamespaceScope();
string nspace = input.NamespaceURI;
string name = input.LocalName;
if (Ref.Equal(nspace, input.Atoms.UriXsl)) {
IfAction action = null;
if (Ref.Equal(name, input.Atoms.When)) {
if (otherwise) {
throw XsltException.Create(Res.Xslt_WhenAfterOtherwise);
}
action = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen);
when = true;
}
else if (Ref.Equal(name, input.Atoms.Otherwise)) {
if (otherwise) {
throw XsltException.Create(Res.Xslt_DupOtherwise);
}
action = compiler.CreateIfAction(IfAction.ConditionType.ConditionOtherwise);
otherwise = true;
}
else {
throw compiler.UnexpectedKeyword();
}
AddAction(action);
}
else {
throw compiler.UnexpectedKeyword();
}
compiler.PopScope();
break;
case XPathNodeType.Comment:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
break;
default:
throw XsltException.Create(Res.Xslt_InvalidContents, "choose");
}
}
while (compiler.Advance());
if (! when) {
throw XsltException.Create(Res.Xslt_NoWhen);
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:54,代码来源:ChooseAction.cs
注:本文中的System.Xml.Xsl.XsltOld.Compiler类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论