true if the stylesheet is parsed successfully, false otherwise.
Remarks
This operation is used to parse a stylesheet. After parsing, the called stylesheet object will contain the rules, comments, and import rules which
were contained in the parsed stylesheet file or stream.
Complexity
Linear
Example
1st Variety
#include "xhtml_doc.h"
#include "xport_brochure.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
document doc(root_doc);
stylesheet ss;
// populate stylesheet
std::cout << "Populating and saving xport brochure stylesheet.\n\n";
xport_brochure broch;
broch.create(doc, ss);
ss.write("C:/xport_brochure.css");
std::cout << "Create a new stylesheet and parse the saved stylesheet.\n\n";
stylesheet parsed;
parsed.parse("C:/xport_stylesheet.css");
// compare the stylesheets
std::cout << "The two stylesheets " << (parsed == ss ? "are" : "are not") << " equal!.\n\n";
}
2nd Variety
#include "xhtml_doc.h"
#include "xport_brochure.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
document doc(root_doc);
stylesheet ss;
// populate stylesheet
std::cout << "Populating and saving xport brochure stylesheet.\n\n";
xport_brochure broch;
broch.create(doc, ss);
ss.write("C:/xport_brochure.css");
std::cout << "Create a new stylesheet and parse the saved stylesheet.\n\n";
std::ifstream file("C:/xport_brochure.css");
if (file) {
stylesheet parsed;
parsed.parse(file);
// compare the stylesheets
std::cout << "The two stylesheets " << (parsed == ss ? "are" : "are not") << " equal!.\n\n";
}
}
Datasoft Solutions is proud to present their landmark product, Work Time Studio. Utilizing the tree container library, Work Time Studio provides
unparalleled features in personal time, project and task management
software. If you're looking for a way to increase your productivity,
visit Work Time Studio's product website, and start being more productive
today.