2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * MetadataExtSchemaValidators.cpp
20 * Schema-based validators for Shibboleth metadata extension classes
24 #include "exceptions.h"
25 #include "metadata/MetadataExt.h"
27 #include <xmltooling/validation/ValidatorSuite.h>
29 using namespace shibsp;
30 using namespace xmltooling;
33 using shibspconstants::SHIBMD_NS;
36 XMLOBJECTVALIDATOR_SIMPLE(SHIBSP_DLLLOCAL,Scope);
38 BEGIN_XMLOBJECTVALIDATOR(SHIBSP_DLLLOCAL,KeyAuthority);
39 XMLOBJECTVALIDATOR_NONEMPTY(KeyAuthority,KeyInfo);
40 END_XMLOBJECTVALIDATOR;
43 #define REGISTER_ELEMENT(cname) \
44 q=QName(SHIBMD_NS,cname::LOCAL_NAME); \
45 XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \
46 SchemaValidators.registerValidator(q,new cname##SchemaValidator())
48 void shibsp::registerMetadataExtClasses() {
50 REGISTER_ELEMENT(Scope);
51 REGISTER_ELEMENT(KeyAuthority);