本文整理汇总了C#中Element.getAttributeNS方法的典型用法代码示例。如果您正苦于以下问题:C# Element.getAttributeNS方法的具体用法?C# Element.getAttributeNS怎么用?C# Element.getAttributeNS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.getAttributeNS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 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()
示例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 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()
示例4: StartElement
public override void StartElement(string uri, string localName, string arg2,
IAttributes arg3)
{
string prefix=getPrefix(arg2);
Element element=new Element();
element.setLocalName(localName);
if(prefix.Length>0){
element.setPrefix(prefix);
}
if(uri!=null && uri.Length>0){
element.setNamespace(uri);
}
getCurrentNode().appendChild(element);
for(int i=0;i<arg3.Length;i++){
string _namespace=arg3.GetUri(i);
Attr attr=new Attr();
attr.setName(arg3.GetQName(i)); // Sets prefix and local name
attr.setNamespace(_namespace);
attr.setValue(arg3.GetValue(i));
element.addAttribute(attr);
if("xml:base".Equals(arg3.GetQName(i))){
xmlBaseElements.Add(element);
}
}
if("http://www.w3.org/1999/xhtml".Equals(uri) &&
"base".Equals(localName)){
string href=element.getAttributeNS("", "href");
if(href!=null) {
baseurl=href;
}
}
elements.Add(element);
}
示例5: 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()