本文整理汇总了C#中System.Xml.XPath.XPathNavigator.MoveToNextAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.MoveToNextAttribute方法的具体用法?C# XPathNavigator.MoveToNextAttribute怎么用?C# XPathNavigator.MoveToNextAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.MoveToNextAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParameterNode
public ParameterNode(XPathNavigator aNode)
{
valueNode = String.Empty;
typeNode = String.Empty;
ruleValueNode = String.Empty;
name = String.Empty;
if (aNode.MoveToFirstAttribute())
{
do
{
string nodeName = aNode.Name;
switch (nodeName)
{
case PARAMETER_ATTRS.NAME:
name = aNode.Value;
break;
case PARAMETER_ATTRS.VALUE:
valueNode = aNode.Value;
break;
case PARAMETER_ATTRS.TYPE:
typeNode = aNode.Value;
break;
case PARAMETER_ATTRS.RULE_VALUE:
ruleValueNode = aNode.Value;
break;
}
} while (aNode.MoveToNextAttribute());
aNode.MoveToParent();
}
}
示例2: XmlNodeTaskItem
/// <summary>
/// Initializes a new instance of an XmlNodeTaskItem
/// </summary>
/// <param name="xpathNavigator">The selected XmlNode</param>
/// <param name="reservedMetaDataPrefix">The prefix to attach to the reserved metadata properties.</param>
public XmlNodeTaskItem(XPathNavigator xpathNavigator, string reservedMetaDataPrefix)
{
this.ReservedMetaDataPrefix = reservedMetaDataPrefix;
switch (xpathNavigator.NodeType)
{
case XPathNodeType.Attribute:
itemSpec = xpathNavigator.Value;
break;
default:
itemSpec = xpathNavigator.Name;
break;
}
metaData.Add(ReservedMetaDataPrefix + "value", xpathNavigator.Value);
metaData.Add(ReservedMetaDataPrefix + "innerXml", xpathNavigator.InnerXml);
metaData.Add(ReservedMetaDataPrefix + "outerXml", xpathNavigator.OuterXml);
if (xpathNavigator.MoveToFirstAttribute())
{
do
{
metaData.Add(xpathNavigator.Name, xpathNavigator.Value);
} while (xpathNavigator.MoveToNextAttribute());
}
}
示例3: ReadXml
public void ReadXml(XPathNavigator node)
{
if (node.MoveToFirstAttribute()) {
do {
if (String.IsNullOrEmpty(node.NamespaceURI)) {
switch (node.LocalName) {
case "address":
this.Address = node.Value;
break;
case "display-name":
this.DisplayName = node.Value;
break;
default:
break;
}
}
} while (node.MoveToNextAttribute());
node.MoveToParent();
}
}
示例4: ControlloLingua
public static bool ControlloLingua(XPathNavigator navigator)
{
bool risultato = true;
navigator.MoveToNextAttribute();
String hreflang = navigator.GetAttribute("hreflang", "");
if (hreflang != navigator.XmlLang)
risultato = false;
return risultato;
}
示例5: AppOpenXml
public static bool AppOpenXml(XPathNavigator navigator)
{
bool risultato = true;
navigator.MoveToNextAttribute();
String type = navigator.GetAttribute("type", "");
if (type != "application/opensearchdescription+xml")
risultato = false;
return risultato;
}
示例6: ApplicationAtomXml
public static bool ApplicationAtomXml(XPathNavigator navigator)
{
bool risultato = true;
navigator.MoveToNextAttribute();
String type = navigator.GetAttribute("type", "");
if (type != "application/atom+xml")
risultato = false;
return risultato;
}
示例7: ReadXml
public void ReadXml(XPathNavigator node, XmlResolver resolver)
{
if (node.NodeType == XPathNodeType.Element) {
if (node.MoveToFirstAttribute()) {
do {
switch (node.LocalName) {
case "media-type":
this.MediaType = node.Value;
break;
case "boundary":
this.Boundary = node.Value;
break;
}
} while (node.MoveToNextAttribute());
node.MoveToParent();
}
if (node.MoveToChild(XPathNodeType.Element)) {
XPathHttpMultipartItem currentItem = null;
do {
if (node.NamespaceURI == XPathHttpClient.Namespace) {
switch (node.LocalName) {
case "header":
if (currentItem == null) {
currentItem = new XPathHttpMultipartItem();
}
currentItem.Headers.Add(node.GetAttribute("name", ""), node.GetAttribute("value", ""));
break;
case "body":
if (currentItem == null) {
currentItem = new XPathHttpMultipartItem();
}
currentItem.Body = new XPathHttpBody();
currentItem.Body.ReadXml(node, resolver);
this.Items.Add(currentItem);
currentItem = null;
break;
}
}
} while (node.MoveToNext(XPathNodeType.Element));
node.MoveToParent();
}
}
}
示例8: GetAssemblyVersion
string GetAssemblyVersion(XPathNavigator nav)
{
if(nav.HasAttributes)
nav.MoveToFirstAttribute();
do
{
if (Utilities.Compare(nav.LocalName, "version"))
return nav.Value;
} while (nav.MoveToNextAttribute( ));
return string.Empty;
}
示例9: GetAttributes
public static Dictionary<string, string> GetAttributes(XPathNavigator navigator)
{
if (!navigator.MoveToFirstAttribute())
throw new DeserializationException("Node has no attributes: " + navigator.Name);
Dictionary<string, string> attributes = new Dictionary<string, string>();
do
{
attributes.Add(navigator.Name, navigator.Value);
} while (navigator.MoveToNextAttribute());
navigator.MoveToParent();
return attributes;
}
示例10: SettingsMappingWhatContents
public SettingsMappingWhatContents (XPathNavigator nav, SettingsMappingWhatOperation operation)
{
_operation = operation;
if (nav.HasAttributes) {
nav.MoveToFirstAttribute ();
_attributes.Add (nav.Name, nav.Value);
while (nav.MoveToNextAttribute ())
_attributes.Add (nav.Name, nav.Value);
}
}
示例11: ReadXml
public void ReadXml(XPathNavigator node) {
if (node.MoveToFirstAttribute()) {
do {
if (String.IsNullOrEmpty(node.NamespaceURI)) {
switch (node.LocalName) {
case "method":
switch (node.Value) {
case "xml":
this.Method = XmlSerializationOptions.Methods.Xml;
break;
case "html":
this.Method = XmlSerializationOptions.Methods.Html;
break;
case "xhtml":
this.Method = XmlSerializationOptions.Methods.XHtml;
break;
case "text":
this.Method = XmlSerializationOptions.Methods.Text;
break;
}
break;
default:
break;
}
}
} while (node.MoveToNextAttribute());
node.MoveToParent();
}
if (node.MoveToFirstChild()) {
do {
if (node.NodeType == XPathNodeType.Element || node.NodeType == XPathNodeType.Text) {
this.Content = node.Clone();
break;
}
} while (node.MoveToNext());
node.MoveToParent();
}
}
示例12: AddAttributeList
private void AddAttributeList(XPathNavigator nav, ArrayList attrs)
{
if (nav.HasAttributes)
{
nav.MoveToFirstAttribute();
do
{
if (!attrs.Contains(nav.Name))
{
attrs.Add(nav.Name);
}
}
while (nav.MoveToNextAttribute());
nav.MoveToParent();
}
}
示例13: TraceContext
internal static void TraceContext(XPathNavigator context) {
string output = "(null)";
if (context != null) {
context = context.Clone ();
switch (context.NodeType) {
case XPathNodeType.Element:
output = string.Format("<{0}:{1}", context.Prefix, context.LocalName);
for (bool attr = context.MoveToFirstAttribute(); attr; attr = context.MoveToNextAttribute()) {
output += string.Format(CultureInfo.InvariantCulture, " {0}:{1}={2}", context.Prefix, context.LocalName, context.Value);
}
output += ">";
break;
default:
break;
}
}
WriteLine(output);
}
示例14: Parse
private void Parse(XPathNavigator listenerElement)
{
if (listenerElement.MoveToFirstAttribute())
{
do
{
switch (listenerElement.Name)
{
case "class":
if (listenerElement.Value.Trim().Length == 0)
throw new HibernateConfigException("Invalid listener element; the attribute <class> must be assigned with no empty value");
clazz = listenerElement.Value;
break;
case "type":
type = CfgXmlHelper.ListenerTypeConvertFrom(listenerElement.Value);
break;
}
}
while (listenerElement.MoveToNextAttribute());
}
}
示例15: Parse
private void Parse(XPathNavigator collectionCacheElement)
{
if (collectionCacheElement.MoveToFirstAttribute())
{
do
{
switch (collectionCacheElement.Name)
{
case "collection":
if (collectionCacheElement.Value.Trim().Length == 0)
throw new HibernateConfigException("Invalid collection-cache element; the attribute <collection> must be assigned with no empty value");
collection = collectionCacheElement.Value;
break;
case "usage":
usage = CfgXmlHelper.ClassCacheUsageConvertFrom(collectionCacheElement.Value);
break;
case "region":
region = collectionCacheElement.Value;
break;
}
}
while (collectionCacheElement.MoveToNextAttribute());
}
}