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