fixed more warnings

This commit is contained in:
Jez Higgins 2010-01-10 22:02:43 +00:00
parent 2e82578767
commit 36a305d55b
15 changed files with 69 additions and 68 deletions

View file

@ -23,7 +23,7 @@ public:
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "test", true, 0. 0 }, static const ValueRule rules[] = { { "test", true, 0, 0 },
{ 0, false, 0, 0 } }; { 0, false, 0, 0 } };
std::string test = gatherAttributes(qName, atts, rules)["test"]; std::string test = gatherAttributes(qName, atts, rules)["test"];

View file

@ -20,13 +20,13 @@ public:
} // ForEachHandler } // ForEachHandler
protected: protected:
virtual ForEach* createContainer(const std::string& namespaceURI, virtual ForEach* createContainer(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "select", true, 0 }, static const ValueRule rules[] = { { "select", true, 0, 0 },
{ 0, false, 0} }; { 0, false, 0, 0 } };
std::string select = gatherAttributes(qName, atts, rules)["select"]; std::string select = gatherAttributes(qName, atts, rules)["select"];
return new ForEach(context().xpath_expression(select)); return new ForEach(context().xpath_expression(select));
@ -39,6 +39,7 @@ protected:
{ {
if((namespaceURI == StylesheetConstant::NamespaceURI()) && if((namespaceURI == StylesheetConstant::NamespaceURI()) &&
(localName == "sort")) (localName == "sort"))
{
if(!done_sort_) if(!done_sort_)
{ {
context().push(0, context().push(0,
@ -51,6 +52,7 @@ protected:
} }
else else
throw SAX::SAXException("xsl:sort must immediately follow xsl:for-each"); throw SAX::SAXException("xsl:sort must immediately follow xsl:for-each");
} // if ...
done_sort_ = true; done_sort_ = true;
return ItemContainerHandler<ForEach>::createChild(namespaceURI, localName, qName, atts); return ItemContainerHandler<ForEach>::createChild(namespaceURI, localName, qName, atts);
} // createChild } // createChild

View file

@ -15,17 +15,17 @@ public:
{ {
} // ForeignElementHandler } // ForeignElementHandler
virtual void startElement(const std::string& namespaceURI, virtual void startElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& /* qName */,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& /* atts */)
{ {
++depth_; ++depth_;
} // startElement } // startElement
virtual void endElement(const std::string& namespaceURI, virtual void endElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName) const std::string& /* qName */)
{ {
if(--depth_ == 0) if(--depth_ == 0)
context_.pop(); context_.pop();

View file

@ -17,13 +17,13 @@ public:
{ {
} // IfHandler } // IfHandler
virtual If* createContainer(const std::string& namespaceURI, virtual If* createContainer(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "test", true, 0 }, static const ValueRule rules[] = { { "test", true, 0, 0 },
{ 0, false, 0} }; { 0, false, 0, 0 } };
std::string test = gatherAttributes(qName, atts, rules)["test"]; std::string test = gatherAttributes(qName, atts, rules)["test"];
return new If(ItemContainerHandler<If>::context().xpath_expression(test)); return new If(ItemContainerHandler<If>::context().xpath_expression(test));

View file

@ -51,7 +51,6 @@ public:
if(no_content_) if(no_content_)
throw SAX::SAXException("xsl:include must be empty"); throw SAX::SAXException("xsl:include must be empty");
bool start_pass_through = false;
if(namespaceURI == StylesheetConstant::NamespaceURI()) if(namespaceURI == StylesheetConstant::NamespaceURI())
{ {
if(localName == "import") if(localName == "import")
@ -121,8 +120,8 @@ public:
private: private:
std::string validate_href(const std::string& qName, const SAX::Attributes<std::string>& atts) std::string validate_href(const std::string& qName, const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "href", true, 0 }, static const ValueRule rules[] = { { "href", true, 0, 0 },
{ 0, false, 0 } }; { 0, false, 0, 0 } };
std::string href = gatherAttributes(qName, atts, rules)["href"]; std::string href = gatherAttributes(qName, atts, rules)["href"];
no_content_ = true; no_content_ = true;
// std::cout << "Base : " << context_->currentBase() << ", href : " << href << "\n"; // std::cout << "Base : " << context_->currentBase() << ", href : " << href << "\n";
@ -171,8 +170,8 @@ private:
current_includes_.pop_back(); current_includes_.pop_back();
} // include_stylesheet } // include_stylesheet
SAX::DefaultHandler<std::string>* compiler_;
CompilationContext* context_; CompilationContext* context_;
SAX::DefaultHandler<std::string>* compiler_;
bool no_content_; bool no_content_;
typedef std::vector<std::string> HrefStack; typedef std::vector<std::string> HrefStack;

View file

@ -25,7 +25,7 @@ protected:
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
std::vector<InlineAttribute> inlineAtts; std::vector<InlineAttribute> inlineAtts;
for(unsigned int i = 0; i != atts.getLength(); ++i) for(int i = 0; i != atts.getLength(); ++i)
{ {
if(atts.getQName(i).find("xmlns:") == 0) if(atts.getQName(i).find("xmlns:") == 0)
continue; continue;

View file

@ -55,9 +55,9 @@ public:
throw SAX::SAXException(qName + " <- Sorry, don't know about that yet :)"); throw SAX::SAXException(qName + " <- Sorry, don't know about that yet :)");
} // startElement } // startElement
virtual void endElement(const std::string& namespaceURI, virtual void endElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName) const std::string& /* qName */)
{ {
context_.parentContainer().add_item(container_); context_.parentContainer().add_item(container_);
context_.pop(); context_.pop();

View file

@ -18,18 +18,18 @@ public:
{ {
} // KeyHandler } // KeyHandler
virtual void startElement(const std::string& namespaceURI, virtual void startElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
if(key_ != 0) if(key_ != 0)
throw SAX::SAXException(qName + " can not contain elements"); throw SAX::SAXException(qName + " can not contain elements");
static const ValueRule rules[] = { { "name", true, 0 }, static const ValueRule rules[] = { { "name", true, 0, 0 },
{ "match", true, 0 }, { "match", true, 0, 0 },
{ "use", true, 0 }, { "use", true, 0, 0 },
{ 0, false, 0 } }; { 0, false, 0, 0 } };
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules); std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
name_ = context_.processInternalQName(attrs["name"]).clarkName(); name_ = context_.processInternalQName(attrs["name"]).clarkName();
@ -39,9 +39,9 @@ public:
key_ = new Key(matches, use); key_ = new Key(matches, use);
} // startElement } // startElement
virtual void endElement(const std::string& namespaceURI, virtual void endElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName) const std::string& /* qName */)
{ {
context_.stylesheet().add_key(name_, key_); context_.stylesheet().add_key(name_, key_);
context_.pop(); context_.pop();

View file

@ -18,13 +18,13 @@ public:
} // MessageHandler } // MessageHandler
protected: protected:
virtual Message* createContainer(const std::string& namespaceURI, virtual Message* createContainer(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "terminate", false, No, AllowedYesNo }, static const ValueRule rules[] = { { "terminate", false, No, AllowedYesNo },
{ 0, false, 0} }; { 0, false, 0, 0 } };
return new Message(gatherAttributes(qName, atts, rules)["terminate"] == Yes); return new Message(gatherAttributes(qName, atts, rules)["terminate"] == Yes);
} // createContainer } // createContainer
}; // class MessageHandler }; // class MessageHandler

View file

@ -17,16 +17,16 @@ public:
{ {
} // NamespaceAliasHandler } // NamespaceAliasHandler
virtual void startElement(const std::string& namespaceURI, virtual void startElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
if(!done_) if(!done_)
{ {
static const ValueRule rules[] = { { "stylesheet-prefix", true, 0 }, static const ValueRule rules[] = { { "stylesheet-prefix", true, 0, 0 },
{ "result-prefix", true, 0 }, { "result-prefix", true, 0, 0 },
{ 0, false, 0} }; { 0, false, 0, 0 } };
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules); std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
std::string stylesheet_prefix = attrs["stylesheet-prefix"]; std::string stylesheet_prefix = attrs["stylesheet-prefix"];
@ -52,9 +52,9 @@ public:
throw SAX::SAXException(qName + " can not contain elements"); throw SAX::SAXException(qName + " can not contain elements");
} // startElement } // startElement
virtual void endElement(const std::string& namespaceURI, virtual void endElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName) const std::string& /* qName */)
{ {
context_.pop(); context_.pop();
} // endElement } // endElement

View file

@ -16,8 +16,8 @@ public:
{ {
} // OutputHandler } // OutputHandler
virtual void startElement(const std::string& namespaceURI, virtual void startElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
@ -25,16 +25,16 @@ public:
{ {
static const char* AllowedMethods[] = { "xml", "html", "text", 0 }; static const char* AllowedMethods[] = { "xml", "html", "text", 0 };
static const ValueRule rules[] = { { "method", false, "xml", AllowedMethods }, static const ValueRule rules[] = { { "method", false, "xml", AllowedMethods },
{ "version", false, "1.0" }, { "version", false, "1.0", 0 },
{ "encoding", false, "UTF-8" }, { "encoding", false, "UTF-8", 0 },
{ "omit-xml-declaration", false, No, AllowedYesNo }, { "omit-xml-declaration", false, No, AllowedYesNo },
{ "standalone", false, "", AllowedYesNo }, { "standalone", false, "", AllowedYesNo },
{ "doctype-public", false, ""}, { "doctype-public", false, "", 0},
{ "doctype-system", false, ""}, { "doctype-system", false, "", 0},
{ "cdata-section-elements", false, ""}, { "cdata-section-elements", false, "", 0},
{ "indent", false, No, AllowedYesNo }, { "indent", false, No, AllowedYesNo },
{ "media-type", false, "" }, { "media-type", false, "", 0 },
{ 0, false, 0 } }; { 0, false, 0, 0 } };
settings_ = gatherAttributes(qName, atts, rules); settings_ = gatherAttributes(qName, atts, rules);
cdataElements_ = extractCDATAElements(settings_["cdata-section-elements"]); cdataElements_ = extractCDATAElements(settings_["cdata-section-elements"]);
@ -44,9 +44,9 @@ public:
throw SAX::SAXException(qName + " can not contain elements"); throw SAX::SAXException(qName + " can not contain elements");
} // startElement } // startElement
virtual void endElement(const std::string& namespaceURI, virtual void endElement(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName) const std::string& /* qName */)
{ {
context_.stylesheet().output_settings(settings_, cdataElements_); context_.stylesheet().output_settings(settings_, cdataElements_);
context_.pop(); context_.pop();

View file

@ -17,13 +17,13 @@ public:
{ {
} // ProcessingInstructionHandler } // ProcessingInstructionHandler
virtual ProcessingInstruction* createContainer(const std::string& namespaceURI, virtual ProcessingInstruction* createContainer(const std::string& /* namespaceURI */,
const std::string& localName, const std::string& /* localName */,
const std::string& qName, const std::string& qName,
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "name", true, 0 }, static const ValueRule rules[] = { { "name", true, 0, 0 },
{ 0, false, 0} }; { 0, false, 0, 0} };
std::string name = gatherAttributes(qName, atts, rules)["name"]; std::string name = gatherAttributes(qName, atts, rules)["name"];
return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath_attribute_value_template(name)); return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath_attribute_value_template(name));

View file

@ -139,7 +139,7 @@ public:
Arabica::XPath::NodeSetXPathFunction<std::string>(0, 0, args) { } Arabica::XPath::NodeSetXPathFunction<std::string>(0, 0, args) { }
protected: protected:
virtual Arabica::XPath::NodeSet<std::string> doEvaluate(const DOM::Node<std::string>& context, virtual Arabica::XPath::NodeSet<std::string> doEvaluate(const DOM::Node<std::string>& /* context */,
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const const Arabica::XPath::ExecutionContext<std::string>& executionContext) const
{ {
Arabica::XPath::NodeSet<std::string> set; Arabica::XPath::NodeSet<std::string> set;
@ -156,8 +156,8 @@ public:
Arabica::XPath::StringXPathFunction<std::string>(1, 1, args) { } Arabica::XPath::StringXPathFunction<std::string>(1, 1, args) { }
protected: protected:
virtual std::string doEvaluate(const DOM::Node<std::string>& context, virtual std::string doEvaluate(const DOM::Node<std::string>& /* context */,
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const const Arabica::XPath::ExecutionContext<std::string>& /* executionContext */) const
{ {
// This is a minimal, but I think conformant, implementation // This is a minimal, but I think conformant, implementation
return ""; return "";

View file

@ -364,16 +364,16 @@ private:
int buffering_; int buffering_;
bool pending_element_; bool pending_element_;
int pending_attribute_;
bool pending_text_; bool pending_text_;
int pending_attribute_;
bool text_mode_;
Output* warning_sink_;
CDATAElements cdataElements_; CDATAElements cdataElements_;
std::stack<QName> element_stack_; std::stack<QName> element_stack_;
std::string target_; std::string target_;
SAX::AttributesImpl<std::string, Arabica::default_string_adaptor<std::string> > atts_; SAX::AttributesImpl<std::string, Arabica::default_string_adaptor<std::string> > atts_;
std::stringstream buffer_; std::stringstream buffer_;
bool text_mode_;
NamespaceStack namespaceStack_; NamespaceStack namespaceStack_;
Output* warning_sink_;
}; // class Output }; // class Output
} // namespace XSLT } // namespace XSLT

View file

@ -116,7 +116,7 @@ bool operator>(const Precedence& lhs, const Precedence& rhs)
std::ostream& operator<<(std::ostream& os, const Precedence& prec) std::ostream& operator<<(std::ostream& os, const Precedence& prec)
{ {
os << '(' << prec.precedence_[0]; os << '(' << prec.precedence_[0];
for(int i = 1; i != prec.precedence_.size(); ++i) for(size_t i = 1; i != prec.precedence_.size(); ++i)
os << ',' << prec.precedence_[i]; os << ',' << prec.precedence_[i];
os << ')'; os << ')';
return os; return os;