2.1 Schema头和命名空间声明

本博客采用知识共享署名 4.0 国际许可协议进行许可

下面的schema片段定义了用于断言schema的XML命名空间和其他的头部信息。

<schema targetNamespace="urn:oasis:names:tc:SAML:2.0:assertion"
 xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
 xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
 xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
 elementFormDefault="unqualified"
 attributeFormDefault="unqualified"
 blockDefault="substitution"
 version="2.0">
 <import namespace="http://www.w3.org/2000/09/xmldsig#"
 schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core20020212/xmldsig-core-schema.xsd"/>
 <import namespace="http://www.w3.org/2001/04/xmlenc#"
 schemaLocation="http://www.w3.org/TR/2002/REC-xmlenc-core20021210/xenc-schema.xsd"/>
 <annotation>
 <documentation>
    Document identifier: saml-schema-assertion-2.0
    Location: http://docs.oasis-open.org/security/saml/v2.0/
    Revision history:
    V1.0 (November, 2002):
        Initial Standard Schema.
    V1.1 (September, 2003):
        Updates within the same V1.0 namespace.
    V2.0 (March, 2005):
        New assertion schema for SAML V2.0 namespace.
 </documentation>
 </annotation>

</schema>

译者(义臻)注:targetNamespace代表当前schema文件所定义的命名空间;xmlns代表使用的默认命名空间是http://www.w3.org/2001/XMLSchemaxmlns:saml代表使用命名空间urn:oasis:names:tc:SAML:2.0:assertion,并且使用saml前缀表示;以此类推,对于XML Schema Definition详细语法可以参考文档

Last updated

Was this helpful?