本文整理汇总了C#中Element.hasAttributeNS方法的典型用法代码示例。如果您正苦于以下问题:C# Element.hasAttributeNS方法的具体用法?C# Element.hasAttributeNS怎么用?C# Element.hasAttributeNS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.hasAttributeNS方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: reset
} // reset()
/*
****************************************************************************
* fromDOM()
****************************************************************************
*/ /**
* This method populates the obj from DOM. It does not keep a
* copy of the DOM around. Whitespace information is lost in this process.
*/
public void fromDOM(Element oElem)
{
reset();
msTag = oElem.getLocalName();
// get the id attribute
if (oElem.hasAttributeNS(null, Tags.ATTR_NAMEQUALIFIER))
{
msNQ = oElem.getAttributeNS(null, Tags.ATTR_NAMEQUALIFIER);
}
Node oChild = oElem.getFirstChild();
if ((oChild != null) && (oChild.getNodeType() == Node.TEXT_NODE))
{
msValue = oChild.getNodeValue();
}
} // fromDOM()
示例2: reset
} // reset()
/*
****************************************************************************
* fromDOM()
****************************************************************************
*/ /**
* This method populates the obj from DOM. It does not keep a
* copy of the DOM around. Whitespace information is lost in this process.
*/
public void fromDOM(Element oElem)
{
reset();
// get the notbefore attribute
if (oElem.hasAttributeNS(null, Tags.ATTR_NOTBEFORE))
{
String sVal = oElem.getAttributeNS(null, Tags.ATTR_NOTBEFORE);
try
{
moNotBefore = DOMUtils.fromXMLDateTime(sVal);
}
catch (ParseException oEx)
{
soLog.warn("Caught exception on notBefore time", oEx);
}
}
// get the notAfter attribute
if (oElem.hasAttributeNS(null, Tags.ATTR_NOTONORAFTER))
{
String sVal = oElem.getAttributeNS(null, Tags.ATTR_NOTONORAFTER);
try
{
moNotAfter = DOMUtils.fromXMLDateTime(sVal);
}
catch (ParseException oEx)
{
soLog.warn("Caught exception on notAfter time", oEx);
}
}
} // fromDOM()
示例3: reset
} // reset()
/*
****************************************************************************
* fromDOM()
****************************************************************************
*/ /**
* This method populates the obj from DOM. It does not keep a
* copy of the DOM around. Whitespace information is lost in this process.
*/
public void fromDOM(Element oElem)
{
reset();
// get the id attribute
if (oElem.hasAttributeNS(null, Tags.ATTR_ID_CAP))
{
msXmlID = oElem.getAttributeNS(null, Tags.ATTR_ID_CAP);
}
if (oElem.hasAttributeNS(null, Tags.ATTR_ISSUEINSTANT))
{
msIssueInstant = oElem.getAttributeNS(null, Tags.ATTR_ISSUEINSTANT);
}
for (
Node oChild = DOMUtils.getFirstChildElement(oElem); oChild != null;
oChild = DOMUtils.getNextSiblingElement(oChild))
{
if (oChild.getLocalName().equals(Tags.TAG_ISSUER))
{
// only accept the first XRIAuthority
if (moIssuer == null)
{
moIssuer = new NameID((Element) oChild);
}
}
else if (oChild.getLocalName().equals(Tags.TAG_SIGNATURE))
{
// only accept the first XRIAuthority
if (moSignature == null)
{
try
{
Document oDoc = new DocumentImpl();
Element oChildCopy =
(Element) oDoc.importNode(oChild, true);
moSignature = new XMLSignature(oChildCopy, null);
}
catch (Exception oEx)
{
soLog.warn(
"Caught exception while parsing Signature", oEx);
}
}
}
else if (oChild.getLocalName().equals(Tags.TAG_SUBJECT))
{
// only accept the first XRIAuthority
if (moSubject == null)
{
moSubject = new Subject((Element) oChild);
}
}
else if (oChild.getLocalName().equals(Tags.TAG_CONDITIONS))
{
// only accept the first XRIAuthority
if (moConditions == null)
{
moConditions = new Conditions((Element) oChild);
}
}
else if (oChild.getLocalName().equals(Tags.TAG_ATTRIBUTESTATEMENT))
{
// only accept the first XRIAuthority
if (moAttrStatement == null)
{
moAttrStatement = new AttributeStatement((Element) oChild);
}
}
}
} // fromDOM()
示例4: reset
} // reset()
/*
****************************************************************************
* fromDOM()
****************************************************************************
*/ /**
* This method populates the XRD from DOM. It does not keep a
* copy of the DOM around. Whitespace information is lost in this process.
*/
public void fromDOM(Element oElem)
{
reset();
// get the id attribute
if (oElem.hasAttributeNS(null, Tags.ATTR_NAME))
{
msName = oElem.getAttributeNS(null, Tags.ATTR_NAME);
}
for (
Node oChild = DOMUtils.getFirstChildElement(oElem); oChild != null;
oChild = DOMUtils.getNextSiblingElement(oChild))
{
if (oChild.getLocalName().equals(Tags.TAG_ATTRIBUTEVALUE))
{
// only accept the first element and make sure it
// is a text node
if (
(msValue.equals("")) && (oChild.getFirstChild() != null) &&
(oChild.getFirstChild().getNodeType() == Node.TEXT_NODE))
{
msValue = oChild.getFirstChild().getNodeValue();
}
}
}
} // fromDOM()