Support element node traversal in document fragments.

https://bugzilla.gnome.org/show_bug.cgi?id=733900
Couple of Missing Null checks

For https://bugzilla.gnome.org/show_bug.cgi?id=734328

Missing Null check could cause crash, if a pointer is dereferenced.

Found problem at two places in valid.c
no error column in structured error handler for xml schema validation errors

For https://bugzilla.gnome.org/show_bug.cgi?id=734363

When using xml schema validation, structured error callbacks do not get
passed a valid column number in xmlError field "int2".

$ ./xmlsaxparse colbug5.xml colbug5.xsd
colbug5.xml:3:0: Element '{urn:colbug5}bx': This element is not
expected.
Expected is ( {urn:colbug5}b ).

The schema error is reported for line 3, column 0 (= N/A).

I'd like to have the column number of the error passed in the xmlError
structure.  With this test case: line 3, column 9.
wrong error column in structured error when skipping whitespace in xml decl

For https://bugzilla.gnome.org/show_bug.cgi?id=734276

libxml2 reports wrong error column numbers (field int2 in xmlError)
in structured error handler, after an XML declaration containing
whitespace.

Example XML:

<?xml  version="1.0"  encoding="UTF-8"     ?><root>&</root>
<!--
         1         2         3         4         5         6
123456789012345678901234567890123456789012345678901234567890
-->

Expected location of the error would be line 1, column 53.

The actual location of the error is line 1, column 44:

$ ./xmlparse colbug1.xml
colbug1.xml:1:44: xmlParseEntityRef: no name
wrong error column in structured error when parsing attribute values

For https://bugzilla.gnome.org/show_bug.cgi?id=734280

libxml2 reports wrong error column numbers (field int2 in xmlError)
in structured error handler, after parsing XML attribute values.

Example XML:

<?xml version="1.0" encoding="UTF-8"?>
<root
xmlns="urn:colbug">&</root>
<!--
         1         2         3         4
1234567890123456789012345678901234567890
-->

Expected location of the error would be line 3, column 21.

The actual location of the error is line 3, column 9:

$ ./xmlparse colbug2.xml
colbug2.xml:3:9: xmlParseEntityRef: no name

The 12 characters of the xmlns attribute value "urn:colbug" are
not accounted for in the error column value.