1 | /*
|
---|
2 | * Copyright 2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: XSAXMLScanner.hpp,v $
|
---|
19 | * Revision 1.1 2004/09/27 20:58:14 knoaman
|
---|
20 | * A new scanner used by TraverseSchema to validate annotations contents
|
---|
21 | *
|
---|
22 | */
|
---|
23 |
|
---|
24 |
|
---|
25 | #if !defined(XSAXMLSCANNER_HPP)
|
---|
26 | #define XSAXMLSCANNER_HPP
|
---|
27 |
|
---|
28 | #include <xercesc/internal/SGXMLScanner.hpp>
|
---|
29 |
|
---|
30 |
|
---|
31 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
32 |
|
---|
33 | //
|
---|
34 | // This is a scanner class, which processes/validates contents of XML Schema
|
---|
35 | // Annotations. It's intended for internal use only.
|
---|
36 | //
|
---|
37 | class XMLPARSER_EXPORT XSAXMLScanner : public SGXMLScanner
|
---|
38 | {
|
---|
39 | public :
|
---|
40 | // -----------------------------------------------------------------------
|
---|
41 | // Destructor
|
---|
42 | // -----------------------------------------------------------------------
|
---|
43 | virtual ~XSAXMLScanner();
|
---|
44 |
|
---|
45 | // -----------------------------------------------------------------------
|
---|
46 | // XMLScanner public virtual methods
|
---|
47 | // -----------------------------------------------------------------------
|
---|
48 | virtual const XMLCh* getName() const;
|
---|
49 |
|
---|
50 | protected:
|
---|
51 | // -----------------------------------------------------------------------
|
---|
52 | // Constructors
|
---|
53 | // -----------------------------------------------------------------------
|
---|
54 | /**
|
---|
55 | * The grammar representing the XML Schema annotation (xsaGrammar) is
|
---|
56 | * passed in by the caller. The scanner will own it and is responsible
|
---|
57 | * for deleting it.
|
---|
58 | */
|
---|
59 | XSAXMLScanner
|
---|
60 | (
|
---|
61 | GrammarResolver* const grammarResolver
|
---|
62 | , XMLStringPool* const uriStringPool
|
---|
63 | , SchemaGrammar* const xsaGrammar
|
---|
64 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
65 | );
|
---|
66 | friend class TraverseSchema;
|
---|
67 |
|
---|
68 | // -----------------------------------------------------------------------
|
---|
69 | // XMLScanner virtual methods
|
---|
70 | // -----------------------------------------------------------------------
|
---|
71 | virtual void scanReset(const InputSource& src);
|
---|
72 |
|
---|
73 | // -----------------------------------------------------------------------
|
---|
74 | // SGXMLScanner virtual methods
|
---|
75 | // -----------------------------------------------------------------------
|
---|
76 | virtual bool scanStartTag(bool& gotData);
|
---|
77 | virtual void scanEndTag(bool& gotData);
|
---|
78 |
|
---|
79 | private :
|
---|
80 | // -----------------------------------------------------------------------
|
---|
81 | // Unimplemented constructors and operators
|
---|
82 | // -----------------------------------------------------------------------
|
---|
83 | XSAXMLScanner();
|
---|
84 | XSAXMLScanner(const XSAXMLScanner&);
|
---|
85 | XSAXMLScanner& operator=(const XSAXMLScanner&);
|
---|
86 |
|
---|
87 | // -----------------------------------------------------------------------
|
---|
88 | // Private helper methods
|
---|
89 | // -----------------------------------------------------------------------
|
---|
90 | void scanRawAttrListforNameSpaces(int attCount);
|
---|
91 | void switchGrammar(const XMLCh* const newGrammarNameSpace, bool laxValidate);
|
---|
92 | };
|
---|
93 |
|
---|
94 | inline const XMLCh* XSAXMLScanner::getName() const
|
---|
95 | {
|
---|
96 | return XMLUni::fgXSAXMLScanner;
|
---|
97 | }
|
---|
98 |
|
---|
99 | XERCES_CPP_NAMESPACE_END
|
---|
100 |
|
---|
101 | #endif
|
---|