本文整理匯總了C#中System.Xml.Xsl.XsltOld.Compiler.ToParent方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.ToParent方法的具體用法?C# Compiler.ToParent怎麽用?C# Compiler.ToParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.XsltOld.Compiler
的用法示例。
在下文中一共展示了Compiler.ToParent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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);
}
示例2: 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();
}
}
示例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);
}
示例4: 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();
}
}
示例5: 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 = CreateElementQName(_name, _nsUri, compiler.CloneScopeManager());
}
}
else
{
_manager = compiler.CloneScopeManager();
}
if (compiler.Recurse())
{
Debug.Assert(_empty == false);
CompileTemplate(compiler);
compiler.ToParent();
}
_empty = (this.containedActions == null);
}
示例6: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileConditions(compiler);
compiler.ToParent();
}
}
示例7: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
}
示例8: 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();
}
}
示例9: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
if (this.containedActions == null)
this.empty = true;
}
示例10: 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();
}
}
示例11: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
CheckRequiredAttribute(compiler, selectKey != Compiler.InvalidQueryKey, Keywords.s_Select);
compiler.CanHaveApplyImports = false;
if (compiler.Recurse()) {
CompileSortElements(compiler);
CompileTemplate(compiler);
compiler.ToParent();
}
}
示例12: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
CheckRequiredAttribute(compiler, this.name, Keywords.s_Name);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
if (this.selectKey != Compiler.InvalidQueryKey && this.containedActions != null) {
throw XsltException.Create(Res.Xslt_VariableCntSel2, this.nameStr);
}
}
}
示例13: CompileSelectiveTemplate
internal void CompileSelectiveTemplate(Compiler compiler){
NavigatorInput input = compiler.Input;
do{
if (Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl) &&
Ref.Equal(input.LocalName, input.Atoms.Fallback)){
fallback = true;
if (compiler.Recurse()){
CompileTemplate(compiler);
compiler.ToParent();
}
}
}
while (compiler.Advance());
}
示例14: Compile
internal override void Compile(Compiler compiler) {
CompileAttributes(compiler);
CheckRequiredAttribute(compiler, this.nameAvt, Keywords.s_Name);
if(this.nameAvt.IsConstant) {
this.name = this.nameAvt.Evaluate(null, null);
this.nameAvt = null;
if (! IsProcessingInstructionName(this.name)) {
// For Now: set to null to ignore action late;
this.name = null;
}
}
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
}
示例15: CheckEmpty
public void CheckEmpty(Compiler compiler) {
// Really EMPTY means no content at all, but the sake of compatibility with MSXML we allow whitespaces
string elementName = compiler.Input.Name;
if (compiler.Recurse()) {
do {
// Note: <![CDATA[ ]]> will be reported as XPathNodeType.Text
XPathNodeType nodeType = compiler.Input.NodeType;
if (
nodeType != XPathNodeType.Whitespace &&
nodeType != XPathNodeType.Comment &&
nodeType != XPathNodeType.ProcessingInstruction
) {
throw XsltException.Create(Res.Xslt_NotEmptyContents, elementName);
}
}
while (compiler.Advance());
compiler.ToParent();
}
}