35 const std::string & s)
38 elementQualified_ (false),
39 attributeQualified_ (false),
40 deleteXmlParser_(false),
41 resolveFwdRefs_(true),
52 const std::string & s)
55 elementQualified_ (false),
56 attributeQualified_ (false),
57 deleteXmlParser_(false),
58 resolveFwdRefs_(true),
65 xmlStream_.open(fname_.c_str());
73 xParser_->
getName() ==
"schema")
75 deleteXmlParser_=
true;
89 uri_ = Uri.substr(0,Uri.rfind(
'/') + 1);
97 lAttributeGroups_.clear();
98 importedSchemas_.clear();
101 if (confPath_.empty()) {
103 confPath_ = SCHEMADIR;
105 confPath_ =
"src/schemas";
113 lElems_.push_back(e);
126 if(deleteXmlParser_) {
132 for (ConstraintList::iterator ci=constraints_.begin();
133 ci != constraints_.end();
136 for (AttributeGroupList::iterator agi = lAttributeGroups_.begin();
137 agi != lAttributeGroups_.end();
160 for (i = 0; i < attcnt; i++) {
162 if (
"targetNamespace" == attName)
165 if (
"version" == attName)
167 if (
"elementFormDefault" == attName){
169 elementQualified_ =
false;
172 elementQualified_ =
true;
174 if (
"attributeFormDefault" == attName) {
176 attributeQualified_ =
false;
179 attributeQualified_ =
true;
190 return parseSchema();
193 logFile_ <<
"Error parsing schema for namespace "<<tnsUri_<<std::endl;
214SchemaParser::parseSchema(std::string tag)
223 if (xParser_->
getName() == tag)
238 std::string elemName = xParser_->
getName();
239 if (elemName ==
"element") {
241 Element e = parseElement(fwd);
242 lElems_.push_back(e);
244 else if (elemName ==
"complexType")
246 XSDType *t = parseComplexType();
249 else if (elemName ==
"simpleType")
251 XSDType *t = parseSimpleType();
254 else if (elemName ==
"attribute") {
256 lAttributes_.push_back(parseAttribute(fwd));
258 else if (elemName ==
"annotation"){
261 else if (elemName ==
"import") {
264 else if (elemName==
"include"){
267 else if(elemName==
"attributeGroup") {
268 AttributeGroup* ag = parseAttributeGroup();
270 lAttributeGroups_.push_back(ag);
272 }
else if(elemName==
"group") {
274 lGroups_.push_back(parseGroup());
275 Group & g=lGroups_.back();
277 g.setContents(g.getContents(),
false);
279 else if( elemName==
"key") {
281 constraints_.push_back(parseConstraint(
Schema::Key));
283 else if( elemName==
"keyref") {
286 else if( elemName==
"unique") {
288 }
else if (elemName==
"redefine"){
292 error(
"Unknown element "+ elemName,1);
298 if ((importedSchemas_.size() == 0) &&
302 error(
"Undefined Types in namespace "+tnsUri_);
307 resolveForwardElementRefs();
308 resolveForwardAttributeRefs();
312 catch(SchemaParserException spe)
317 logFile_ << spe.description <<
" at "
318 << spe.line <<
":" << spe.col
327void SchemaParser::parseAnnotation()
334 && xParser_->
getName() ==
"annotation")
342SchemaParser::parseComplexType()
344 ComplexType *newType =
new ComplexType(tnsUri_);
346 for (
int i = 0; i < attcnt; i++)
365 if (xParser_->
getName() ==
"complexType")
372 std::string elemName = xParser_->
getName();
375 if (elemName ==
"all"){
377 newType->setContents(cm);
380 else if (elemName ==
"sequence"){
382 newType->setContents(cm);
385 else if (elemName ==
"choice"){
387 newType->setContents(cm);
390 else if (elemName ==
"attribute") {
392 Attribute a=parseAttribute(f);
393 newType->addAttribute(a,f);
394 }
else if (elemName==
"attributeGroup"){
395 parseAttributeGroup(newType);
397 else if (elemName==
"group"){
400 newType->setContents(cm);
403 else if (elemName ==
"anyAttribute")
404 addAnyAttribute(newType);
406 else if (elemName ==
"complexContent")
407 parseComplexContent(newType);
409 else if (elemName ==
"simpleContent")
410 parseSimpleContent(newType);
412 else if (xParser_->
getName() ==
"annotation")
416 error(
"Unexpected tag: '"+elemName+
"' in "+newType->getName() );
419 makeListFromSoapArray(newType);
424SchemaParser::parseAttributeGroup(ComplexType* cType)
426 std::string name,ref;
434 for(list<Attribute>::iterator ai= ag->begin();
437 cType->addAttribute(*ai);
440 cType->addAttributeGroupName(ref);
447 AttributeGroup *ag =
new AttributeGroup(name);
449 while (xParser_->
getName() ==
"annotation")
454 std::string elemName=xParser_->
getName();
456 (elemName ==
"attributeGroup"))){
458 if(elemName==
"attribute"){
460 ag->addAttribute(parseAttribute(fwd));
461 }
else if(elemName==
"attributeGroup"){
462 AttributeGroup* ag1=parseAttributeGroup();
463 for(list<Attribute>::iterator ai= ag1->begin();
466 ag->addAttribute(*ai);
467 }
else if(elemName==
"anyAttribute"){
468 ag->addAttribute(addAnyAttribute(cType));
476 for(list<Attribute>::iterator ai= ag->begin();
479 cType->addAttribute(*ai);
487SchemaParser::parseGroup(ContentModel* c)
489 int minimum = 1, maximum = 1;
490 std::string tmp, name,ref;
497 if (
"unbounded" == tmp)
515 Group g(gName.getLocalName(),minimum,maximum);
523 Group g(name,minimum,maximum);
525 while (xParser_->
getName() ==
"annotation") {
530 std::string elemName = xParser_->
getName();
532 if (elemName ==
"all"){
535 else if (elemName ==
"sequence"){
538 else if (elemName ==
"choice"){
541 g.setContents(cm,
true);
546 c->addGroup(g,
false);
551SchemaParser::parseContent(ContentModel * cm)
553 int minimum = 1, maximum = 1;
562 if (
"unbounded" == tmp)
571 while (xParser_->
getName() ==
"annotation")
578 (xParser_->
getName() ==
"choice"
579 || xParser_->
getName() ==
"sequence"
580 || xParser_->
getName() ==
"all")))
582 if (xParser_->
getName() ==
"element") {
584 Element e =parseElement(f);
588 if (xParser_->
getName() ==
"any")
590 else if (xParser_->
getName() ==
"choice"){
592 cm->addContentModel(cmc);
595 else if (xParser_->
getName() ==
"sequence"){
597 cm->addContentModel(cms);
600 else if (xParser_->
getName() ==
"group"){
603 else if(xParser_->
getName() ==
"annotation") {
607 error(
"parseContent: Unexpected tag "+xParser_->
getName());
610 error(
"parseContent <all>:Syntax Error");
617SchemaParser::parseElement(
bool & fwdRef)
619 std::string name, fixedVal, defaultVal,
622 typeNs = tnsUri_,elemNs = tnsUri_;
624 int type_id = 0, minimum = 1, maximum = 1, attcnt;
626 bool qualified =
false,nill =
false;
630 for (
int i = 0; i < attcnt; i++)
633 if (
"name" == attName)
636 else if (
"type" == attName)
641 (
"<element> : type and ref are mutually exclusive in element decl");
642 typeName.setNamespace(typeNs=xParser_->
getNamespace(typeName.getPrefix()));
645 error(
"<element>:Could not resolve type " +
646 typeName.getNamespace() +
":" +
647 typeName.getLocalName(),0);
650 else if (
"form" == attName)
658 error(
"<element>:Invalid value for form in element " +
662 else if (
"ref" == attName)
666 (
"<element>:name and ref are mutually exclusive in element decl");
669 (
"<element>:type and ref are mutually exclusive in element decl");
677 e =
const_cast<Element*
>(
getElement(refName));
679 type_id = e->getType();
684 if(i>=0 && importedSchemas_[i].sParser) {
686 e=
const_cast<Element*
>(importedSchemas_[i].sParser->getElement(refName));
691 const XSDType* pType = importedSchemas_[i].sParser->getType(e->getType());
702 lForwardElemRefs_.push_back(refName);
707 qualified = e->isQualified();
708 defaultVal = e->defaultVal();
709 fixedVal = e->fixedVal();
710 typeNs = e->getTypeNamespace();
711 elemNs = e->getNamespace();
715 logFile_<<elemNs<<
":"<<name<<
" -> element reference("<<type_id<<
")"<<std::endl;
719 else if (
"minOccurs" == attName){
722 else if (
"maxOccurs" == attName){
728 error(
"<element>:Invalid value for maxOccurs",1);
732 else if (
"default" == attName){
733 if (fixedVal.empty())
737 error(
"<element>:fixed and default cannot occur together");
739 else if (
"fixed" == attName){
740 if (defaultVal.empty())
744 error(
"<element>:fixed and default cannot occur together");
747 else if (
"substitutionGroup" == attName) {
751 else if (
"nillable" == attName) {
758 error(
"<element>:Unsupported Attribute "+attName ,2) ;
764 std::string elemName=xParser_->
getName();
766 if (elemName ==
"element")
774 if (elemName ==
"complexType"){
775 elemType = parseComplexType();
776 type_id = typesTable_.
addType(elemType);
777 typeNs = elemType->getNamespace();
779 else if (elemName ==
"simpleType"){
780 elemType = parseSimpleType();
781 type_id = typesTable_.
addType(elemType);
782 typeNs = elemType->getNamespace();
784 else if (elemName ==
"annotation"){
787 else if( elemName==
"key") {
792 else if( elemName==
"keyref") {
797 else if( elemName==
"unique") {
803 error(
"<element> : syntax error or unkown tag :"+elemName);
808 if (nill && type_id == 0) {
812 constraints_.push_back(c);
829 Constraint * c=
new Constraint(cstr);
835 std::string elemName=xParser_->
getName();
847 if(elemName==
"selector"){
851 else if(elemName==
"field"){
861SchemaParser::addAny(ContentModel* cm)
868 for (
int i = 0; i < attcnt; i++)
871 if (
"namespace" == attr)
874 else if (
"minOccurs" == attr)
877 else if (
"maxOccurs" == attr)
884 error(
"<element>:Invalid value for maxOccurs",1);
889 else if (
"processContents" == attr ||
"id" == attr) {
894 error(
"<any>:Unsupported Attribute "+attr,2);
902 if (xParser_->
getName() ==
"any")
923SchemaParser::addAnyAttribute(ComplexType * cType)
927 bool qualified =
true;
931 for (
int i = 0; i < attcnt; i++)
934 if (
"namespace" == attr)
937 else if (
"processContents" == attr ||
"id" == attr)
943 error(
"<anyAttribute>:Unsupported Attribute "+attr,1);
950 cType->addAttribute(a);
952 while (xParser_->
getName() ==
"annotation")
964SchemaParser::parseAttribute(
bool & fwdRef)
966 std::string name, fixedVal, defaultVal;
967 int type_id = 0, attcnt;
968 bool qualified =
false, use =
false;
973 for (
int i = 0; i < attcnt; i++) {
979 if (
"name" == attName)
981 else if (
"type" == attName) {
983 error(
"<attribute>:type and ref are mutually exclusive in element decl");
984 Qname typeName(attVal);
985 typeName.setNamespace(xParser_->
989 error(
"<attribute>:Could not resolve type " +
990 typeName.getNamespace() +
991 ":" +typeName.getLocalName(),1);
993 else if (
"form" == attName) {
994 if (
"qualified" == attVal)
999 else if (
"ref" == attName) {
1001 error(
"<attribute>:name and ref are mutually exclusive in element decl");
1003 error(
"<attribute>:type and ref are mutually exclusive in element decl");
1004 refAttribute = attVal;
1011 if(i >=0 && importedSchemas_[i].sParser){
1012 a=importedSchemas_[i].sParser->getAttribute(refAttribute);
1021 lForwardAttributeRefs_.push_back(refAttribute);
1024 name = a->getName();
1025 type_id = a->getType();
1026 qualified = a->isQualified();
1027 if (defaultVal.empty())
1028 defaultVal = a->defaultVal();
1029 if (fixedVal.empty())
1030 fixedVal = a->fixedVal();
1033 else if (
"default" == attName) {
1034 if (fixedVal.empty())
1035 defaultVal = attVal;
1038 (
"<attribute>:fixed and default cannot occur together");
1040 else if (
"fixed" == attName) {
1041 if (defaultVal.empty())
1044 error(
"<attribute>:fixed and default cannot occur together");
1046 else if (
"use" == attName) {
1047 if (attVal ==
"required")
1054 if(!attNs.empty() && ((n=checkImport(attNs))!=-1)){
1058 error(
"<attribute>:Unsupported attribute {"+ attNs+
"}:"+attName,2);
1068 if (xParser_->
getName() ==
"attribute")
1076 else if (xParser_->
getName() ==
"simpleType")
1078 XSDType *elemType = parseSimpleType();
1081 type_id = typesTable_.
addType(elemType);
1084 else if (xParser_->
getName() ==
"annotation")
1087 error(
"<attribute>:Syntax error or unkown tag "+xParser_->
getName());
1102SchemaParser::parseSimpleType()
1104 SimpleType *st =
new SimpleType(tnsUri_);
1105 int basetype_id = 0;
1108 for (
int i = 0; i < attcnt; i++)
1115 ":Unknown/Unsupported attribute ",2);
1123 if (xParser_->
getName() ==
"simpleType")
1130 if (xParser_->
getName() ==
"restriction")
1133 for (
int i = 0; i < attcnt; i++)
1138 typeName.setNamespace(xParser_->
1141 st->setBaseType(basetype_id =
1143 if (basetype_id == 0)
1144 error(
"<simpleType>:" +
1146 ":Unknown base type ",1);
1150 ":Unknown/Unsupported attribute for <restriction>",2);
1152 parseRestriction(st);
1154 else if (xParser_->
getName() ==
"union"){
1158 while(s < members.length()){
1159 while(members[s]==
' ')s++;
1160 std::string type = members.substr(s,members.find(
' ',s)-s);
1161 Qname typeName(type);
1162 typeName.setNamespace(xParser_->
getNamespace(typeName.getPrefix()));
1164 st->setUnionType(basetype_id);
1169 while(xParser_->
getName() ==
"simpleType"){
1170 XSDType * t = parseSimpleType();
1173 st->setUnionType(i);
1177 else if(xParser_->
getName() ==
"list"){
1180 st->setListType(basetype_id);
1183 else if (xParser_->
getName() ==
"annotation")
1186 error(
"<simpleType>:Syntax error");
1193SchemaParser::parseRestriction(SimpleType * st,
1196 if (st->getBaseTypeId() == 0)
1197 error(
"<restriction>:unkown BaseType",1);
1203 if (xParser_->
getName() ==
"restriction")
1207 if (xParser_->
getName() ==
"restriction"
1211 while (xParser_->
getName() ==
"annotation") {
1215 if(xParser_->
getName()==
"attribute" && ct!=0){
1217 Attribute a=parseAttribute(f);
1218 ct->addAttribute(a,f);
1220 else if (st->isvalidFacet(xParser_->
getName())){
1223 st->setFacetValue(xParser_->
getName(),
1226 error(
"<restriction>:" + xParser_->
getName() +
1227 " is not a valid facet /attribute for the type",1);
1233SchemaParser::parseComplexContent(ComplexType * ct)
1242 while (xParser_->
getName() ==
"annotation") {
1247 if (xParser_->
getName() ==
"restriction") {
1249 for (i = 0; i < attcnt; i++) {
1257 ct->setBaseType(
getTypeId(typeName,
true),
1260 else if (xParser_->
getName() ==
"extension") {
1262 for (i = 0; i < attcnt; i++) {
1269 ct->setBaseType(
getTypeId(typeName,
true),
1274 while (xParser_->
getName() ==
"annotation") {
1280 std::string elemName=xParser_->
getName();
1281 ContentModel * cm=0;
1282 if (elemName ==
"all"){
1285 else if (elemName ==
"sequence"){
1288 else if (elemName ==
"choice"){
1294 ct->setContents(cm);
1301 if (xParser_->
getName() ==
"attribute") {
1303 Attribute a=parseAttribute(f);
1304 ct->addAttribute(a,f);
1306 else if(xParser_->
getName() ==
"attributeGroup")
1308 parseAttributeGroup(ct);
1311 else if (xParser_->
getName() ==
"anyAttribute")
1312 addAnyAttribute(ct);
1320 if ((xParser_->
getName() ==
"restriction" ||
1321 xParser_->
getName() ==
"extension") )
1332SchemaParser::parseSimpleContent(ComplexType * ct)
1336 if (xParser_->
getName() ==
"restriction")
1338 SimpleType *st =
new SimpleType(tnsUri_);
1340 int basetype_id = 0;
1341 for (
int i = 0; i < attcnt; i++)
1348 st->setBaseType(basetype_id =
getTypeId(typeName,
true));
1349 if (basetype_id == 0)
1350 error(
"<simpleContent> :" +
1352 ":Unknown base type ",1);
1357 ":Unknown/Unsupported attribute ",2);
1359 parseRestriction(st,ct);
1360 int typeId = typesTable_.
addType(st);
1361 ct->setSimpleContentType(typeId);
1364 else if (xParser_->
getName() ==
"extension")
1369 int basetype_id = 0;
1370 for (
int i = 0; i < attcnt; i++)
1377 ct->setSimpleContentType(basetype_id =
1379 if (basetype_id == 0)
1380 error(
"<simpleContent> :" +
1382 ":Unknown base type ",1);
1387 ":Unknown/Unsupported attribute ");
1393 if (xParser_->
getName() ==
"attribute")
1396 Attribute a=parseAttribute(f);
1397 ct->addAttribute(a,f);
1401 else if(xParser_->
getName() ==
"attributeGroup")
1403 parseAttributeGroup(ct);
1407 else if (xParser_->
getName() ==
"anyAttribute")
1408 addAnyAttribute(ct);
1415 (xParser_->
getName() ==
"extension"
1417 error(
"<simpleContent> :Syntax error :extension");
1421 (xParser_->
getName() ==
"simpleContent"
1423 error(
"<simpleContent> :Syntax error ");
1428SchemaParser::parseRedefine()
1431 resolveFwdRefs_=
false;
1432 parseSchema(
"redefine");
1433 resolveFwdRefs_=
true;
1438SchemaParser::parseInclude()
1448 if ( loc.find(
"/",0) != 0 &&
1449 loc.find(
"file:/",0) == std::string::npos &&
1450 loc.find(
"http://") == std::string::npos)
1458 std::string schemaconf= confPath_ +
"schema.conf";
1461 cf.readInto<std::string>(loc,loc);
1476 xsdStream.open(fname_.c_str());
1487 xParser_->
getName() ==
"schema"){
1488 resolveFwdRefs_=
false;
1491 error(
"Error while parsing the included schema " + loc);
1494 resolveFwdRefs_=
true;
1499 xParser_=tmpXparser;
1504 error(
"Error while opening the included schema " + loc);
1509 error(
"schemaLocation is a required attribute for <include>");
1517SchemaParser::parseImport()
1520 std::string xsdFile;
1525 return parseInclude();
1536 if ( !loc.empty() &&
1537 loc.find(
"/",0) != 0 &&
1538 loc.find(
"file:/",0) == std::string::npos &&
1539 loc.find(
"http://") == std::string::npos)
1545 std::string schemaconf= confPath_ +
"schema.conf";
1548 cf.readInto<std::string>(loc,loc);
1564 for (
size_t i = 0; i < importedSchemas_.size(); i++) {
1566 if(importedSchemas_[i].sParser ) {
1567 sp->addImport(importedSchemas_[i].sParser);
1573 if(sp->parseSchemaTag())
1576 error(
"Error while parsing imported namespace "+ns,0);
1581 error(
"could not import namespace from location "+loc);
1590 error(
"Imported namespace "+ns+
" from " + loc,2);
1593 error(
"No location supplied for the import"+ns,2);
1620 if (typens.empty()||
1621 typens == tnsUri_ ||
1624 return typesTable_.
getTypeId(type, create);
1628 if (importedSchemas_.size() == 0 && create) {
1635 for (
size_t i = 0; i < importedSchemas_.size(); i++) {
1639 if(importedSchemas_[i].sParser ) {
1641 typeId = importedSchemas_[i].sParser->getTypeId(type,
false);
1646 (
XSDType *) importedSchemas_[i].sParser->getType(typeId));
1668 if(unresolved > 0) {
1669 for (
int i = 0; i < unresolved; i++){
1676 for (
size_t n = 0; n < importedSchemas_.size(); n++)
1680 if(importedSchemas_[n].sParser){
1681 typeId = importedSchemas_[n].sParser->getTypeId(type);
1683 typesTable_.
addExtType((
XSDType *) importedSchemas_[n].sParser->getType(typeId),
1691 logFile_<<
"Undefined type "<<type<<std::endl;
1698 logFile_<<
"Unresolved types in namespace "<<tnsUri_<<std::endl;
1712SchemaParser::resolveForwardElementRefs()
1715 if (lForwardElemRefs_.empty())
1717 for (list < Qname >::iterator pQnames = lForwardElemRefs_.begin();
1718 pQnames != lForwardElemRefs_.end(); pQnames++) {
1727 error(
"Could not resolve element reference "+pQnames->getLocalName(),1);
1732 error(
"Unresolved element references",1);
1737SchemaParser::resolveForwardAttributeRefs()
1740 if (lForwardAttributeRefs_.empty())
1742 for (list < Qname >::iterator pQnames = lForwardAttributeRefs_.begin();
1743 pQnames != lForwardAttributeRefs_.end(); pQnames++)
1749 error(
"Could not resolve attribute reference {"+pQnames->getNamespace()
1750 +
"}"+pQnames->getLocalName(),1);
1755 error(
"Unresolved attributes references");
1770 for (std::list<Element>::const_iterator eli=lElems_.begin();
1771 eli!= lElems_.end();
1777 else if (checkImports)
1779 for (
size_t i = 0; i < importedSchemas_.size(); i++)
1781 if ( importedSchemas_[i].ns == typens)
1783 if(importedSchemas_[i].sParser )
1785 return importedSchemas_[i].sParser->getElement(element);
1803 for(std::list<Attribute>::iterator ali=lAttributes_.begin();
1804 ali!=lAttributes_.end();
1810 for (
size_t i = 0; i < importedSchemas_.size(); i++)
1812 if ( importedSchemas_[i].ns == typens)
1814 if(importedSchemas_[i].sParser )
1816 return importedSchemas_[i].sParser->getAttribute(attribute);
1835 for (std::list<Group>::iterator gli =lGroups_.begin();
1836 gli!= lGroups_.end();
1844 for (
size_t i = 0; i < importedSchemas_.size(); i++)
1846 if ( importedSchemas_[i].ns == typens)
1848 if(importedSchemas_[i].sParser )
1850 return importedSchemas_[i].sParser->getGroup(name);
1868 for (AttributeGroupList::iterator agli = lAttributeGroups_.begin();
1869 agli!= lAttributeGroups_.end();
1877 for (
size_t i = 0; i < importedSchemas_.size(); i++)
1879 if ( importedSchemas_[i].ns == typens)
1881 if(importedSchemas_[i].sParser )
1883 return importedSchemas_[i].sParser->getAttributeGroup(name);
1915 if (!checkImports) {
1948 for (
size_t i = 0; i < importedSchemas_.size(); i++)
1950 if ( importedSchemas_[i].ns == nameSpace)
1952 return importedSchemas_[i].sParser;
1958list < const XSDType *>*
1961 list < const XSDType *>*pLTypes =
new list < const XSDType * >;
1965 pLTypes->push_back(pType);
1981 return lElems_.size();
1988 return lAttributes_.size();
1995 for (
size_t i=0;i<schemaParsers.size() ;i++){
2013 importedSchemas_[i].sParser=sp;
2021 importedSchemas_.push_back(imp);
2029 for(
size_t i=0;i<importedSchemas_.size();i++) {
2031 if (importedSchemas_[i].sParser)
2032 sp->
addImport(importedSchemas_[i].sParser);
2037SchemaParser::checkImport(std::string nsp)
const
2039 for(
size_t i=0;i<importedSchemas_.size();i++)
2041 if(importedSchemas_[i].ns==nsp)
2049 std::string location)
2052 int i= checkImport(ns);
2057 importedSchemas_.push_back(imp);
2058 i =importedSchemas_.size()-1;
2063 if(location.empty())
2065 std::string xsdFile;
2076 importedSchemas_[i].sParser=sp;
2086void SchemaParser::error(std::string mesg,
int level)
2097 else if (level_ >=1 && level == 1){
2099 logFile_ <<
"Error @" << xParser_->
2100 getLineNumber() <<
":" << xParser_->
2103 else if (level_ >= 2 && level == 2) {
2105 logFile_ <<
"Alert @" << xParser_->
2106 getLineNumber() <<
":" << xParser_->
2139 id = (
static_cast<const SimpleType *
>(pType))->getBaseTypeId();
2163SchemaParser::makeListFromSoapArray (
ComplexType * ct)
2167 if(baseType->
getNamespace()==
"http://schemas.xmlsoap.org/soap/encoding/" &&
2168 baseType->
getName()==
"Array"){
2176 array = q.getLocalName();
2177 while (array[array.length()-1] ==
']' &&
2178 array[array.length()-2] ==
'[')
2179 array = array.substr(0,array.length()-2);
2181 std::string arrayNs = xParser_->
getNamespace(q.getPrefix());
2183 q.setNamespace(arrayNs);
#define FEATURE_PROCESS_NAMESPACES
std::string getLocalName(void) const
void setNamespace(std::string uri)
std::string getPrefix(void) const
std::string getNamespace(void) const
std::string defaultVal() const
ContentModel * getContents() const
void setContents(ContentModel *ct)
const Attribute * getAttribute(const std::string &name) const
int getContentType() const
void addElement(const Element &e)
std::string getNamespace(void) const
Group * getGroup(const Qname &name)
SchemaParser(const std::string &Uri, std::string tns="", std::ostream &log=std::cout, const std::string &confPath="")
int getBasicContentType(int typeId) const
void setUri(const std::string &u)
bool addImports(const std::vector< SchemaParser * > &schemaParsers)
std::string getTypeName(Schema::Type t) const
Attribute * getAttribute(const Qname &attribute)
int getNumElements() const
int getNumAttributes() const
const SchemaParser * getImportedSchema(std::string &nameSpace)
const XSDType * getType(const Qname &type, bool checkImports=true)
const Element * getElement(const Qname &element, bool checkImports=true) const
ConstTypeList * getAllTypes() const
int getTypeId(const Qname &, bool create=false)
bool addImport(std::string ns, std::string location="")
AttributeGroup * getAttributeGroup(const Qname &name)
bool isBasicType(int sType) const
std::string getAtomicTypeName(Schema::Type t) const
bool detectUndefinedTypes(void)
int getNumTypes(void) const
void resolveForwardElementRefs(const std::string &name, Element &e)
void setTargetNamespace(std::string Uri)
int addExtType(XSDType *type, int id)
XSDType * getTypePtr(int id) const
Qname & getExtRefName(int index)
int addExternalTypeId(const Qname &type, const XSDType *pType)
int getExtRefType(int index)
int addType(XSDType *type)
int getTypeId(const Qname &name, bool create=false)
void printUndefinedTypes(std::ostream &out)
void resolveForwardAttributeRefs(const std::string &name, Attribute &a)
std::string getNamespace() const
int getBaseTypeId() const
std::string getName() const
virtual bool isSimple() const =0
Schema::ContentModelType getContentModel() const
void require(int type, std::string ns, std::string name)
std::string getNamespace(std::string prefix)
std::string getAttributeValue(int index)
std::string getNamespaceUri(int pos)
std::string getAttributeNamespace(int index)
int getNamespaceCount(int depth)
std::string getAttributeName(int index)
std::string getNamespacePrefix(int pos)
void setFeature(std::string feature, bool value)
const std::string SchemaUri
int parseInt(std::string s, int radix=10)
bool WSDLPULL_EXPORT fetchUri(std::string uri, std::string &path)
std::ostream & dbsp(std::ostream &str)