xmlParserOption getParserOptions(v8::Local<v8::Object> props) {
    int ret = 0;

    // http://xmlsoft.org/html/libxml-parser.html#xmlParserOption
    // http://www.xmlsoft.org/html/libxml-HTMLparser.html#htmlParserOption

    ret |= getParserOption(props, "recover", XML_PARSE_RECOVER);            // 1: recover on errors
    /*ret |= getParserOption(props, "recover", HTML_PARSE_RECOVER);           // 1: Relaxed parsing*/

    ret |= getParserOption(props, "noent", XML_PARSE_NOENT);                // 2: substitute entities

    ret |= getParserOption(props, "dtdload", XML_PARSE_DTDLOAD);            // 4: load the external subset
    ret |= getParserOption(props, "doctype", HTML_PARSE_NODEFDTD, false);   // 4: do not default a doctype if not found

    ret |= getParserOption(props, "dtdattr", XML_PARSE_DTDATTR);            // 8: default DTD attributes
    ret |= getParserOption(props, "dtdvalid", XML_PARSE_DTDVALID);          // 16: validate with the DTD

    ret |= getParserOption(props, "noerror", XML_PARSE_NOERROR);            // 32: suppress error reports
    ret |= getParserOption(props, "errors",  HTML_PARSE_NOERROR, false);    // 32: suppress error reports

    ret |= getParserOption(props, "nowarning", XML_PARSE_NOWARNING);        // 64: suppress warning reports
    ret |= getParserOption(props, "warnings", HTML_PARSE_NOWARNING, false); // 64: suppress warning reports

    ret |= getParserOption(props, "pedantic", XML_PARSE_PEDANTIC);          // 128: pedantic error reporting
    /*ret |= getParserOption(props, "pedantic", HTML_PARSE_PEDANTIC);         // 128: pedantic error reporting*/

    ret |= getParserOption(props, "noblanks", XML_PARSE_NOBLANKS);          // 256: remove blank nodes
    ret |= getParserOption(props, "blanks", HTML_PARSE_NOBLANKS, false);    // 256: remove blank nodes

    ret |= getParserOption(props, "sax1", XML_PARSE_SAX1);                  // 512: use the SAX1 interface internally
    ret |= getParserOption(props, "xinclude", XML_PARSE_XINCLUDE);          // 1024: Implement XInclude substitition

    ret |= getParserOption(props, "nonet", XML_PARSE_NONET);                // 2048: Forbid network access
    ret |= getParserOption(props, "net", HTML_PARSE_NONET, false);          // 2048: Forbid network access

    ret |= getParserOption(props, "nodict", XML_PARSE_NODICT);              // 4096: Do not reuse the context dictionnary
    ret |= getParserOption(props, "dict", XML_PARSE_NODICT, false);         // 4096: Do not reuse the context dictionnary

    ret |= getParserOption(props, "nsclean", XML_PARSE_NSCLEAN);            // 8192: remove redundant namespaces declarations
    ret |= getParserOption(props, "implied", HTML_PARSE_NOIMPLIED, false);  // 8192: Do not add implied html/body elements

    ret |= getParserOption(props, "nocdata", XML_PARSE_NOCDATA);            // 16384: merge CDATA as text nodes
    ret |= getParserOption(props, "cdata", XML_PARSE_NOCDATA, false);       // 16384: merge CDATA as text nodes

    ret |= getParserOption(props, "noxincnode", XML_PARSE_NOXINCNODE);      // 32768: do not generate XINCLUDE START/END nodes
    ret |= getParserOption(props, "xincnode", XML_PARSE_NOXINCNODE, false); // 32768: do not generate XINCLUDE START/END nodes

    ret |= getParserOption(props, "compact", XML_PARSE_COMPACT);            // 65536: compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree)
    /*ret |= getParserOption(props, "compact", HTML_PARSE_COMPACT , false);   // 65536: compact small text nodes*/

    ret |= getParserOption(props, "old10", XML_PARSE_OLD10);                // 131072: parse using XML-1.0 before update 5

    ret |= getParserOption(props, "nobasefix", XML_PARSE_NOBASEFIX);        // 262144: do not fixup XINCLUDE xml:base uris
    ret |= getParserOption(props, "basefix", XML_PARSE_NOBASEFIX, false);   // 262144: do not fixup XINCLUDE xml:base uris

    ret |= getParserOption(props, "huge", XML_PARSE_HUGE);                  // 524288: relax any hardcoded limit from the parser
    ret |= getParserOption(props, "oldsax", XML_PARSE_OLDSAX);              // 1048576: parse using SAX2 interface before 2.7.0

    ret |= getParserOption(props, "ignore_enc", XML_PARSE_IGNORE_ENC);      // 2097152: ignore internal document encoding hint
    /*ret |= getParserOption(props, "ignore_enc", HTML_PARSE_IGNORE_ENC);      // 2097152: ignore internal document encoding hint*/

    ret |= getParserOption(props, "big_lines", XML_PARSE_BIG_LINES);        // 4194304: Store big lines numbers in text PSVI field

    return (xmlParserOption)ret;
}