1 // Copyright 2008, Google Inc. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are met: 5 // 6 // 1. Redistributions of source code must retain the above copyright notice, 7 // this list of conditions and the following disclaimer. 8 // 2. Redistributions in binary form must reproduce the above copyright notice, 9 // this list of conditions and the following disclaimer in the documentation 10 // and/or other materials provided with the distribution. 11 // 3. Neither the name of Google Inc. nor the names of its contributors may be 12 // used to endorse or promote products derived from this software without 13 // specific prior written permission. 14 // 15 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 16 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 18 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 26 // This file contains XSD convenience utilities. 27 28 #include "kml/base/util.h" 29 30 namespace kmlxsd { 31 32 class XsdComplexType; 33 class XsdElement; 34 class XsdSchema; 35 36 extern const char kAbstract[]; 37 extern const char kBase[]; 38 extern const char kComplexType[]; 39 extern const char kDefault[]; 40 extern const char kElement[]; 41 extern const char kEnumeration[]; 42 extern const char kExtension[]; 43 extern const char kName[]; 44 extern const char kSchema[]; 45 extern const char kSimpleType[]; 46 extern const char kSubstitutionGroup[]; 47 extern const char kRestriction[]; 48 extern const char kTargetNamespace[]; 49 extern const char kType[]; 50 extern const char kValue[]; 51 52 // Convenience utility to create a <xs:complexType name="TYPE_NAME"/>. 53 XsdComplexType* CreateXsdComplexType(const string& type_name); 54 55 // Convenience utility ot create a <xs:element name="NAME" type="TYPE"/>. 56 XsdElement* CreateXsdElement(const string& name, const string& type); 57 58 // Convenience utilty to create an XsdSchema based on: 59 // <schema xmlns:PREFIX="TARGET_NAMESPACE" 60 // targetNamespace="TARGET_NAMESPACE"/> 61 XsdSchema* CreateXsdSchema(const string& prefix, 62 const string& target_namespace); 63 64 } // end namespace kmlxsd 65