10 |
|
|
11 |
|
#include <xalanc/Include/PlatformDefinitions.hpp> |
12 |
|
#include <xercesc/util/PlatformUtils.hpp> |
13 |
+ |
#include <xercesc/framework/LocalFileInputSource.hpp> |
14 |
+ |
#include <xalanc/XPath/XObject.hpp> |
15 |
|
#include <xalanc/XPath/XPathEvaluator.hpp> |
16 |
+ |
#include <xalanc/DOMSupport/XalanDocumentPrefixResolver.hpp> |
17 |
+ |
#include <xalanc/XalanSourceTree/XalanSourceTreeDOMSupport.hpp> |
18 |
+ |
#include <xalanc/XalanSourceTree/XalanSourceTreeInit.hpp> |
19 |
+ |
#include <xalanc/XalanSourceTree/XalanSourceTreeParserLiaison.hpp> |
20 |
|
|
21 |
|
XALAN_USING_XERCES(XMLPlatformUtils) |
22 |
+ |
XALAN_USING_XERCES(LocalFileInputSource) |
23 |
+ |
XALAN_USING_XALAN(XObjectPtr) |
24 |
|
XALAN_USING_XALAN(XPathEvaluator) |
25 |
+ |
XALAN_USING_XALAN(XalanDocument) |
26 |
+ |
XALAN_USING_XALAN(XalanDocumentPrefixResolver) |
27 |
+ |
XALAN_USING_XALAN(XalanDOMString) |
28 |
+ |
XALAN_USING_XALAN(XalanNode) |
29 |
+ |
XALAN_USING_XALAN(XalanSourceTreeInit) |
30 |
+ |
XALAN_USING_XALAN(XalanSourceTreeDOMSupport) |
31 |
+ |
XALAN_USING_XALAN(XalanSourceTreeParserLiaison) |
32 |
|
|
33 |
|
string program; |
34 |
|
bool debug = false; |
52 |
|
{ |
53 |
|
siteMap = matcher[1]; |
54 |
|
} |
55 |
+ |
else if (arg == "-D") |
56 |
+ |
{ |
57 |
+ |
if (!debug) debug = true; |
58 |
+ |
} |
59 |
|
} |
60 |
|
|
61 |
|
if (siteIndex != "" && siteMap != "") |
70 |
|
} |
71 |
|
else |
72 |
|
{ |
73 |
< |
cout << "Usage: " << program << " -index=index -map=map\n"; |
73 |
> |
cout << "Usage: " << program << " -index=index -map=map [-D]\n"; |
74 |
|
} |
75 |
|
|
76 |
|
return 0; |
78 |
|
|
79 |
|
SiteMapper::SiteMapper(const string& siteIndex, const string& siteMap) |
80 |
|
{ |
81 |
+ |
XalanSourceTreeInit init; |
82 |
+ |
|
83 |
+ |
oldMap(siteMap); |
84 |
+ |
index(siteIndex); |
85 |
+ |
newMap(siteMap); |
86 |
+ |
} |
87 |
+ |
|
88 |
+ |
void SiteMapper::oldMap(const string& siteMap) |
89 |
+ |
{ |
90 |
+ |
XalanSourceTreeDOMSupport support; |
91 |
+ |
XalanSourceTreeParserLiaison liaison(support); |
92 |
+ |
|
93 |
+ |
support.setParserLiaison(&liaison); |
94 |
+ |
|
95 |
+ |
XalanDOMString file(siteMap.c_str()); |
96 |
+ |
LocalFileInputSource source(file.c_str()); |
97 |
+ |
|
98 |
+ |
XalanDocument* document = liaison.parseXMLStream(source); |
99 |
+ |
|
100 |
+ |
if (document == 0) return; |
101 |
+ |
|
102 |
+ |
XPathEvaluator evaluator; |
103 |
+ |
XalanNode* list = evaluator.selectSingleNode(support, document, |
104 |
+ |
XalanDOMString("/page/section/list").c_str()); |
105 |
+ |
|
106 |
+ |
if (list == 0) return; |
107 |
+ |
} |
108 |
+ |
|
109 |
+ |
void SiteMapper::index(const string& siteIndex) |
110 |
+ |
{ |
111 |
+ |
// |
112 |
+ |
} |
113 |
+ |
|
114 |
+ |
void SiteMapper::newMap(const string& siteMap) |
115 |
+ |
{ |
116 |
|
// |
117 |
|
} |