basic binding to get xml doctype

Hi there,

I've been using this binding for a while and figured it was about time to make it official. I ran the tests and they're all still passing. Let me know if there's anything else you want me to do to get this accepted.
Ok. Is there any way to make it clearer and not use the ternary in the
function call? If it is too much trouble or error prone, then no problem.

On Thu, Sep 25, 2014 at 10:15 AM, kanatzidis <notifications@github.com>
wrote:

> In src/xml_document.cc:
>
> > +    xmlDtdPtr dtd = xmlGetIntSubset(document->xml_obj);
> > +
> > +    if (!dtd) {
> > +        NanReturnNull();
> > +    }
> > +
> > +    const char* name = (const char *)dtd->name;
> > +    const char* extId = (const char *)dtd->ExternalID;
> > +    const char* sysId = (const char *)dtd->SystemID;
> > +
> > +    v8::Local<v8::Object> dtdObj = NanNew<v8::Object>();
> > +
> > +    dtdObj->Set(NanNew<v8::String>("name"),
> > +        (name != NULL)
> > +        ?(v8::Handle<v8::Value>)NanNew<v8::String>(name, strlen(name))
> > +        :(v8::Handle<v8::Value>)NanNull());
>
> It's not a comma operator, v8::Object->Set takes two arguments. The
> ternary evaluates the second argument.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/polotek/libxmljs/pull/254/files#r18045569>.
>