Skip to content

Commit

Permalink
parsing stylesheet includes added
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.opensource.yandex.net/xscript/trunk@713 b01ef89b-65f2-463d-9415-e8412542ae63
  • Loading branch information
golubtsov committed Jan 22, 2009
1 parent 926c465 commit 6a1c51e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/xscript/stylesheet.h
Expand Up @@ -59,7 +59,7 @@ class Stylesheet : public Xml {
Stylesheet(const std::string &name);

virtual void parse();
void parseImport(xsltStylesheetPtr imp);
void parseStylesheet(xsltStylesheetPtr style);
void parseNode(xmlNodePtr node);

void detectOutputMethod(const XsltStylesheetHelper &sh);
Expand Down
21 changes: 12 additions & 9 deletions library/stylesheet.cpp
Expand Up @@ -196,8 +196,7 @@ Stylesheet::parse() {

stylesheet_ = XsltStylesheetHelper(xsltParseStylesheetDoc(doc.get()));
XmlUtils::throwUnless(NULL != stylesheet_.get());

doc_root = xmlDocGetRootElement(doc.release());
doc.release();

TimeMapType* modified_info = XmlInfoCollector::getModifiedInfo();
TimeMapType fake;
Expand All @@ -209,8 +208,7 @@ Stylesheet::parse() {
}
}

parseNode(doc_root);
parseImport(stylesheet_->imports);
parseStylesheet(stylesheet_.get());

detectOutputMethod(stylesheet_);
detectOutputEncoding(stylesheet_);
Expand All @@ -221,12 +219,17 @@ Stylesheet::parse() {
}

void
Stylesheet::parseImport(xsltStylesheetPtr imp) {
for ( ; imp ; imp = imp->next) {
if (imp->doc) {
parseNode(xmlDocGetRootElement(imp->doc));
Stylesheet::parseStylesheet(xsltStylesheetPtr style) {
for ( ; style; style = style->next) {
if (style->doc) {
parseNode(xmlDocGetRootElement(style->doc));
}
for (xsltDocumentPtr include = style->docList; include; include = include->next) {
if (include->doc) {
parseNode(xmlDocGetRootElement(include->doc));
}
}
parseImport(imp->imports);
parseStylesheet(style->imports);
}
}

Expand Down

0 comments on commit 6a1c51e

Please sign in to comment.