本文整理汇总了C#中System.Xml.Xsl.Compiler.ParseQNameAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# Compiler.ParseQNameAttribute方法的具体用法?C# Compiler.ParseQNameAttribute怎么用?C# Compiler.ParseQNameAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.Compiler
的用法示例。
在下文中一共展示了Compiler.ParseQNameAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compile
protected override void Compile (Compiler c)
{
if (c.Debugger != null)
c.Debugger.DebugCompile (c.Input);
c.CheckExtraAttributes ("apply-templates", "select", "mode");
select = c.CompileExpression (c.GetAttribute ("select"));
mode = c.ParseQNameAttribute ("mode");
ArrayList sorterList = null;
if (c.Input.MoveToFirstChild ()) {
do {
switch (c.Input.NodeType) {
case XPathNodeType.Comment:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
continue;
case XPathNodeType.Element:
if (c.Input.NamespaceURI != XsltNamespace)
throw new XsltCompileException ("Unexpected element", null, c.Input); // TODO: fwd compat
switch (c.Input.LocalName)
{
case "with-param":
if (withParams == null)
withParams = new ArrayList ();
withParams.Add (new XslVariableInformation (c));
break;
case "sort":
if (sorterList == null)
sorterList = new ArrayList ();
if (select == null)
select = c.CompileExpression ("*");
sorterList.Add (new Sort (c));
//c.AddSort (select, new Sort (c));
break;
default:
throw new XsltCompileException ("Unexpected element", null, c.Input); // todo forwards compat
}
break;
default:
throw new XsltCompileException ("Unexpected node type " + c.Input.NodeType, null, c.Input); // todo forwards compat
}
} while (c.Input.MoveToNext ());
c.Input.MoveToParent ();
}
if (sorterList != null)
sortEvaluator = new XslSortEvaluator (select,
(Sort []) sorterList.ToArray (typeof (Sort)));
}
示例2: Compile
protected override void Compile (Compiler c)
{
if (c.Debugger != null)
c.Debugger.DebugCompile (c.Input);
c.CheckExtraAttributes ("call-template", "name");
c.AssertAttribute ("name");
name = c.ParseQNameAttribute ("name");
if (c.Input.MoveToFirstChild ()) {
do {
switch (c.Input.NodeType) {
case XPathNodeType.Comment:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.SignificantWhitespace:
case XPathNodeType.Whitespace:
continue;
case XPathNodeType.Element:
if (c.Input.NamespaceURI != XsltNamespace)
throw new XsltCompileException ("Unexpected element", null, c.Input); // TODO: fwd compat
switch (c.Input.LocalName)
{
case "with-param":
if (withParams == null) withParams = new ArrayList ();
withParams.Add (new XslVariableInformation (c));
break;
default:
throw new XsltCompileException ("Unexpected element", null, c.Input); // todo forwards compat
}
break;
default:
throw new XsltCompileException ("Unexpected node type " + c.Input.NodeType, null, c.Input); // TODO: fwd compat
}
} while (c.Input.MoveToNext ());
c.Input.MoveToParent ();
}
}
示例3: XslVariableInformation
public XslVariableInformation (Compiler c)
{
c.CheckExtraAttributes (c.Input.LocalName, "name", "select");
c.AssertAttribute ("name");
name = c.ParseQNameAttribute ("name");
try {
XmlConvert.VerifyName (name.Name);
} catch (XmlException ex) {
throw new XsltCompileException ("Variable name is not qualified name", ex, c.Input);
}
string sel = c.GetAttribute ("select");
if (sel != null && sel != "" ) {
select = c.CompileExpression (c.GetAttribute ("select"));
// TODO assert empty
} else if (c.Input.MoveToFirstChild ()) {
content = c.CompileTemplateContent ();
c.Input.MoveToParent ();
}
}