mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-26 21:58:39 +01:00
Validate xsl:stylesheet attributes properly
This commit is contained in:
parent
f14cb010a3
commit
3a3f5d4b32
1 changed files with 4 additions and 2 deletions
|
@ -52,8 +52,10 @@ public:
|
|||
throw SAX::SAXException("The source file does not look like a stylesheet.");
|
||||
if(localName != "stylesheet" && localName != "transform")
|
||||
throw SAX::SAXException("Top-level element must be 'stylesheet' or 'transform'.");
|
||||
if(atts.getValue("version") == "")
|
||||
throw SAX::SAXException("stylesheet element must have a version attribute.");
|
||||
|
||||
static const ValueRule rules[] = { { "version", true, 0 },
|
||||
{ 0, false, 0 } };
|
||||
std::string version = gatherAttributes(qName, atts, rules)["version"];
|
||||
if(atts.getValue("version") != StylesheetConstant::Version())
|
||||
throw SAX::SAXException("I'm only a poor version 1.0 XSLT Transformer.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue