You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ga...@apache.org on 2003/01/29 21:04:18 UTC
cvs commit: xml-xerces/c/tests/DOM/TypeInfo/data SecondSchema.xsd TypeInfo.dtd TypeInfo.xml TypeInfo.xsd TypeInfoJustDTD.xml TypeInfoNoDTD.xml TypeInfoNoDTD.xsd combined.dtd combined.xml combined.xsd
gareth 2003/01/29 12:04:18
Modified: c/tests/DOM/DOMTest DTest.cpp
Added: c/tests/DOM/TypeInfo Makefile.in TypeInfo.cpp TypeInfo.hpp
c/tests/DOM/TypeInfo/data SecondSchema.xsd TypeInfo.dtd
TypeInfo.xml TypeInfo.xsd TypeInfoJustDTD.xml
TypeInfoNoDTD.xml TypeInfoNoDTD.xsd combined.dtd
combined.xml combined.xsd
Log:
testing for DOMTypeInfo
Revision Changes Path
1.38 +4 -1 xml-xerces/c/tests/DOM/DOMTest/DTest.cpp
Index: DTest.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tests/DOM/DOMTest/DTest.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- DTest.cpp 3 Jan 2003 17:09:02 -0000 1.37
+++ DTest.cpp 29 Jan 2003 20:04:09 -0000 1.38
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.38 2003/01/29 20:04:09 gareth
+ * testing for DOMTypeInfo
+ *
* Revision 1.37 2003/01/03 17:09:02 tng
* delete the parser when done, avoid memory leak report with the test case
*
@@ -1044,7 +1047,7 @@
//Setup parser
XercesDOMParser *parser = new XercesDOMParser;
- parser->setValidationScheme(XercesDOMParser::Val_Auto);
+ parser->setValidationScheme(XercesDOMParser::Val_Never);
parser->setDoNamespaces(true);
parser->setDoSchema(true);
parser->setCreateEntityReferenceNodes(true);
1.1 xml-xerces/c/tests/DOM/TypeInfo/Makefile.in
Index: Makefile.in
===================================================================
#
# The Apache Software License, Version 1.1
#
# Copyright (c) 1999-2000 The Apache Software Foundation. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. The end-user documentation included with the redistribution,
# if any, must include the following acknowledgment:
# "This product includes software developed by the
# Apache Software Foundation (http://www.apache.org/)."
# Alternately, this acknowledgment may appear in the software itself,
# if and wherever such third-party acknowledgments normally appear.
#
# 4. The names "Xerces" and "Apache Software Foundation" must
# not be used to endorse or promote products derived from this
# software without prior written permission. For written
# permission, please contact apache\@apache.org.
#
# 5. Products derived from this software may not be called "Apache",
# nor may "Apache" appear in their name, without prior written
# permission of the Apache Software Foundation.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# ====================================================================
#
# This software consists of voluntary contributions made by many
# individuals on behalf of the Apache Software Foundation, and was
# originally based on software copyright (c) 1999, International
# Business Machines, Inc., http://www.ibm.com . For more information
# on the Apache Software Foundation, please see
# <http://www.apache.org/>.
#
#
# $Id: Makefile.in,v 1.1 2003/01/29 20:04:14 gareth Exp $
#
#
###################################################################
# IMPORTANT NOTE #
###################################################################
# If you are going to do the OS390BATCH build, make sure you have #
# the OS390BATCH environment variable set. #
# #
# export OS390BATCH=1 #
# #
###################################################################
PLATFORM = @platform@
COMPILER = @compiler@
GCC = @GCC@
GXX = @GXX@
CXXFLAGS = @cxxflags@
CFLAGS = @cflags@
LDFLAGS = @ldflags@
PREFIX = @prefix@
THREADS = @threads@
EXTRA_LIBS = @extra_libs@
include ../../../version.incl
include ../../Makefile.incl
APP_NAME=TypeInfo
APP_DIR=DOM/TypeInfo
OUTDIR= ${XERCESCROOT}/tests/${APP_DIR}
EXEC= ${XERCESCROOT}/bin
OBJS= ${OUTDIR}/TypeInfo.o
SRC= ${XERCESCROOT}/tests/${APP_DIR}
HEADER_FILES=${SRC}/TypeInfo.hpp
## OS390BATCH
ifeq (${OS390BATCH},1)
BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
all:: makedir ${BATCH_TARGET}
else
all:: makedir ${EXEC}/${APP_NAME}
endif
makedir::
-mkdir -p $(OUTDIR)
${EXEC}/${APP_NAME}:: ${OBJS}
${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS}
${BATCH_TARGET}:: ${OBJS}
${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS}
$(OUTDIR)/TypeInfo.o:: ${SRC}/TypeInfo.cpp ${HEADER_FILES}
${CC} ${INCLUDES} ${CMP} -o $(OUTDIR)/TypeInfo.o ${SRC}/TypeInfo.cpp
clean::
rm -f ${OBJS} ${EXEC}/${APP_NAME}
distclean:: clean
rm -f Makefile
1.1 xml-xerces/c/tests/DOM/TypeInfo/TypeInfo.cpp
Index: TypeInfo.cpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation-> All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution->
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission-> For written
* permission, please contact apache\@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation->
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 2001, International
* Business Machines, Inc., http://www.ibm.com . For more information
* on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#include "TypeInfo.hpp"
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLException.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOMException.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/validators/schema/SchemaSymbols.hpp>
#include <iostream.h>
#define DOMTYPEINFOTEST(info, type, uri, line) \
tmp = XMLString::equals(info->getName(), type) && XMLString::equals(info->getNamespace(), uri);\
if(!tmp) { \
cerr << "DOMTypeInfo test failed at line, " << line << "\nExpected values : typename '" << XMLString::transcode(type) << "', uri '" << XMLString::transcode(uri) << "'\nActual values : typename '" << XMLString::transcode(info->getName()) << "', uri '" << XMLString::transcode(info->getNamespace()) << "'\n" << endl; \
passed = false; \
}
bool tmp;
// ---------------------------------------------------------------------------
// This is a simple class that lets us do easy (though not terribly efficient)
// trancoding of char* data to XMLCh data.
// ---------------------------------------------------------------------------
class XStr
{
public :
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
XStr(const char* const toTranscode)
{
// Call the private transcoding method
fUnicodeForm = XMLString::transcode(toTranscode);
}
~XStr()
{
delete [] fUnicodeForm;
}
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
const XMLCh* unicodeForm() const
{
return fUnicodeForm;
}
private :
// -----------------------------------------------------------------------
// Private data members
//
// fUnicodeForm
// This is the Unicode XMLCh format of the string.
// -----------------------------------------------------------------------
XMLCh* fUnicodeForm;
};
#define X(str) XStr(str).unicodeForm()
// This is a simple class that lets us do easy (though not terribly efficient)
// trancoding of XMLCh data to local code page for display.
// ---------------------------------------------------------------------------
class StrX
{
public :
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
StrX(const XMLCh* const toTranscode)
{
// Call the private transcoding method
fLocalForm = XMLString::transcode(toTranscode);
}
~StrX()
{
delete [] fLocalForm;
}
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
const char* localForm() const
{
return fLocalForm;
}
private :
// -----------------------------------------------------------------------
// Private data members
//
// fLocalForm
// This is the local code page form of the string.
// -----------------------------------------------------------------------
char* fLocalForm;
};
#define StrX(str) StrX(str).localForm()
TypeInfo::TypeInfo() {
try
{
XMLPlatformUtils::Initialize();
}
catch(const XMLException &toCatch)
{
cerr << "Error during Xerces-c Initialization.\n"
<< " Exception message:"
<< StrX(toCatch.getMessage()) << endl;
}
parser = 0;
}
TypeInfo::~TypeInfo() {
XMLPlatformUtils::Terminate();
}
bool TypeInfo::testInBuiltTypesOnAttributes(bool DTDPresent) {
bool passed = true;
DOMElement *testEle = findElement(X("attrTest"));
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("attrTestType"), X(""), __LINE__);
DOMAttr *testAttr;
testAttr = testEle->getAttributeNodeNS(0, X("string"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("boolean"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_BOOLEAN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("decimal"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DECIMAL, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("float"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_FLOAT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("double"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DOUBLE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("duration"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DURATION, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("dateTime"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DATETIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("time"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_TIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("date"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DATE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("gYearMonth"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_YEARMONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("gYear"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_YEAR, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("gMonthDay"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_MONTHDAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("gDay"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_DAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("gMonth"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_MONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("hexBinary"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_HEXBINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("base64Binary"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_BASE64BINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("anyURI"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("QName"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_QNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("normalizedString"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NORMALIZEDSTRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("token"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_TOKEN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("language"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_LANGUAGE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("NMTOKEN"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgNmTokenString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("NMTOKENS"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgNmTokensString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("Name"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("NCName"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NCNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("ID"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgIDString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("IDREF"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgIDRefString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("IDREFS"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgIDRefsString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
if(DTDPresent) {
testAttr = testEle->getAttributeNodeNS(0, X("ENTITY"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgEntityString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("ENTITIES"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), XMLUni::fgEntitiesString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
}
testAttr = testEle->getAttributeNodeNS(0, X("integer"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_INTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("nonPositiveInteger"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NONPOSITIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("negativeInteger"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NEGATIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("long"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_LONG, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("int"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_INT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("short"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_SHORT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("byte"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_BYTE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("nonNegativeInteger"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_NONNEGATIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("unsignedLong"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ULONG, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("unsignedInt"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_UINT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("unsignedShort"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_USHORT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("unsignedByte"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_UBYTE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("positiveInteger"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_POSITIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//couple of defaulted ones
testAttr = testEle->getAttributeNodeNS(0, X("defaultString"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(0, X("defaultInt"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_INTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//ns attr
testAttr = testEle->getAttributeNodeNS(X("http://www.w3.org/2000/xmlns/"), X("prefix"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X(""), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X("http://www.w3.org/2001/XMLSchema-instance"), X("noNamespaceSchemaLocation"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X(""), X(""), __LINE__);
return passed;
}
bool TypeInfo::testInBuiltTypesOnElements() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
//the eleTest element.
DOMElement *testEle = findElement(X("eleTest"));
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_BOOLEAN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DECIMAL, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_FLOAT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DOUBLE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DURATION, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DATETIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_TIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DATE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_YEARMONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_YEAR, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_MONTHDAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_DAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_MONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_HEXBINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_BASE64BINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_ANYURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_QNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NORMALIZEDSTRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_TOKEN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_LANGUAGE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), XMLUni::fgNmTokenString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), XMLUni::fgNmTokensString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NCNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_INTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NONPOSITIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NEGATIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_LONG, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_INT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_SHORT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_BYTE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_NONNEGATIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_ULONG, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_UINT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_USHORT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_UBYTE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_POSITIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
return passed;
}
bool TypeInfo::testSimpleDerived() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
//element simpleDerTest
DOMElement *testEle = (DOMElement *)docEle->getFirstChild()->getNextSibling()->getNextSibling()
->getNextSibling()->getNextSibling()->getNextSibling();
DOMAttr *testAtt = testEle->getAttributeNodeNS(0, X("decimalDerived"));
DOMTYPEINFOTEST(testAtt->getTypeInfo(), X("decimalDerivedType"), X(""), __LINE__);
testAtt = testEle->getAttributeNodeNS(0, X("stringDerived"));
DOMTYPEINFOTEST(testAtt->getTypeInfo(), X("stringDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("decimalDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("stringDerivedType"), X(""), __LINE__);
return passed;
}
bool TypeInfo::testComplexTypes() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
//element complexTest
DOMElement *testEle = findElement(X("complexTest"));
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("complexTestType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("complexDerTestType"), X(""), __LINE__);
return passed;
}
bool TypeInfo::testUnions() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
DOMAttr *testAttr;
//element unionTest
DOMElement *testEle = findElement(X("unionTest"));
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("decimalDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("stringDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("decimal"), SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("string"), SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
testAttr = testEle->getAttributeNodeNS(0, X("testAttr"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("decimalDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
testAttr = testEle->getAttributeNodeNS(0, X("testAttr"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("stringDerivedType"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
testAttr = testEle->getAttributeNodeNS(0, X("testAttr"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("decimal"), SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
testAttr = testEle->getAttributeNodeNS(0, X("testAttr"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("string"), SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
return passed;
}
bool TypeInfo::testAnonymous() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
DOMAttr *testAttr;
//element anonymousTest
DOMElement *testEle = findElement(X("anonymousTest"));
DOMTYPEINFOTEST(testEle->getTypeInfo(), X(""), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("partNum"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X(""), X(""), __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X(""), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X(""), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X(""), X(""), __LINE__);
return passed;
}
bool TypeInfo::testXsiTypes() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
//element xsiTypeTest
DOMElement *testEle = findElement(X("xsiTypeTest"));
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("base"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("level1"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("level2"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("baseComplex"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("level1Complex"), X(""), __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), X("level2Complex"), X(""), __LINE__);
return passed;
}
bool TypeInfo::testAnys() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
DOMAttr *testAttr;
//element anyTestPartial
DOMElement *testEle = findElement(X("anyTestPartial"));
DOMElement *back = testEle;
testAttr = testEle->getAttributeNodeNS(X("http://www.w3.org/1999/xhtml"), X("attr2"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//element anyTest
testEle = (DOMElement *)back->getNextSibling()->getNextSibling();
back = testEle;
testAttr = testEle->getAttributeNodeNS(X("http://www.secondSchema"), X("attr1"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(X("http://www.secondSchema"), X("attr2"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_INTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//anyTestAttr1
testEle = (DOMElement *)back->getNextSibling()->getNextSibling();
back = testEle;
testAttr = testEle->getAttributeNodeNS(X("http://www.secondSchema"), X("attr3"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//anyTestAttr2
testEle = (DOMElement *)back->getNextSibling()->getNextSibling();
back = testEle;
testAttr = testEle->getAttributeNodeNS(X("http://www.secondSchema"), X("attr3"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//anyTestMissing
testEle = (DOMElement *)back->getNextSibling()->getNextSibling();
back = testEle;
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
return passed;
}
bool TypeInfo::testInvaild() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
DOMAttr *testAttr;
DOMTYPEINFOTEST(((DOMElement *)docEle)->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//element invalidTest
DOMElement *testEle = findElement(X("invalidTest"));
testAttr = testEle->getAttributeNodeNS(X(""), X("simple"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("invalid"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
//an undeclared element does not have anon value. Test this here
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
return passed;
}
bool TypeInfo::compareDOMTypeInfo(const DOMTypeInfo *info, const XMLCh* type, const XMLCh* uri) {
return XMLString::equals(info->getName(), type) && XMLString::equals(info->getNamespace(), uri);
}
bool TypeInfo::testDTD() {
bool passed = true;
DOMElement *testEle = doc->getDocumentElement();
DOMAttr *testAttr;
DOMTYPEINFOTEST(testEle->getTypeInfo(), X(""), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("cdata"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("CDATA"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("enum"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("ENUMERATION"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("id"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("ID"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("idRef"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("IDREF"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("idRefs"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("IDREFS"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("nmToken"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("NMTOKEN"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("nmTokenDefault"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("NMTOKEN"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("nmTokenDefault2"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("NMTOKEN"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("nmTokens"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("NMTOKENS"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("entity"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("ENTITY"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("entities"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("ENTITIES"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("notation"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("NOTATION"), X(""), __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("noDecl"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("CDATA"), X(""), __LINE__);
testAttr = testEle->getAttributeNode(X("xmlns:foo"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), X("CDATA"), X(""), __LINE__);
return passed;
}
bool TypeInfo::combinedTest() {
bool passed = true;
DOMNode *docEle = doc->getDocumentElement();
DOMAttr *testAttr;
DOMElement *testEle = doc->getDocumentElement();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("attBoth"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("attSchema"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testAttr = testEle->getAttributeNodeNS(X(""), X("attDTD"));
DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getFirstChild()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling();
DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__);
return passed;
}
DOMElement* TypeInfo::findElement(const XMLCh *name) const {
DOMNode *toTest = doc->getDocumentElement()->getFirstChild();
while(!XMLString::equals(toTest->getNodeName(), name)) {
toTest = toTest->getNextSibling();
}
return (DOMElement *)toTest;
}
int main(int argc, char **argv)
{
bool passed = true;
TypeInfo ti;
try {
//first the combined DTD/Schema scanner
ti.parser = new XercesDOMParser;
ti.parser->setValidationScheme(XercesDOMParser::Val_Auto);
ti.parser->setDoNamespaces(true);
ti.parser->setDoSchema(true);
ti.parser->parse("data/TypeInfo.xml");
ti.doc = ti.parser->getDocument();
}
catch (...) {
cerr << "parsing data/TypeInfo.xml failed at line" << __LINE__ << endl;
delete ti.parser;
return false;
}
// test only if we got a doc
if (ti.doc) {
passed &= ti.testInBuiltTypesOnAttributes(true);
passed &= ti.testInBuiltTypesOnElements();
passed &= ti.testSimpleDerived();
passed &= ti.testComplexTypes();
passed &= ti.testUnions();
passed &= ti.testAnonymous();
passed &= ti.testXsiTypes();
passed &= ti.testAnys();
passed &= ti.testInvaild();
}
else
cout << "DOMTypeInfo test at line " << __LINE__ << "was not carried out" << endl;
delete ti.parser;
//lets do the same for the just schema scanner
try {
ti.parser = new XercesDOMParser;
ti.parser->setValidationScheme(XercesDOMParser::Val_Auto);
ti.parser->setDoNamespaces(true);
ti.parser->setDoSchema(true);
ti.parser->useScanner(X("SGXMLScanner"));
ti.parser->parse("data/TypeInfoNoDTD.xml");
ti.doc = ti.parser->getDocument();
}
catch (...) {
cerr << "parsing data/TypeInfo.xml failed at line" << __LINE__ << endl;
delete ti.parser;
return false;
}
// test only if we got a doc
if (ti.doc) {
passed &= ti.testInBuiltTypesOnAttributes(false);
passed &= ti.testInBuiltTypesOnElements();
passed &= ti.testSimpleDerived();
passed &= ti.testComplexTypes();
passed &= ti.testUnions();
passed &= ti.testAnonymous();
passed &= ti.testXsiTypes();
passed &= ti.testAnys();
passed &= ti.testInvaild();
}
else
cout << "DOMTypeInfo test at line " << __LINE__ << "was not carried out" << endl;
delete ti.parser;
//now default for DTD
try {
ti.parser = new XercesDOMParser;
ti.parser->setValidationScheme(XercesDOMParser::Val_Auto);
ti.parser->parse("data/TypeInfoJustDTD.xml");
ti.doc = ti.parser->getDocument();
}
catch (...) {
cerr << "parsing data/TypeInfo.xml failed at line" << __LINE__ << endl;
delete ti.parser;
return false;
}
// test only if we got a doc
if (ti.doc) {
passed &= ti.testDTD();
}
else
cout << "DOMTypeInfo test at line " << __LINE__ << "was not carried out" << endl;
delete ti.parser;
//and specific scanner
try {
ti.parser = new XercesDOMParser;
ti.parser->setValidationScheme(XercesDOMParser::Val_Auto);
ti.parser->useScanner(X("DGXMLScanner"));
ti.parser->parse("data/TypeInfoJustDTD.xml");
ti.doc = ti.parser->getDocument();
}
catch (...) {
cerr << "parsing data/TypeInfo.xml failed at line" << __LINE__ << endl;
delete ti.parser;
return false;
}
// test only if we got a doc
if (ti.doc) {
passed &= ti.testDTD();
}
else
cout << "DOMTypeInfo test at line " << __LINE__ << "was not carried out" << endl;
delete ti.parser;
try {
ti.parser = new XercesDOMParser;
ti.parser->setValidationScheme(XercesDOMParser::Val_Auto);
ti.parser->setDoNamespaces(true);
ti.parser->setDoSchema(true);
ti.parser->parse("data/combined.xml");
ti.doc = ti.parser->getDocument();
}
catch (...) {
cerr << "parsing data/TypeInfo.xml failed at line" << __LINE__ << endl;
delete ti.parser;
return false;
}
// test only if we got a doc
if (ti.doc) {
passed &= ti.combinedTest();
}
else
cout << "DOMTypeInfo test at line " << __LINE__ << "was not carried out" << endl;
delete ti.parser;
if (!passed) {
cerr << "test failed" << endl;
return 4;
}
cerr << "Test Run Successfully" << endl;
return 0;
}
1.1 xml-xerces/c/tests/DOM/TypeInfo/TypeInfo.hpp
Index: TypeInfo.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation-> All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution->
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission-> For written
* permission, please contact apache\@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation->
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 2001, International
* Business Machines, Inc., http://www.ibm.com . For more information
* on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
// define null for compatibility with original Java source code.
#define null 0
#include <xercesc/dom/DOM.hpp>
XERCES_CPP_NAMESPACE_USE
XERCES_CPP_NAMESPACE_BEGIN
class XercesDOMParser;
XERCES_CPP_NAMESPACE_END
class TypeInfo {
public:
TypeInfo();
~TypeInfo();
bool testInBuiltTypesOnElements();
bool testInBuiltTypesOnAttributes(bool DTDPresent);
bool testSimpleDerived();
bool testComplexTypes();
bool testUnions();
bool testAnonymous();
bool testXsiTypes();
bool testInvaild();
bool testAnys();
bool testDTD();
bool combinedTest();
bool compareDOMTypeInfo(const DOMTypeInfo *info, const XMLCh* type, const XMLCh* uri);
XercesDOMParser *parser;
DOMDocument *doc;
private:
DOMElement* findElement(const XMLCh *name) const ;
};
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/SecondSchema.xsd
Index: SecondSchema.xsd
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" targetNamespace="http://www.secondSchema" >
<xs:element name="realTag1" type="xs:string" />
<xs:element name="realTag2" type="xs:string" />
<xs:element name="realTag3" type="xs:string" />
<xs:attribute name="attr1" type="xs:string" />
<xs:attribute name="attr2" type="xs:integer" />
</xs:schema>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.dtd
Index: TypeInfo.dtd
===================================================================
<!NOTATION png SYSTEM 'http://xml.apache.org' >
<!ENTITY APACHE SYSTEM 'xml.apache.org' NDATA png>
<!ELEMENT attributeTest EMPTY >
<!ATTLIST attributeTest
xmlns:foo CDATA #REQUIRED
cdata CDATA #REQUIRED
enum (a | b) #REQUIRED
id ID #REQUIRED
idRef IDREF #REQUIRED
idRefs IDREFS #REQUIRED
nmToken NMTOKEN #REQUIRED
nmTokenDefault NMTOKEN "lala"
nmTokenDefault2 NMTOKEN "lala2"
nmTokens NMTOKENS #REQUIRED
entity ENTITY #REQUIRED
entities ENTITIES #REQUIRED
notation NOTATION (png) #REQUIRED
>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xml
Index: TypeInfo.xml
===================================================================
<!DOCTYPE root SYSTEM "TypeInfo.dtd" >
<root xsi:noNamespaceSchemaLocation="TypeInfo.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" >
<attrTest
string="string"
boolean="true"
decimal="2.0"
float="2.1"
double="2.1"
duration="P1Y2M3DT10H30M"
dateTime="2000-10-30T11:12:00"
time="11:12:00"
date="2000-10-30"
gYearMonth="1999-01"
gYear="1999"
gMonthDay="--01-08"
gDay="---21"
gMonth="--12--"
hexBinary="0FB7"
base64Binary="abcd"
anyURI="http://www.example.com/"
QName="xsla"
normalizedString="example"
token="example"
language="en"
NMTOKEN="example"
NMTOKENS="example bar"
Name="example"
NCName="example"
integer="1"
nonPositiveInteger="-1"
negativeInteger="-1"
long="1"
int="1"
short="1"
byte="1"
nonNegativeInteger="1"
unsignedLong="1"
unsignedInt="1"
unsignedShort="1"
unsignedByte="1"
positiveInteger="1"
ID="abc"
IDREF="abc"
IDREFS="abc"
ENTITY="APACHE"
ENTITIES="APACHE"
defaultString="test"
xmlns:prefix="http://lala"
xsi:noNamespaceSchemaLocation="hello"
/>
<eleTest >
<level1string >string</level1string>
<level1boolean >true</level1boolean>
<level1decimal >2.0</level1decimal>
<level1float >2.1</level1float>
<level1double >2.1</level1double>
<level1duration >P1Y2M3DT10H30M</level1duration>
<level1dateTime >2000-10-30T11:12:00</level1dateTime>
<level1time >11:12:00</level1time>
<level1date >2000-10-30</level1date>
<level1gYearMonth >1999-01</level1gYearMonth>
<level1gYear >1999</level1gYear>
<level1gMonthDay >--01-08</level1gMonthDay>
<level1gDay >---21</level1gDay>
<level1gMonth >--12--</level1gMonth>
<level1hexBinary >0FB7</level1hexBinary>
<level1base64Binary >abcd</level1base64Binary>
<level1anyURI >http://www.example.com/</level1anyURI>
<level1QName >xsla</level1QName>
<level1normalizedString >example</level1normalizedString>
<level1token >example</level1token>
<level1language >en</level1language>
<level1NMTOKEN >example</level1NMTOKEN>
<level1NMTOKENS >example bar</level1NMTOKENS>
<level1Name >example</level1Name>
<level1NCName >example</level1NCName>
<level1integer >1</level1integer>
<level1nonPositiveInteger >-1</level1nonPositiveInteger>
<level1negativeInteger >-1</level1negativeInteger>
<level1long >1</level1long>
<level1int >1</level1int>
<level1short >1</level1short>
<level1byte >1</level1byte>
<level1nonNegativeInteger >1</level1nonNegativeInteger>
<level1unsignedLong >1</level1unsignedLong>
<level1unsignedInt >1</level1unsignedInt>
<level1unsignedShort >1</level1unsignedShort>
<level1unsignedByte >1</level1unsignedByte>
<level1positiveInteger >1</level1positiveInteger>
</eleTest>
<simpleDerTest decimalDerived="50" stringDerived="hello" >
<decimalDerived >20</decimalDerived>
<stringDerived >hello</stringDerived>
</simpleDerTest>
<complexTest a="abcd" b="hello" c="50" >
<a >abcd</a>
<b >hello</b>
<c >50</c>
</complexTest>
<complexDerTest a="abcd" b="hello" c="50" >
<a >abcd</a>
<b >hello</b>
<c >50</c>
<d >abcdefg</d>
</complexDerTest>
<unionTest >
<testEle >50</testEle>
<testEle >hello</testEle>
<testEle >200</testEle>
<testEle >abcdefg</testEle>
<testEle2 testAttr="50" />
<testEle2 testAttr="hello" />
<testEle2 testAttr="200" />
<testEle2 testAttr="abcdefg" />
</unionTest>
<anonymousTest partNum="50">
<quantity>50</quantity>
<size>25</size>
<anonElement>11</anonElement>
</anonymousTest>
<xsiTypeTest>
<number>99</number>
<number xsi:type="level1" >74</number>
<number xsi:type="level2" >49</number>
<complexXsi >
<a >a</a>
</complexXsi>
<complexXsi xsi:type="level1Complex" >
<a >a</a>
<b >b</b>
</complexXsi>
<complexXsi xsi:type="level2Complex" >
<a >a</a>
<b >b</b>
<c >c</c>
</complexXsi>
</xsiTypeTest>
<anyTestPartial xhtml:attr2="some value" >
<xhtml:fakeTag1 />
<xhtml:fakeTag2 />
<ss:realTag1 >la</ss:realTag1>
</anyTestPartial>
<anyTest ss:attr1="string" ss:attr2="2" >
<ss:realTag2 >la</ss:realTag2>
<ss:realTag3 >la</ss:realTag3>
<ss:notRealTag >la</ss:notRealTag>
</anyTest>
<anyTestAttr1 ss:attr3="2" />
<anyTestAttr2 ss:attr3="2" />
<anyTestMissing />
<invalidTest simple="abcd" invalid="asdas" >
<simple >abcd</simple>
<complex >
<a >asa</a>
<invalid />
</complex>
<number xsi:type="stringDerivedType" >74</number>
<complexXsi xsi:type="simpleDerTestType" >
<a >a</a>
<b >b</b>
</complexXsi>
<unionTest >hello1</unionTest>
<empty ><a /></empty>
<invalidAttrTest attr="lala" />
<missingAttrTest />
<prohibitedAttrTest attr="lala" />
</invalidTest>
</root>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xsd
Index: TypeInfo.xsd
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" >
<xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" />
<xs:element name="root" type="rootType" />
<xs:complexType name="rootType" >
<xs:sequence>
<xs:element name="attrTest" type="attrTestType" />
<xs:element name="eleTest" type="eleTestType" />
<xs:element name="simpleDerTest" type="simpleDerTestType" />
<xs:element name="complexTest" type="complexTestType" />
<xs:element name="complexDerTest" type="complexDerTestType" />
<xs:element name="unionTest" type="unionTest" />
<xs:element name="anonymousTest" >
<xs:complexType>
<xs:sequence>
<xs:element name="quantity">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name='size'>
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base='xs:integer'/>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base='xs:string'/>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element ref="anonElement" />
</xs:sequence>
<xs:attribute name="partNum" >
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="xsiTypeTest" type="xsiTypeTestType" />
<xs:element name="anyTestPartial" type="anyTestPartialType" />
<xs:element name="anyTest" type="anyTestType" />
<xs:element name="anyTestAttr1" type="anyTestAttr1Type" />
<xs:element name="anyTestAttr2" type="anyTestAttr2Type" />
<xs:element name="anyTestMissing" type="anyTestType" />
<xs:element name="invalidTest" type="invalidTestType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="anyTestPartialType" >
<xs:sequence >
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" />
<xs:any namespace="http://www.secondSchema" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
</xs:complexType>
<xs:complexType name="anyTestType" >
<xs:sequence >
<xs:any namespace="http://www.secondSchema" processContents="lax"/>
<xs:any namespace="http://www.secondSchema" processContents="strict"/>
<xs:any namespace="http://www.secondSchema" processContents="strict"/>
</xs:sequence>
<xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
</xs:complexType>
<xs:complexType name="anyTestAttr1Type" >
<xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" />
</xs:complexType>
<xs:complexType name="anyTestAttr2Type" >
<xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
</xs:complexType>
<xs:complexType name="invalidTestType" >
<xs:sequence >
<xs:element name="simple" type="stringDerivedType" />
<xs:element name="complex" type="baseComplex" />
<xs:element name="number" type="base" />
<xs:element name="complexXsi" type="baseComplex" />
<xs:element name="unionTest" type="uType" />
<xs:element name="invalidAttrTest" type="attrOnlyType" />
<xs:element name="missingAttrTest" type="attrOnlyType" />
<xs:element name="prohibitedAttrTest" type="prohibitedAttrType" />
</xs:sequence>
<xs:attribute name="simple" type="stringDerivedType" />
</xs:complexType>
<xs:complexType name="prohibitedAttrType" >
<xs:attribute name="attr" type="stringDerivedType" use="prohibited" />
</xs:complexType>
<xs:complexType name="attrOnlyType" >
<xs:attribute name="attr" type="stringDerivedType" use="required" />
</xs:complexType>
<xs:simpleType name="uType" >
<xs:union memberTypes="stringDerivedType" />
</xs:simpleType>
<xs:complexType name="xsiTypeTestType" >
<xs:sequence>
<xs:element name="number" type="base" maxOccurs="3"/>
<xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="baseComplex" >
<xs:sequence>
<xs:element name="a" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="level1Complex" >
<xs:complexContent >
<xs:extension base="baseComplex" >
<xs:sequence>
<xs:element name="b" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="level2Complex" >
<xs:complexContent >
<xs:extension base="level1Complex" >
<xs:sequence>
<xs:element name="c" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="base" >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="level1" >
<xs:restriction base="base" >
<xs:maxExclusive value="75"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="level2" >
<xs:restriction base="level1" >
<xs:maxExclusive value="50"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="anonElement" >
<xs:simpleType >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:complexType name="eleTestType" >
<xs:sequence >
<xs:element name="level1string" type="xs:string" />
<xs:element name="level1boolean" type="xs:boolean" />
<xs:element name="level1decimal" type="xs:decimal" />
<xs:element name="level1float" type="xs:float" />
<xs:element name="level1double" type="xs:double" />
<xs:element name="level1duration" type="xs:duration" />
<xs:element name="level1dateTime" type="xs:dateTime" />
<xs:element name="level1time" type="xs:time" />
<xs:element name="level1date" type="xs:date" />
<xs:element name="level1gYearMonth" type="xs:gYearMonth" />
<xs:element name="level1gYear" type="xs:gYear" />
<xs:element name="level1gMonthDay" type="xs:gMonthDay" />
<xs:element name="level1gDay" type="xs:gDay" />
<xs:element name="level1gMonth" type="xs:gMonth" />
<xs:element name="level1hexBinary" type="xs:hexBinary" />
<xs:element name="level1base64Binary" type="xs:base64Binary" />
<xs:element name="level1anyURI" type="xs:anyURI" />
<xs:element name="level1QName" type="xs:QName" />
<xs:element name="level1normalizedString" type="xs:normalizedString" />
<xs:element name="level1token" type="xs:token" />
<xs:element name="level1language" type="xs:language" />
<xs:element name="level1NMTOKEN" type="xs:NMTOKEN" />
<xs:element name="level1NMTOKENS" type="xs:NMTOKENS" />
<xs:element name="level1Name" type="xs:Name" />
<xs:element name="level1NCName" type="xs:NCName" />
<xs:element name="level1integer" type="xs:integer" />
<xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" />
<xs:element name="level1negativeInteger" type="xs:negativeInteger" />
<xs:element name="level1long" type="xs:long" />
<xs:element name="level1int" type="xs:int" />
<xs:element name="level1short" type="xs:short" />
<xs:element name="level1byte" type="xs:byte" />
<xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" />
<xs:element name="level1unsignedLong" type="xs:unsignedLong" />
<xs:element name="level1unsignedInt" type="xs:unsignedInt" />
<xs:element name="level1unsignedShort" type="xs:unsignedShort" />
<xs:element name="level1unsignedByte" type="xs:unsignedByte" />
<xs:element name="level1positiveInteger" type="xs:positiveInteger" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="attrTestType" >
<xs:attribute name="string" type="xs:string" />
<xs:attribute name="boolean" type="xs:boolean" />
<xs:attribute name="decimal" type="xs:decimal" />
<xs:attribute name="float" type="xs:float" />
<xs:attribute name="double" type="xs:double" />
<xs:attribute name="duration" type="xs:duration" />
<xs:attribute name="dateTime" type="xs:dateTime" />
<xs:attribute name="time" type="xs:time" />
<xs:attribute name="date" type="xs:date" />
<xs:attribute name="gYearMonth" type="xs:gYearMonth" />
<xs:attribute name="gYear" type="xs:gYear" />
<xs:attribute name="gMonthDay" type="xs:gMonthDay" />
<xs:attribute name="gDay" type="xs:gDay" />
<xs:attribute name="gMonth" type="xs:gMonth" />
<xs:attribute name="hexBinary" type="xs:hexBinary" />
<xs:attribute name="base64Binary" type="xs:base64Binary" />
<xs:attribute name="anyURI" type="xs:anyURI" />
<xs:attribute name="QName" type="xs:QName" />
<xs:attribute name="normalizedString" type="xs:normalizedString" />
<xs:attribute name="token" type="xs:token" />
<xs:attribute name="language" type="xs:language" />
<xs:attribute name="NMTOKEN" type="xs:NMTOKEN" />
<xs:attribute name="NMTOKENS" type="xs:NMTOKENS" />
<xs:attribute name="Name" type="xs:Name" />
<xs:attribute name="NCName" type="xs:NCName" />
<xs:attribute name="ID" type="xs:ID" />
<xs:attribute name="IDREF" type="xs:IDREF" />
<xs:attribute name="IDREFS" type="xs:IDREFS" />
<xs:attribute name="ENTITY" type="xs:ENTITY" />
<xs:attribute name="ENTITIES" type="xs:ENTITIES" />
<xs:attribute name="integer" type="xs:integer" />
<xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" />
<xs:attribute name="negativeInteger" type="xs:negativeInteger" />
<xs:attribute name="long" type="xs:long" />
<xs:attribute name="int" type="xs:int" />
<xs:attribute name="short" type="xs:short" />
<xs:attribute name="byte" type="xs:byte" />
<xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" />
<xs:attribute name="unsignedLong" type="xs:unsignedLong" />
<xs:attribute name="unsignedInt" type="xs:unsignedInt" />
<xs:attribute name="unsignedShort" type="xs:unsignedShort" />
<xs:attribute name="unsignedByte" type="xs:unsignedByte" />
<xs:attribute name="positiveInteger" type="xs:positiveInteger" />
<xs:attribute name="defaultString" type="xs:string" default="hello" />
<xs:attribute name="defaultInt" type="xs:integer" default="12" />
</xs:complexType>
<xs:complexType name="simpleDerTestType" >
<xs:sequence>
<xs:element name="decimalDerived" type="decimalDerivedType" />
<xs:element name="stringDerived" type="stringDerivedType" />
</xs:sequence>
<xs:attribute name="decimalDerived" type="decimalDerivedType" />
<xs:attribute name="stringDerived" type="stringDerivedType" />
</xs:complexType>
<xs:simpleType name="stringDerivedType" >
<xs:restriction base="xs:string" >
<xs:pattern value="hello"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="decimalDerivedType" >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="complexTestType" >
<xs:sequence>
<xs:element name="a" type="xs:string"/>
<xs:element name="b" type="stringDerivedType"/>
<xs:element name="c" type="decimalDerivedType"/>
</xs:sequence>
<xs:attribute name="a" type="xs:string" />
<xs:attribute name="b" type="stringDerivedType" />
<xs:attribute name="c" type="decimalDerivedType" />
</xs:complexType>
<xs:complexType name="complexDerTestType" >
<xs:complexContent >
<xs:extension base="complexTestType" >
<xs:sequence>
<xs:element name="d" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="unionTestType" >
<xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" />
</xs:simpleType>
<xs:complexType name="unionTest" >
<xs:sequence >
<xs:element name="testEle" maxOccurs="4" type="unionTestType" />
<xs:element name="testEle2" maxOccurs="4" >
<xs:complexType >
<xs:attribute name="testAttr" type="unionTestType" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="unionTest2" >
<xs:sequence >
<xs:element name="testEle" maxOccurs="4" >
<xs:complexType >
<xs:simpleContent >
<xs:extension base="unionTestType" >
<xs:attribute name="testAttr" type="unionTestType" />
</xs:extension >
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="testtype2" >
<xs:sequence>
<xs:element name="poo" type="xs:string"/>
</xs:sequence>
<xs:attribute name="a" type="xs:IDREF" />
<xs:attribute name="b" type="xs:ID" />
<xs:attribute name="c" type="xs:string" />
</xs:complexType>
</xs:schema>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoJustDTD.xml
Index: TypeInfoJustDTD.xml
===================================================================
<!DOCTYPE attributeTest SYSTEM "TypeInfo.dtd" >
<attributeTest
xmlns:foo = "lala"
cdata = "cdata"
enum = "a"
id = "someID"
idRef = "someID"
idRefs = "someID"
nmToken = "abc"
nmTokenDefault2 = "test"
nmTokens = "abc"
entity = "APACHE"
entities = "APACHE"
notation = "png"
noDecl = "lalal"
/>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xml
Index: TypeInfoNoDTD.xml
===================================================================
<root xsi:noNamespaceSchemaLocation="TypeInfoNoDTD.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" >
<attrTest
string="string"
boolean="true"
decimal="2.0"
float="2.1"
double="2.1"
duration="P1Y2M3DT10H30M"
dateTime="2000-10-30T11:12:00"
time="11:12:00"
date="2000-10-30"
gYearMonth="1999-01"
gYear="1999"
gMonthDay="--01-08"
gDay="---21"
gMonth="--12--"
hexBinary="0FB7"
base64Binary="abcd"
anyURI="http://www.example.com/"
QName="xsla"
normalizedString="example"
token="example"
language="en"
NMTOKEN="example"
NMTOKENS="example bar"
Name="example"
NCName="example"
integer="1"
nonPositiveInteger="-1"
negativeInteger="-1"
long="1"
int="1"
short="1"
byte="1"
nonNegativeInteger="1"
unsignedLong="1"
unsignedInt="1"
unsignedShort="1"
unsignedByte="1"
positiveInteger="1"
ID="abc"
IDREF="abc"
IDREFS="abc"
defaultString="test"
xmlns:prefix="http://lala"
xsi:noNamespaceSchemaLocation="hello"
/>
<eleTest >
<level1string >string</level1string>
<level1boolean >true</level1boolean>
<level1decimal >2.0</level1decimal>
<level1float >2.1</level1float>
<level1double >2.1</level1double>
<level1duration >P1Y2M3DT10H30M</level1duration>
<level1dateTime >2000-10-30T11:12:00</level1dateTime>
<level1time >11:12:00</level1time>
<level1date >2000-10-30</level1date>
<level1gYearMonth >1999-01</level1gYearMonth>
<level1gYear >1999</level1gYear>
<level1gMonthDay >--01-08</level1gMonthDay>
<level1gDay >---21</level1gDay>
<level1gMonth >--12--</level1gMonth>
<level1hexBinary >0FB7</level1hexBinary>
<level1base64Binary >abcd</level1base64Binary>
<level1anyURI >http://www.example.com/</level1anyURI>
<level1QName >xsla</level1QName>
<level1normalizedString >example</level1normalizedString>
<level1token >example</level1token>
<level1language >en</level1language>
<level1NMTOKEN >example</level1NMTOKEN>
<level1NMTOKENS >example bar</level1NMTOKENS>
<level1Name >example</level1Name>
<level1NCName >example</level1NCName>
<level1integer >1</level1integer>
<level1nonPositiveInteger >-1</level1nonPositiveInteger>
<level1negativeInteger >-1</level1negativeInteger>
<level1long >1</level1long>
<level1int >1</level1int>
<level1short >1</level1short>
<level1byte >1</level1byte>
<level1nonNegativeInteger >1</level1nonNegativeInteger>
<level1unsignedLong >1</level1unsignedLong>
<level1unsignedInt >1</level1unsignedInt>
<level1unsignedShort >1</level1unsignedShort>
<level1unsignedByte >1</level1unsignedByte>
<level1positiveInteger >1</level1positiveInteger>
</eleTest>
<simpleDerTest decimalDerived="50" stringDerived="hello" >
<decimalDerived >20</decimalDerived>
<stringDerived >hello</stringDerived>
</simpleDerTest>
<complexTest a="abcd" b="hello" c="50" >
<a >abcd</a>
<b >hello</b>
<c >50</c>
</complexTest>
<complexDerTest a="abcd" b="hello" c="50" >
<a >abcd</a>
<b >hello</b>
<c >50</c>
<d >abcdefg</d>
</complexDerTest>
<unionTest >
<testEle >50</testEle>
<testEle >hello</testEle>
<testEle >200</testEle>
<testEle >abcdefg</testEle>
<testEle2 testAttr="50" />
<testEle2 testAttr="hello" />
<testEle2 testAttr="200" />
<testEle2 testAttr="abcdefg" />
</unionTest>
<anonymousTest partNum="50">
<quantity>50</quantity>
<size>25</size>
<anonElement>11</anonElement>
</anonymousTest>
<xsiTypeTest>
<number>99</number>
<number xsi:type="level1" >74</number>
<number xsi:type="level2" >49</number>
<complexXsi >
<a >a</a>
</complexXsi>
<complexXsi xsi:type="level1Complex" >
<a >a</a>
<b >b</b>
</complexXsi>
<complexXsi xsi:type="level2Complex" >
<a >a</a>
<b >b</b>
<c >c</c>
</complexXsi>
</xsiTypeTest>
<anyTestPartial xhtml:attr2="some value" >
<xhtml:fakeTag1 />
<xhtml:fakeTag2 />
<ss:realTag1 >la</ss:realTag1>
</anyTestPartial>
<anyTest ss:attr1="string" ss:attr2="2" >
<ss:realTag2 >la</ss:realTag2>
<ss:realTag3 >la</ss:realTag3>
<ss:notRealTag >la</ss:notRealTag>
</anyTest>
<anyTestAttr1 ss:attr3="2" />
<anyTestAttr2 ss:attr3="2" />
<anyTestMissing />
<invalidTest simple="abcd" invalid="asdas" >
<simple >abcd</simple>
<complex >
<a >asa</a>
<invalid />
</complex>
<number xsi:type="stringDerivedType" >74</number>
<complexXsi xsi:type="simpleDerTestType" >
<a >a</a>
<b >b</b>
</complexXsi>
<unionTest >hello1</unionTest>
<empty ><a /></empty>
<invalidAttrTest attr="lala" />
<missingAttrTest />
<prohibitedAttrTest attr="lala" />
</invalidTest>
</root>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xsd
Index: TypeInfoNoDTD.xsd
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" >
<xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" />
<xs:element name="root" type="rootType" />
<xs:complexType name="rootType" >
<xs:sequence>
<xs:element name="attrTest" type="attrTestType" />
<xs:element name="eleTest" type="eleTestType" />
<xs:element name="simpleDerTest" type="simpleDerTestType" />
<xs:element name="complexTest" type="complexTestType" />
<xs:element name="complexDerTest" type="complexDerTestType" />
<xs:element name="unionTest" type="unionTest" />
<xs:element name="anonymousTest" >
<xs:complexType>
<xs:sequence>
<xs:element name="quantity">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name='size'>
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base='xs:integer'/>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base='xs:string'/>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element ref="anonElement" />
</xs:sequence>
<xs:attribute name="partNum" >
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="xsiTypeTest" type="xsiTypeTestType" />
<xs:element name="anyTestPartial" type="anyTestPartialType" />
<xs:element name="anyTest" type="anyTestType" />
<xs:element name="anyTestAttr1" type="anyTestAttr1Type" />
<xs:element name="anyTestAttr2" type="anyTestAttr2Type" />
<xs:element name="anyTestMissing" type="anyTestType" />
<xs:element name="invalidTest" type="invalidTestType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="anyTestPartialType" >
<xs:sequence >
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" />
<xs:any namespace="http://www.secondSchema" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
</xs:complexType>
<xs:complexType name="anyTestType" >
<xs:sequence >
<xs:any namespace="http://www.secondSchema" processContents="lax"/>
<xs:any namespace="http://www.secondSchema" processContents="strict"/>
<xs:any namespace="http://www.secondSchema" processContents="strict"/>
</xs:sequence>
<xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
</xs:complexType>
<xs:complexType name="anyTestAttr1Type" >
<xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" />
</xs:complexType>
<xs:complexType name="anyTestAttr2Type" >
<xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
</xs:complexType>
<xs:complexType name="invalidTestType" >
<xs:sequence >
<xs:element name="simple" type="stringDerivedType" />
<xs:element name="complex" type="baseComplex" />
<xs:element name="number" type="base" />
<xs:element name="complexXsi" type="baseComplex" />
<xs:element name="unionTest" type="uType" />
<xs:element name="invalidAttrTest" type="attrOnlyType" />
<xs:element name="missingAttrTest" type="attrOnlyType" />
<xs:element name="prohibitedAttrTest" type="prohibitedAttrType" />
</xs:sequence>
<xs:attribute name="simple" type="stringDerivedType" />
</xs:complexType>
<xs:complexType name="prohibitedAttrType" >
<xs:attribute name="attr" type="stringDerivedType" use="prohibited" />
</xs:complexType>
<xs:complexType name="attrOnlyType" >
<xs:attribute name="attr" type="stringDerivedType" use="required" />
</xs:complexType>
<xs:simpleType name="uType" >
<xs:union memberTypes="stringDerivedType" />
</xs:simpleType>
<xs:complexType name="xsiTypeTestType" >
<xs:sequence>
<xs:element name="number" type="base" maxOccurs="3"/>
<xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="baseComplex" >
<xs:sequence>
<xs:element name="a" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="level1Complex" >
<xs:complexContent >
<xs:extension base="baseComplex" >
<xs:sequence>
<xs:element name="b" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="level2Complex" >
<xs:complexContent >
<xs:extension base="level1Complex" >
<xs:sequence>
<xs:element name="c" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="base" >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="level1" >
<xs:restriction base="base" >
<xs:maxExclusive value="75"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="level2" >
<xs:restriction base="level1" >
<xs:maxExclusive value="50"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="anonElement" >
<xs:simpleType >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:complexType name="eleTestType" >
<xs:sequence >
<xs:element name="level1string" type="xs:string" />
<xs:element name="level1boolean" type="xs:boolean" />
<xs:element name="level1decimal" type="xs:decimal" />
<xs:element name="level1float" type="xs:float" />
<xs:element name="level1double" type="xs:double" />
<xs:element name="level1duration" type="xs:duration" />
<xs:element name="level1dateTime" type="xs:dateTime" />
<xs:element name="level1time" type="xs:time" />
<xs:element name="level1date" type="xs:date" />
<xs:element name="level1gYearMonth" type="xs:gYearMonth" />
<xs:element name="level1gYear" type="xs:gYear" />
<xs:element name="level1gMonthDay" type="xs:gMonthDay" />
<xs:element name="level1gDay" type="xs:gDay" />
<xs:element name="level1gMonth" type="xs:gMonth" />
<xs:element name="level1hexBinary" type="xs:hexBinary" />
<xs:element name="level1base64Binary" type="xs:base64Binary" />
<xs:element name="level1anyURI" type="xs:anyURI" />
<xs:element name="level1QName" type="xs:QName" />
<xs:element name="level1normalizedString" type="xs:normalizedString" />
<xs:element name="level1token" type="xs:token" />
<xs:element name="level1language" type="xs:language" />
<xs:element name="level1NMTOKEN" type="xs:NMTOKEN" />
<xs:element name="level1NMTOKENS" type="xs:NMTOKENS" />
<xs:element name="level1Name" type="xs:Name" />
<xs:element name="level1NCName" type="xs:NCName" />
<xs:element name="level1integer" type="xs:integer" />
<xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" />
<xs:element name="level1negativeInteger" type="xs:negativeInteger" />
<xs:element name="level1long" type="xs:long" />
<xs:element name="level1int" type="xs:int" />
<xs:element name="level1short" type="xs:short" />
<xs:element name="level1byte" type="xs:byte" />
<xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" />
<xs:element name="level1unsignedLong" type="xs:unsignedLong" />
<xs:element name="level1unsignedInt" type="xs:unsignedInt" />
<xs:element name="level1unsignedShort" type="xs:unsignedShort" />
<xs:element name="level1unsignedByte" type="xs:unsignedByte" />
<xs:element name="level1positiveInteger" type="xs:positiveInteger" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="attrTestType" >
<xs:attribute name="string" type="xs:string" />
<xs:attribute name="boolean" type="xs:boolean" />
<xs:attribute name="decimal" type="xs:decimal" />
<xs:attribute name="float" type="xs:float" />
<xs:attribute name="double" type="xs:double" />
<xs:attribute name="duration" type="xs:duration" />
<xs:attribute name="dateTime" type="xs:dateTime" />
<xs:attribute name="time" type="xs:time" />
<xs:attribute name="date" type="xs:date" />
<xs:attribute name="gYearMonth" type="xs:gYearMonth" />
<xs:attribute name="gYear" type="xs:gYear" />
<xs:attribute name="gMonthDay" type="xs:gMonthDay" />
<xs:attribute name="gDay" type="xs:gDay" />
<xs:attribute name="gMonth" type="xs:gMonth" />
<xs:attribute name="hexBinary" type="xs:hexBinary" />
<xs:attribute name="base64Binary" type="xs:base64Binary" />
<xs:attribute name="anyURI" type="xs:anyURI" />
<xs:attribute name="QName" type="xs:QName" />
<xs:attribute name="normalizedString" type="xs:normalizedString" />
<xs:attribute name="token" type="xs:token" />
<xs:attribute name="language" type="xs:language" />
<xs:attribute name="NMTOKEN" type="xs:NMTOKEN" />
<xs:attribute name="NMTOKENS" type="xs:NMTOKENS" />
<xs:attribute name="Name" type="xs:Name" />
<xs:attribute name="NCName" type="xs:NCName" />
<xs:attribute name="ID" type="xs:ID" />
<xs:attribute name="IDREF" type="xs:IDREF" />
<xs:attribute name="IDREFS" type="xs:IDREFS" />
<xs:attribute name="integer" type="xs:integer" />
<xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" />
<xs:attribute name="negativeInteger" type="xs:negativeInteger" />
<xs:attribute name="long" type="xs:long" />
<xs:attribute name="int" type="xs:int" />
<xs:attribute name="short" type="xs:short" />
<xs:attribute name="byte" type="xs:byte" />
<xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" />
<xs:attribute name="unsignedLong" type="xs:unsignedLong" />
<xs:attribute name="unsignedInt" type="xs:unsignedInt" />
<xs:attribute name="unsignedShort" type="xs:unsignedShort" />
<xs:attribute name="unsignedByte" type="xs:unsignedByte" />
<xs:attribute name="positiveInteger" type="xs:positiveInteger" />
<xs:attribute name="defaultString" type="xs:string" default="hello" />
<xs:attribute name="defaultInt" type="xs:integer" default="12" />
</xs:complexType>
<xs:complexType name="simpleDerTestType" >
<xs:sequence>
<xs:element name="decimalDerived" type="decimalDerivedType" />
<xs:element name="stringDerived" type="stringDerivedType" />
</xs:sequence>
<xs:attribute name="decimalDerived" type="decimalDerivedType" />
<xs:attribute name="stringDerived" type="stringDerivedType" />
</xs:complexType>
<xs:simpleType name="stringDerivedType" >
<xs:restriction base="xs:string" >
<xs:pattern value="hello"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="decimalDerivedType" >
<xs:restriction base="xs:decimal" >
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="complexTestType" >
<xs:sequence>
<xs:element name="a" type="xs:string"/>
<xs:element name="b" type="stringDerivedType"/>
<xs:element name="c" type="decimalDerivedType"/>
</xs:sequence>
<xs:attribute name="a" type="xs:string" />
<xs:attribute name="b" type="stringDerivedType" />
<xs:attribute name="c" type="decimalDerivedType" />
</xs:complexType>
<xs:complexType name="complexDerTestType" >
<xs:complexContent >
<xs:extension base="complexTestType" >
<xs:sequence>
<xs:element name="d" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="unionTestType" >
<xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" />
</xs:simpleType>
<xs:complexType name="unionTest" >
<xs:sequence >
<xs:element name="testEle" maxOccurs="4" type="unionTestType" />
<xs:element name="testEle2" maxOccurs="4" >
<xs:complexType >
<xs:attribute name="testAttr" type="unionTestType" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="unionTest2" >
<xs:sequence >
<xs:element name="testEle" maxOccurs="4" >
<xs:complexType >
<xs:simpleContent >
<xs:extension base="unionTestType" >
<xs:attribute name="testAttr" type="unionTestType" />
</xs:extension >
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="testtype2" >
<xs:sequence>
<xs:element name="poo" type="xs:string"/>
</xs:sequence>
<xs:attribute name="a" type="xs:IDREF" />
<xs:attribute name="b" type="xs:ID" />
<xs:attribute name="c" type="xs:string" />
</xs:complexType>
</xs:schema>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/combined.dtd
Index: combined.dtd
===================================================================
<!ELEMENT root (level1, level1a) >
<!ATTLIST root
xsi:noNamespaceSchemaLocation CDATA #REQUIRED
xmlns:xsi CDATA #REQUIRED
attBoth CDATA #REQUIRED
attDTD CDATA #REQUIRED
>
<!ELEMENT level1 (#PCDATA) >
<!ELEMENT level1a (#PCDATA) >
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/combined.xml
Index: combined.xml
===================================================================
<!DOCTYPE root SYSTEM "combined.dtd" >
<root xsi:noNamespaceSchemaLocation="combined.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attBoth="lala"
attSchema="lala" attDTD="lala"
>
<level1 >content</level1>
<level1a >content</level1a>
</root>
1.1 xml-xerces/c/tests/DOM/TypeInfo/data/combined.xsd
Index: combined.xsd
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" >
<xs:element name="root" type="rootType" />
<xs:complexType name="rootType" >
<xs:sequence >
<xs:element name="level1" type="xs:string" />
</xs:sequence>
<xs:attribute name="attBoth" type="xs:string" />
<xs:attribute name="attSchema" type="xs:string" />
</xs:complexType>
</xs:schema>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org