diff --git HTMLparser.c HTMLparser.c
index dd0c1ea..fba321f 100644
--- HTMLparser.c
+++ HTMLparser.c
@@ -3679,6 +3679,8 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
 	return -1;
     }
     if (CUR != '<') return -1;
+    /* Save the start of the particular tag */
+    ctxt->input->start = ctxt->input->cur;
     NEXT;
 
     atts = ctxt->atts;
diff --git SAX2.c SAX2.c
index 4adf202..64cb11f 100644
--- SAX2.c
+++ SAX2.c
@@ -1638,12 +1638,15 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
     }
     ctxt->nodemem = -1;
     if (ctxt->linenumbers) {
-	if (ctxt->input != NULL) {
-	    if (ctxt->input->line < 65535)
-		ret->line = (short) ctxt->input->line;
-	    else
-	        ret->line = 65535;
-	}
+    	if (ctxt->input != NULL) {
+    	    if (ctxt->input->line < 65535) {
+                ret->line = (short) ctxt->input->line;
+            } else {
+    	        ret->line = 65535;
+            }
+
+            ret->start = (unsigned long)(ctxt->input->start - ctxt->input->base);
+    	}
     }
 
     /*
@@ -1896,14 +1899,17 @@ skip:
 	ret->content = (xmlChar *) intern;
 
     if (ctxt->linenumbers) {
-	if (ctxt->input != NULL) {
-	    if (ctxt->input->line < 65535)
-		ret->line = (short) ctxt->input->line;
-	    else {
-	        ret->line = 65535;
-		if (ctxt->options & XML_PARSE_BIG_LINES)
-		    ret->psvi = (void *) (long) ctxt->input->line;
-	    }
+    	if (ctxt->input != NULL) {
+    	    if (ctxt->input->line < 65535) {
+                ret->line = (short) ctxt->input->line;
+            } else {
+                ret->line = 65535;
+            }
+
+	    ret->start = (unsigned long)(ctxt->input->start - ctxt->input->base);
+
+            if (ctxt->options & XML_PARSE_BIG_LINES)
+    	        ret->psvi = (void *) (long) ctxt->input->line;
 	}
     }
 
@@ -2274,10 +2280,13 @@ xmlSAX2StartElementNs(void *ctx,
     }
     if (ctxt->linenumbers) {
 	if (ctxt->input != NULL) {
-	    if (ctxt->input->line < 65535)
-		ret->line = (short) ctxt->input->line;
-	    else
-	        ret->line = 65535;
+	    if (ctxt->input->line < 65535) {
+                ret->line = (short) ctxt->input->line;
+            } else {
+                ret->line = 65535;
+            }
+
+            ret->start = (unsigned long)(ctxt->input->start - ctxt->input->base);
 	}
     }
 
@@ -2666,10 +2675,13 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
 
     if (ctxt->linenumbers) {
 	if (ctxt->input != NULL) {
-	    if (ctxt->input->line < 65535)
-		ret->line = (short) ctxt->input->line;
-	    else
-	        ret->line = 65535;
+	    if (ctxt->input->line < 65535) {
+                ret->line = (short) ctxt->input->line;
+            } else {
+                ret->line = 65535;
+            }
+
+            ret->start = (unsigned long)(ctxt->input->start - ctxt->input->base);
 	}
     }
     if (ctxt->inSubset == 1) {
@@ -2726,10 +2738,13 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
     if (ret == NULL) return;
     if (ctxt->linenumbers) {
 	if (ctxt->input != NULL) {
-	    if (ctxt->input->line < 65535)
-		ret->line = (short) ctxt->input->line;
-	    else
-	        ret->line = 65535;
+	    if (ctxt->input->line < 65535) {
+                ret->line = (short) ctxt->input->line;
+            } else {
+                ret->line = 65535;
+            }
+
+            ret->start = (unsigned long)(ctxt->input->start - ctxt->input->base);
 	}
     }
 
diff --git include/libxml/parser.h include/libxml/parser.h
index 3f5730d..bd464be 100644
--- include/libxml/parser.h
+++ include/libxml/parser.h
@@ -60,6 +60,7 @@ struct _xmlParserInput {
     const xmlChar *base;              /* Base of the array to parse */
     const xmlChar *cur;               /* Current char being parsed */
     const xmlChar *end;               /* end of the array to parse */
+    const xmlChar *start;             /* Start byte of the most recent Node */
     int length;                       /* length if known */
     int line;                         /* Current line */
     int col;                          /* Current column */
diff --git include/libxml/tree.h include/libxml/tree.h
index 7e06686..da33378 100644
--- include/libxml/tree.h
+++ include/libxml/tree.h
@@ -504,6 +504,7 @@ struct _xmlNode {
     void            *psvi;	/* for type/PSVI informations */
     unsigned short   line;	/* line number */
     unsigned short   extra;	/* extra data for XPath/XSLT */
+    unsigned long    start;	/* Start offset in the source of this tag */
 };
 
 /**
diff --git parser.c parser.c
index 4739add..be2402f 100644
--- parser.c
+++ parser.c
@@ -8506,6 +8506,8 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
     int i;
 
     if (RAW != '<') return(NULL);
+    /* Save the start of the particular tag */
+    ctxt->input->start = ctxt->input->cur;
     NEXT1;
 
     name = xmlParseName(ctxt);
