138 // class TMLAttributesParse |
138 // class TMLAttributesParse |
139 // |
139 // |
140 auto_ptr<TMLAttributesParse> TMLAttributesParse::Parse(const string& aLayName) |
140 auto_ptr<TMLAttributesParse> TMLAttributesParse::Parse(const string& aLayName) |
141 { |
141 { |
142 auto_ptr<TMLAttributesParse> layout(new TMLAttributesParse); |
142 auto_ptr<TMLAttributesParse> layout(new TMLAttributesParse); |
143 int pos=0; |
143 |
144 string layName = aLayName; |
144 string layName = aLayName; |
145 |
145 |
146 if (layName.size() >= 2 && layName.substr(0,2) == "-m") |
146 if (layName.size() >= 2 && layName.substr(0,2) == "-m") |
147 { |
147 { |
148 layName = layName.substr(2); |
148 layName = layName.substr(2); |
208 iStack.push(aHandler); |
208 iStack.push(aHandler); |
209 } |
209 } |
210 |
210 |
211 void TLayoutAttributesSaxParser::Parse(const std::string& aFileName) |
211 void TLayoutAttributesSaxParser::Parse(const std::string& aFileName) |
212 { |
212 { |
213 SAX::basic_InputSource<std::string> is(aFileName); |
213 Arabica::SAX::InputSource<std::string> is(aFileName); |
214 SAX::XMLReader<std::string> parser; |
214 Arabica::SAX::XMLReader<std::string> parser; |
215 parser.setContentHandler(*this); |
215 parser.setContentHandler(*this); |
216 parser.setErrorHandler(*this); |
216 parser.setErrorHandler(*this); |
217 parser.parse(is); |
217 parser.parse(is); |
218 } |
218 } |
219 |
219 |
220 void TLayoutAttributesSaxParser::startElement(const std::string& /*namespaceURI*/, const std::string& localName, |
220 void TLayoutAttributesSaxParser::startElement(const std::string& /*namespaceURI*/, const std::string& localName, |
221 const std::string& /*qName*/, const SAX::basic_Attributes<std::string>& atts) |
221 const std::string& /*qName*/, const Arabica::SAX::Attributes<std::string>& atts) |
222 { |
222 { |
223 MSaxLayoutAttributesHandler* handler = iStack.top(); |
223 MSaxLayoutAttributesHandler* handler = iStack.top(); |
224 if (!handler) |
224 if (!handler) |
225 throw GeneralErr("SAX: No element handler"); |
225 throw GeneralErr("SAX: No element handler"); |
226 MSaxLayoutAttributesHandler* next = handler->HandleSax(localName, atts); |
226 MSaxLayoutAttributesHandler* next = handler->HandleSax(localName, atts); |