示例#1
0
        /*
        ****************************************************************************
        * toDOM()
        ****************************************************************************
        */
        /**
        *  This method will make DOM using the specified document.  If any DOM state
        * has been stored with the obj, it will not be used in this method.
        * This method generates a reference-free copy of new DOM.
        * @param oDoc - The document to use for generating DOM
        */
        public XmlElement toDOM(XmlDocument oDoc)
        {
            // for this particular toDOM implementation, oDoc must not be null
            if (oDoc == null)
            {
            return null;
            }

            XmlElement oElem = oDoc.createElementNS(Tags.NS_SAML, Tags.TAG_ASSERTION);

            oElem.setAttributeNS(Tags.NS_XMLNS, "xmlns", Tags.NS_SAML);
            oElem.setAttributeNS(Tags.NS_XMLNS, "xmlns:saml", Tags.NS_SAML);
            oElem.setPrefix("saml");
            oElem.setAttributeNS(null, Tags.ATTR_VERSION, "2.0");
            oElem.setAttributeNS(null, Tags.ATTR_ID_CAP, msXmlID);
            oElem.setAttributeNS(null, Tags.ATTR_ISSUEINSTANT, msIssueInstant);

            if (moIssuer != null)
            {
            XmlElement oChildElem = (XmlElement) moIssuer.toDOM(oDoc);
            oElem.AppendChild(oChildElem);
            }

            if (moSignature != null)
            {
            XmlElement oChildElem = moSignature.getElement();

            // import the node, we want a copy
            oChildElem = (XmlElement) oDoc.importNode(oChildElem, true);
            oElem.AppendChild(oChildElem);
            }

            if (moSubject != null)
            {
            XmlElement oChildElem = (XmlElement) moSubject.toDOM(oDoc);
            oElem.AppendChild(oChildElem);
            }

            if (moConditions != null)
            {
            XmlElement oChildElem = (XmlElement) moConditions.toDOM(oDoc);
            oElem.AppendChild(oChildElem);
            }

            if (moAttrStatement != null)
            {
            XmlElement oChildElem = (XmlElement) moAttrStatement.toDOM(oDoc);
            oElem.AppendChild(oChildElem);
            }

            return oElem;
        }
示例#2
0
文件: XRDS.cs 项目: AArnott/dotnetxri
        /*
        ****************************************************************************
        * toDOM()
        ****************************************************************************
        */
        /**
        *  This method will make DOM using the specified document.  If any DOM state
        * has been stored with the obj, it will not be used in this method.
        * This method generates a reference-free copy of new DOM.
        * @param oDoc - The document to use for generating DOM
        */
        public XmlElement toDOM(XmlDocument oDoc)
        {
            // for this particular toDOM implementation, oDoc must not be null
            if (oDoc == null)
            {
            return null;
            }

            XmlElement oElem = oDoc.createElementNS(Tags.NS_XRDS, Tags.TAG_XRDS);

            if (_ref != null){
            oElem.SetAttribute(Tags.ATTR_REF, _ref);
            }

            if (redirect != null){
            oElem.SetAttribute(Tags.ATTR_REDIRECT, redirect);
            }

            for (int i = 0; i < getNumChildren(); i++)
            {

            XmlElement oLocal = null;
            if (isXRDSAt(i))
                oLocal = getXRDSAt(i).toDOM(oDoc) ;
            else if(isXRDAt(i))
                oLocal = getDescriptorAt(i).toDOM(oDoc);
            if (oLocal != null)
                oElem.AppendChild(oLocal);
            }

            return oElem;
        }
示例#3
0
        /*
        ****************************************************************************
        * toDOM()
        ****************************************************************************
        */
        /**
        *  This method will make DOM using the specified document.  If any DOM state
        * has been stored with the obj, it will not be used in this method.
        * This method generates a reference-free copy of new DOM.
        * @param oDoc - The document to use for generating DOM
        */
        public XmlElement toDOM(XmlDocument oDoc)
        {
            // for this particular toDOM implementation, oDoc must not be null
            if (oDoc == null)
            {
            return null;
            }

            XmlElement oElem = oDoc.createElementNS(Tags.NS_SAML, Tags.TAG_SUBJECT);

            if (moNameID != null)
            {
            XmlElement oChildElem = (XmlElement) moNameID.toDOM(oDoc);
            oElem.AppendChild(oChildElem);
            }

            return oElem;
        }
示例#4
0
        /*
        ****************************************************************************
        * toDOM()
        ****************************************************************************
        */
        /**
        *  This method will make DOM using the specified document.  If any DOM state
        * has been stored with the obj, it will not be used in this method.
        * This method generates a reference-free copy of new DOM.
        * @param oDoc - The document to use for generating DOM
        */
        public XmlElement toDOM(XmlDocument oDoc)
        {
            // for this particular toDOM implementation, oDoc must not be null
            if (oDoc == null)
            {
            return null;
            }

            XmlElement oElem = oDoc.createElementNS(Tags.NS_SAML, Tags.TAG_ATTRIBUTE);

            if (!msName.Equals(""))
            {
            oElem.setAttributeNS(null, Tags.ATTR_NAME, msName);
            }

            XmlElement oValElem =
            oDoc.createElementNS(Tags.NS_SAML, Tags.TAG_ATTRIBUTEVALUE);
            oValElem.AppendChild(oDoc.CreateTextNode(msValue));

            oElem.AppendChild(oValElem);

            return oElem;
        }