ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapper/SiteMapper.cpp
(Generate patch)

Comparing SiteMapper/SiteMapper.cpp (file contents):
Revision 132 by Douglas Thrift, 2004-03-24T15:58:55-08:00 vs.
Revision 134 by Douglas Thrift, 2004-03-24T22:23:19-08:00

# Line 10 | Line 10
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;
# Line 37 | Line 52 | int main(int argc, char* argv[])
52                  {
53                          siteMap = matcher[1];
54                  }
55 +                else if (arg == "-D")
56 +                {
57 +                        if (!debug) debug = true;
58 +                }
59          }
60  
61          if (siteIndex != "" && siteMap != "")
# Line 51 | Line 70 | int main(int argc, char* argv[])
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;
# Line 59 | Line 78 | int main(int argc, char* argv[])
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines