You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2002/07/12 17:51:53 UTC
cvs commit: xml-xerces/c/samples/SEnumVal SEnumVal.cpp
knoaman 2002/07/12 08:51:53
Modified: c/samples/SEnumVal SEnumVal.cpp
Log:
Retrieve the root grammar instead of using the validator.
Modify the way we print substitution group info.
Revision Changes Path
1.12 +14 -7 xml-xerces/c/samples/SEnumVal/SEnumVal.cpp
Index: SEnumVal.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/samples/SEnumVal/SEnumVal.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SEnumVal.cpp 25 Jun 2002 15:30:46 -0000 1.11
+++ SEnumVal.cpp 12 Jul 2002 15:51:52 -0000 1.12
@@ -57,6 +57,10 @@
/*
* $Id$
* $Log$
+ * Revision 1.12 2002/07/12 15:51:52 knoaman
+ * Retrieve the root grammar instead of using the validator.
+ * Modify the way we print substitution group info.
+ *
* Revision 1.11 2002/06/25 15:30:46 peiyongz
* Bug#10067: SEnumVal bugs found when porting to Visual Studio .NET
* projects, patch from Robert Buck (rbuck@mathworks.com )
@@ -247,11 +251,12 @@
return;
}
- if ( parser.getValidator().getGrammar()->getGrammarType() != Grammar::SchemaGrammarType)
- {
+ Grammar* rootGrammar = parser.getRootGrammar();
+ if (!rootGrammar || rootGrammar->getGrammarType() != Grammar::SchemaGrammarType)
+ {
cout << "\n Non schema grammar, no output available\n" << endl;
return;
- }
+ }
//
// Now we will get an enumerator for the element pool from the validator
@@ -259,7 +264,7 @@
// we get an enumerator for its attributes and print them also.
//
- SchemaGrammar* grammar = (SchemaGrammar*) parser.getValidator().getGrammar();
+ SchemaGrammar* grammar = (SchemaGrammar*) rootGrammar;
RefHash3KeysIdPoolEnumerator<SchemaElementDecl> elemEnum = grammar->getElemEnumerator();
if (!elemEnum.hasMoreElements())
@@ -332,10 +337,12 @@
}
// Substitution Name
- XMLCh* subsGroup = curElem.getSubstitutionGroupName();
+ SchemaElementDecl* subsGroup = curElem.getSubstitutionGroupElem();
if( subsGroup )
{
- cout << "Substitution Name:\t" << StrX(subsGroup) << "\n";
+ const XMLCh* uriText = parser.getURIText(subsGroup->getURI());
+ cout << "Substitution Name:\t" << StrX(uriText)
+ << "," << StrX(subsGroup->getBaseName()) << "\n";
}
// Content Model
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org