本文整理汇总了C#中XPathNodeType类的典型用法代码示例。如果您正苦于以下问题:C# XPathNodeType类的具体用法?C# XPathNodeType怎么用?C# XPathNodeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XPathNodeType类属于命名空间,在下文中一共展示了XPathNodeType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecideXPNodeTypeForTextNodes
internal bool DecideXPNodeTypeForTextNodes(XmlNode node, ref XPathNodeType xnt)
{
while (node != null)
{
switch (node.NodeType)
{
case XmlNodeType.Text:
case XmlNodeType.CDATA:
xnt = XPathNodeType.Text;
return false;
case XmlNodeType.EntityReference:
if (this.DecideXPNodeTypeForTextNodes(node.FirstChild, ref xnt))
{
break;
}
return false;
case XmlNodeType.Whitespace:
break;
case XmlNodeType.SignificantWhitespace:
xnt = XPathNodeType.SignificantWhitespace;
break;
default:
return false;
}
node = node.NextSibling;
}
return true;
}
示例2: XPathSelfQuery
internal XPathSelfQuery(
IQuery qyInput,
String Name,
String Prefix,
String URN,
XPathNodeType Type) : base(qyInput, Name, Prefix, URN, Type) {
}
示例3: ChildrenQuery
internal ChildrenQuery(
IQuery qyInput,
String name,
String prefix,
String urn,
XPathNodeType type) : base (qyInput, name, prefix, urn, type) {
}
示例4: MapNodeType
//public enum XmlNodeType {
// None,
// Element,
// Attribute,
// Text,
// CDATA,
// EntityReference,
// Entity,
// ProcessingInstruction,
// Comment,
// Document,
// DocumentType,
// DocumentFragment,
// Notation,
// Whitespace,
// SignificantWhitespace,
// EndElement,
// EndEntity,
// XmlDeclaration
//}
//public enum XPathNodeType {
// Root,
// Element,
// Attribute,
// Namespace,
// Text,
// SignificantWhitespace,
// Whitespace,
// ProcessingInstruction,
// Comment,
// All,
//}
// xpath defines its own NodeType
// it should use the XmlNodeType instead
// we just map between them for now
// so that the construct query will have
// the XmlNodeType instead of XPathNodeType
XmlNodeType MapNodeType(XPathNodeType type) {
XmlNodeType ret = XmlNodeType.None;
switch (type) {
case XPathNodeType.Element:
ret = XmlNodeType.Element;
break;
case XPathNodeType.Attribute:
ret = XmlNodeType.Attribute;
break;
case XPathNodeType.Text:
ret = XmlNodeType.Text;
break;
case XPathNodeType.ProcessingInstruction:
ret = XmlNodeType.ProcessingInstruction;
break;
case XPathNodeType.Comment:
ret = XmlNodeType.Comment;
break;
default:
break;
}
return ret;
}
示例5: AttributeQuery
internal AttributeQuery(
IQuery qyParent,
String Name,
String Prefix,
String URN,
XPathNodeType Type) : base(qyParent, Name, Prefix, URN, Type) {
}
示例6: XmlQueryOutput
/// <summary>
/// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
/// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
/// </summary>
internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt) {
this.runtime = runtime;
this.xwrt = xwrt;
this.xstate = XmlState.WithinContent;
this.depth = 1;
this.rootType = XPathNodeType.Root;
}
示例7: DecideXPNodeTypeForTextNodes
public static bool DecideXPNodeTypeForTextNodes(this XmlNode thisObj, XmlNode node, ref XPathNodeType xnt)
{
//returns true - if all siblings of the node are processed else returns false.
//The reference XPathNodeType argument being passed in is the watermark that
//changes according to the siblings nodetype and will contain the correct
//nodetype when it returns.
Debug.Assert(IsTextNode(node.NodeType) || (node.ParentNode != null && node.ParentNode.NodeType == XmlNodeType.EntityReference));
while (node != null)
{
switch (node.NodeType)
{
case XmlNodeType.Whitespace:
break;
case XmlNodeType.SignificantWhitespace:
xnt = XPathNodeType.SignificantWhitespace;
break;
case XmlNodeType.Text:
case XmlNodeType.CDATA:
xnt = XPathNodeType.Text;
return false;
case XmlNodeType.EntityReference:
if (!thisObj.DecideXPNodeTypeForTextNodes(node.FirstChild, ref xnt))
{
return false;
}
break;
default:
return false;
}
node = node.NextSibling;
}
return true;
}
示例8: XPathNodeMatch
/// <summary>
/// Creates an XPathNodeMatch from the navigator which should be position on the
/// node.
/// </summary>
/// <remarks>
/// We deliberately use the OuterXml when we find a Namespace since the
/// navigator location returned starts from the xmlns attribute.
/// </remarks>
public XPathNodeMatch(XPathNavigator currentNavigator)
{
SetLineNumbers(currentNavigator as IXmlLineInfo);
nodeType = currentNavigator.NodeType;
switch (nodeType) {
case XPathNodeType.Text:
SetTextValue(currentNavigator);
break;
case XPathNodeType.Comment:
SetCommentValue(currentNavigator);
break;
case XPathNodeType.Namespace:
SetNamespaceValue(currentNavigator);
break;
case XPathNodeType.Element:
SetElementValue(currentNavigator);
break;
case XPathNodeType.ProcessingInstruction:
SetProcessingInstructionValue(currentNavigator);
break;
case XPathNodeType.Attribute:
SetAttributeValue(currentNavigator);
break;
default:
value = currentNavigator.LocalName;
displayValue = value;
break;
}
}
示例9: XPathNodeMatch
public XPathNodeMatch(string nodeValue, string displayValue, int? lineNumber, int linePosition, XPathNodeType nodeType)
{
this.nodeValue = nodeValue;
this.displayValue = displayValue;
this.lineNumber = lineNumber;
this.linePosition = linePosition;
this.nodeType = nodeType;
}
示例10: Axis
// constructor
internal Axis(AxisType axistype, AstNode input) {
_axistype = axistype;
_input = input;
_prefix = String.Empty;
_name = String.Empty;
_nodetype = XPathNodeType.All;
this.abbrAxis = true;
}
示例11: FollSiblingQuery
internal FollSiblingQuery(
IQuery qyInput,
String name,
String prefix,
String urn,
XPathNodeType type) : base (qyInput, name, prefix, urn, type)
{
}
示例12: XslTemplateContent
public XslTemplateContent (Compiler c,
XPathNodeType parentType, bool xslForEach)
: base (c)
{
this.parentType = parentType;
this.xslForEach = xslForEach;
Compile (c);
}
示例13: StartTree
/// <summary>
/// Start construction of a new Xml tree (document or fragment).
/// </summary>
public override XmlRawWriter StartTree(XPathNodeType rootType, IXmlNamespaceResolver nsResolver, XmlNameTable nameTable) {
// Build XPathDocument
// If rootType != XPathNodeType.Root, then build an XQuery fragment
this.doc = new XPathDocument(nameTable);
this.writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames | (rootType == XPathNodeType.Root ? XPathDocument.LoadFlags.None : XPathDocument.LoadFlags.Fragment), string.Empty);
this.writer.NamespaceResolver = nsResolver;
return this.writer;
}
示例14: XmlQueryOutput
/// <summary>
/// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
/// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
/// </summary>
internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt)
{
_runtime = runtime;
_xwrt = xwrt;
_xstate = XmlState.WithinContent;
_depth = 1;
_rootType = XPathNodeType.Root;
}
示例15: BaseAxisQuery
protected BaseAxisQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
{
this.qyInput = qyInput;
this.name = name;
this.prefix = prefix;
this.typeTest = typeTest;
this.nameTest = (prefix.Length != 0) || (name.Length != 0);
this.nsUri = string.Empty;
}