83 |
|
this->list = evaluator.createXPath(XalanDOMString("list").c_str()); |
84 |
|
|
85 |
|
oldMap(pages, list); |
86 |
+ |
|
87 |
+ |
evaluator.destroyXPath(item); |
88 |
+ |
evaluator.destroyXPath(address); |
89 |
+ |
evaluator.destroyXPath(link); |
90 |
+ |
evaluator.destroyXPath(this->list); |
91 |
|
} |
92 |
|
|
93 |
|
void SiteMapper::oldMap(vector<Page>& pages, XalanNode* list) |
97 |
|
for (int index = 0; index < nodes.getLength(); index++) |
98 |
|
{ |
99 |
|
XalanNode* node = nodes.item(index); |
100 |
< |
XObjectPtr address = evaluator.evaluate(support, node, |
101 |
< |
*(this->address)); |
102 |
< |
ostringstream url; |
103 |
< |
|
99 |
< |
if (!address.null()) |
100 |
< |
{ |
101 |
< |
url << address->str(); |
102 |
< |
} |
103 |
< |
|
104 |
< |
XObjectPtr link = evaluator.evaluate(support, node, *(this->link)); |
105 |
< |
ostringstream title; |
106 |
< |
|
107 |
< |
if (!link.null()) |
108 |
< |
{ |
109 |
< |
title << link->str(); |
110 |
< |
} |
100 |
> |
ostringstream url, title; |
101 |
> |
|
102 |
> |
url << evaluator.evaluate(support, node, *address)->str(); |
103 |
> |
title << evaluator.evaluate(support, node, *link)->str(); |
104 |
|
|
105 |
|
Page page(url.str(), title.str()); |
106 |
|
XalanNode* list = evaluator.selectSingleNode(support, node, |
114 |
|
|
115 |
|
void SiteMapper::index(const string& siteIndex) |
116 |
|
{ |
117 |
< |
// |
117 |
> |
XalanDOMString file(siteIndex.c_str()); |
118 |
> |
LocalFileInputSource source(file.c_str()); |
119 |
> |
|
120 |
> |
XalanDocument* document = liaison.parseXMLStream(source); |
121 |
> |
|
122 |
> |
if (document == 0) return; |
123 |
> |
|
124 |
> |
address = evaluator.createXPath(XalanDOMString("address").c_str()); |
125 |
> |
path = evaluator.createXPath(XalanDOMString("path").c_str()); |
126 |
> |
port = evaluator.createXPath(XalanDOMString("port").c_str()); |
127 |
> |
title = evaluator.createXPath(XalanDOMString("title").c_str()); |
128 |
> |
|
129 |
> |
NodeRefList nodes = evaluator.selectNodeList(support, document, |
130 |
> |
XalanDOMString("/index/page").c_str()); |
131 |
> |
|
132 |
> |
for (int index = 0; index < nodes.getLength(); index++) |
133 |
> |
{ |
134 |
> |
XalanNode* node = nodes.item(index); |
135 |
> |
} |
136 |
> |
|
137 |
> |
evaluator.destroyXPath(address); |
138 |
> |
evaluator.destroyXPath(path); |
139 |
> |
evaluator.destroyXPath(port); |
140 |
> |
evaluator.destroyXPath(title); |
141 |
|
} |
142 |
|
|
143 |
|
void SiteMapper::newMap(const string& siteMap) |