100% found this document useful (1 vote)
6 views

Java XML and JSON 1st Edition Jeff Friesen pdf download

The document provides information about the book 'Java XML and JSON' by Jeff Friesen, including its contents and chapters that cover XML and JSON parsing, creation, and transformation techniques. It also includes links to download the book and other related titles. The book is published by Apress and is aimed at developers looking to enhance their knowledge of Java in relation to XML and JSON.

Uploaded by

aashoklutete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
6 views

Java XML and JSON 1st Edition Jeff Friesen pdf download

The document provides information about the book 'Java XML and JSON' by Jeff Friesen, including its contents and chapters that cover XML and JSON parsing, creation, and transformation techniques. It also includes links to download the book and other related titles. The book is published by Apress and is aimed at developers looking to enhance their knowledge of Java in relation to XML and JSON.

Uploaded by

aashoklutete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Java XML and JSON 1st Edition Jeff Friesen pdf

download

https://ebookmeta.com/product/java-xml-and-json-1st-edition-jeff-
friesen/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Java XML and JSON 1st Edition Jeff Friesen

https://ebookmeta.com/product/java-xml-and-json-1st-edition-jeff-
friesen/

Learn Java for Android Development Second Edition Jeff


Friesen

https://ebookmeta.com/product/learn-java-for-android-development-
second-edition-jeff-friesen/

Pro RESTful APIs with Micronaut: Build Java-Based


Microservices with REST, JSON, and XML, 2nd Edition
Sanjay Patni

https://ebookmeta.com/product/pro-restful-apis-with-micronaut-
build-java-based-microservices-with-rest-json-and-xml-2nd-
edition-sanjay-patni/

Intracranial Stereotactic Radiosurgery 3rd Edition


Sheehan James P Lunsford L Dade

https://ebookmeta.com/product/intracranial-stereotactic-
radiosurgery-3rd-edition-sheehan-james-p-lunsford-l-dade/
Setting Nutritional Standards Theory Policies Practices
Elizabeth Neswald David F Smith Ulrike Thoms

https://ebookmeta.com/product/setting-nutritional-standards-
theory-policies-practices-elizabeth-neswald-david-f-smith-ulrike-
thoms/

Family Practice Guidelines 6th Edition Jill C. Cash

https://ebookmeta.com/product/family-practice-guidelines-6th-
edition-jill-c-cash/

DK Eyewitness Top 10 Montreal and Quebec City Pocket


Travel Guide 2nd Edition Dk Eyewitness

https://ebookmeta.com/product/dk-eyewitness-top-10-montreal-and-
quebec-city-pocket-travel-guide-2nd-edition-dk-eyewitness/

A River of Golden Bones The Golden Court 1 1st Edition


A K Mulford

https://ebookmeta.com/product/a-river-of-golden-bones-the-golden-
court-1-1st-edition-a-k-mulford/

Psychological Type Therapy A Practitioner s Guide to


Strengthening Relationships 1st Edition Brian A.
Gerrard

https://ebookmeta.com/product/psychological-type-therapy-a-
practitioner-s-guide-to-strengthening-relationships-1st-edition-
brian-a-gerrard/
Handbook of Environmentally Conscious Manufacturing
Second Edition Christian N. Madu

https://ebookmeta.com/product/handbook-of-environmentally-
conscious-manufacturing-second-edition-christian-n-madu/
T HE E X P ER T ’S VOIC E ® IN JAVA

Java XML
and JSON

Jeff Friesen
Java XML and JSON

Jeff Friesen
Java XML and JSON
Jeff Friesen
Dauphin, Manitoba, Canada
ISBN-13 (pbk): 978-1-4842-1915-7 ISBN-13 (electronic): 978-1-4842-1916-4
DOI 10.1007/978-1-4842-1916-4
Library of Congress Control Number: 2016943840
Copyright © 2016 by Jeff Friesen
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed. Exempted from this legal reservation are
brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for
the purpose of being entered and executed on a computer system, for exclusive use by the purchaser
of the work. Duplication of this publication or parts thereof is permitted only under the provisions
of the Copyright Law of the Publisher’s location, in its current version, and permission for use must
always be obtained from Springer. Permissions for use may be obtained through RightsLink at the
Copyright Clearance Center. Violations are liable to prosecution under the respective Copyright Law.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they
are not identified as such, is not to be taken as an expression of opinion as to whether or not they are
subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal responsibility
for any errors or omissions that may be made. The publisher makes no warranty, express or implied,
with respect to the material contained herein.
Managing Director: Welmoed Spahr
Lead Editor: Steve Anglin
Technical Reviewer: Wallace Jackson
Editorial Board: Steve Anglin, Pramila Balan, Louise Corrigan, James T. DeWolf,
Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, James Markham,
Susan McDermott, Matthew Moodie, Ben Renow-Clarke, Gwenan Spearing
Coordinating Editor: Mark Powers
Copy Editor: Mary Behr
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected], or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional
use. eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text is available
to readers at www.apress.com/9781484219157. For detailed information about how to locate your
book’s source code, go to www.apress.com/source-code/. Readers can also access source code at
SpringerLink in the Supplementary Material section for each chapter.
Printed on acid-free paper
To Dave, the late Father Lucian, Jane, and Rob.
Contents at a
Glance
About the Author ............................................................................ xiii
About the Technical Reviewer ..........................................................xv
Acknowledgments ..........................................................................xvii
Introduction .....................................................................................xix

■Chapter 1: Introducing XML ............................................................ 1


■Chapter 2: Parsing XML Documents with SAX.............................. 29
■Chapter 3: Parsing and Creating XML Documents with DOM ....... 57
■Chapter 4: Parsing and Creating XML Documents with StAX ....... 75
■Chapter 5: Selecting Nodes with XPath ........................................ 97
■Chapter 6: Transforming XML Documents with XSLT ................. 119
■Chapter 7: Introducing JSON ...................................................... 133
■Chapter 8: Parsing and Creating JSON Objects with mJson.......... 149
■Chapter 9: Parsing and Creating JSON Objects with Gson ......... 179

v
vi Contents at a Glance

■Chapter 10: Extracting JSON Values with JsonPath ................... 223


■Appendix A: Answers to Exercises ............................................ 241

Index .............................................................................................. 279


Contents
About the Author ............................................................................ xiii
About the Technical Reviewer ..........................................................xv
Acknowledgments ..........................................................................xvii
Introduction .....................................................................................xix

■Chapter 1: Introducing XML ............................................................ 1


What Is XML? .......................................................................................... 1
Language Features Tour .......................................................................... 3
XML Declaration ....................................................................................................... 3
Elements and Attributes ........................................................................................... 5
Character References and CDATA Sections .............................................................. 7
Namespaces ............................................................................................................. 8
Comments and Processing Instructions ................................................................. 13

Well-Formed Documents ....................................................................... 14


Valid Documents ................................................................................... 15
Document Type Definition ....................................................................................... 15
XML Schema........................................................................................................... 21

Summary ............................................................................................... 28

vii
viii Contents

■Chapter 2: Parsing XML Documents with SAX.............................. 29


What Is SAX? ......................................................................................... 29
Exploring the SAX API ............................................................................ 30
Obtaining a SAX 2 Parser........................................................................................ 30
Touring XMLReader Methods.................................................................................. 31
Touring the Handler and Resolver Interfaces.......................................................... 35

Demonstrating the SAX API ................................................................... 40


Creating a Custom Entity Resolver ........................................................ 49
Summary ............................................................................................... 54
■Chapter 3: Parsing and Creating XML Documents with DOM ....... 57
What Is DOM? ........................................................................................ 57
A Tree of Nodes ..................................................................................... 58
Exploring the DOM API........................................................................... 61
Obtaining a DOM Parser/Document Builder............................................................ 61
Parsing and Creating XML Documents ................................................................... 63

Demonstrating the DOM API .................................................................. 67


Summary ............................................................................................... 74
■Chapter 4: Parsing and Creating XML Documents with StAX ....... 75
What Is StAX? ........................................................................................ 75
Exploring StAX ....................................................................................... 76
Parsing XML Documents......................................................................................... 77
Creating XML Documents ....................................................................................... 85

Summary ............................................................................................... 95
■Chapter 5: Selecting Nodes with XPath ........................................ 97
What Is XPath? ...................................................................................... 97
XPath Language Primer ......................................................................... 97
Location Path Expressions...................................................................................... 98
General Expressions ............................................................................................. 101
Contents ix

XPath and DOM ................................................................................... 103


Advanced XPath .................................................................................. 110
Namespace Contexts ............................................................................................ 110
Extension Functions and Function Resolvers ....................................................... 111
Variables and Variable Resolvers.......................................................................... 115
Summary ............................................................................................. 118
■Chapter 6: Transforming XML Documents with XSLT ................. 119
What Is XSLT? ...................................................................................... 119
Exploring the XSLT API......................................................................... 120
Demonstrating the XSLT API ................................................................ 123
Summary ............................................................................................. 132
■Chapter 7: Introducing JSON ...................................................... 133
What Is JSON? ..................................................................................... 133
JSON Syntax Tour ................................................................................ 134
Demonstrating JSON with JavaScript ................................................. 137
Validating JSON Objects ...................................................................... 140
Summary ............................................................................................. 147
■Chapter 8: Parsing and Creating JSON Objects with mJson.......... 149
What Is mJson? ................................................................................... 149
Obtaining and Using mJson .................................................................................. 150

Exploring the Json Class ..................................................................... 150


Creating Json Objects........................................................................................... 151
Learning About Json Objects ................................................................................ 155
Navigating Json Object Hierarchies...................................................................... 163
Modifying Json Objects ........................................................................................ 165
Validation .............................................................................................................. 170
Customization via Factories ................................................................................. 173

Summary ............................................................................................. 178


x Contents

■Chapter 9: Parsing and Creating JSON Objects with Gson ......... 179
What Is Gson? ..................................................................................... 179
Obtaining and Using Gson .................................................................................... 180

Exploring GSon .................................................................................... 180


Introducing the Gson Class ................................................................................... 181
Parsing JSON Objects Through Deserialization .................................................... 183
Creating JSON Objects Through Serialization ....................................................... 190
Learning More About Gson ................................................................................... 197

Summary ............................................................................................. 222


■Chapter 10: Extracting JSON Values with JsonPath ................... 223
What Is JsonPath? ............................................................................... 223
Learning the JsonPath Language ........................................................ 224
Obtaining and Using the JsonPath Library .......................................... 227
Exploring the JsonPath Library ........................................................... 228
Extracting Values from JSON Objects ................................................................... 229
Using Predicates to Filter Items............................................................................ 232

Summary ............................................................................................. 239


■Appendix A: Answers to Exercises ............................................ 241
Chapter 1: Introducing XML ................................................................. 241
Chapter 2: Parsing XML Documents with SAX..................................... 246
Chapter 3: Parsing and Creating XML Documents with DOM .............. 251
Chapter 4: Parsing and Creating XML Documents with StAX .............. 258
Chapter 5: Selecting Nodes with XPath ............................................... 261
Chapter 6: Transforming XML Documents with XSLT .......................... 264
Chapter 7: Introducing JSON ............................................................... 267
Contents xi

Chapter 8: Parsing and Creating JSON Objects with mJson ............... 269
Chapter 9: Parsing and Creating JSON Objects with Gson .................. 272
Chapter 10: Extracting JSON Property Values with JsonPath.............. 276

Index .............................................................................................. 279


About the Author
Jeff Friesen is a freelance teacher and
software developer with an emphasis on Java.
In addition to authoring Java I/O, NIO and NIO.2
(Apress) and Java Threads and the Concurrency
Utilities (Apress), Jeff has written numerous
articles on Java and other technologies
(such as Android) for JavaWorld (JavaWorld.com),
informIT (InformIT.com), Java.net, SitePoint
(SitePoint.com), and other web sites. Jeff can
be contacted via his web site at JavaJeff.ca.
or via his LinkedIn (LinkedIn.com) profile
(www.linkedin.com/in/javajeff).

xiii
Discovering Diverse Content Through
Random Scribd Documents
at Umballa, he proposed to head the siege-army himself. It was to
consist[50] of three brigades—one from Umballa, under Brigadier
Halifax; a second from the same place, under Brigadier Jones; and a
third from Meerut, under Brigadier Wilson. He proposed to send off
the two brigades from Umballa on various days, so that all the corps
should reach Kurnaul, fifty miles nearer to Delhi, by the 30th. Then,
by starting on the 1st of June, he expected to reach Bhagput on the
5th, with all his Umballa force except the siege-train, which might
possibly arrive on the 6th. Meanwhile Major-general Hewett was to
organise a brigade at Meerut, and send it to Bhagput, where it
would form a junction with the other two brigades. Ghazeeoodeen
Nuggur being a somewhat important post, as a key to the Upper
Doab, it was proposed that Brigadier Wilson should leave a small
force there—consisting of a part of the Sirmoor battalion, a part of
the Rampore horse, and a few guns—while he advanced with the
rest of his brigade to Bhagput. Lastly, it was supposed that the
Meerut brigade, by starting on the 1st or 2d of June, could reach the
rendezvous on the 5th, and that then all could advance together
towards Delhi. Such was General Anson’s plan—a plan that he was
not destined to put in execution himself.
It will be convenient to trace the course of proceeding in the
following mode—to describe the advance of the Meerut brigade to
Bhagput, with its adventures on the way; then to notice in a similar
way the march of the main body from Umballa to Bhagput; next the
progress of the collected siege-army from the last-named town to
the crest or ridge bounding Delhi on the north; and, lastly, the
commencement of the siege-operations themselves—operations
lamentably retarded by the want of a sufficient force of siege-guns.
Sir Henry Barnard.

Major-general Hewett, at Meerut, proceeded to organise a brigade in


accordance with the plan laid down by General Anson: retaining at
his head-quarters a force sufficient to protect Meerut and its
neighbourhood. It was on the 27th of May that this brigade was
ready, and that Colonel Archdall Wilson was placed in command of it
—a gallant officer afterwards better known as Brigadier or General
Wilson. The brigade was very small; comprising less than 500 of the
60th Rifles, 200 of the Carabiniers, one battery and a troop of
artillery. They started on the evening of the 27th; and after
marching during the cooler hours of the 28th and 29th, encamped
on the morning of the 30th at Ghazeeoodeen Nuggur (Ghazee-u-
deen Nuggur, Guznee de Nuggur). This was a small town or village
on the left bank of the river Hindoun, eighteen miles east of Delhi,
important as commanding one of the passages over that river from
Meerut, the passage being by a suspension-bridge.
On that same day, the 30th of May, Brigadier Wilson was attacked by
the insurgents, who had sallied forth from Delhi for this purpose,
and who were doubtless anxious to prevent a junction of the Meerut
force with that from Kurnaul. The enemy appeared in force on the
opposite side of the river, with five guns in position. Wilson at once
sent a body of Rifles to command the suspension-bridge; while a
few Carabiniers were despatched along the river-bank to a place
where they were able to ford. The insurgents opened fire with their
five heavy guns; whereupon the brigadier sent off to the attacked
points all his force except sufficient to guard his camp; and then the
contest became very brisk. The Rifles, under Colonel Jones, were
ordered to charge the enemy’s guns; they rushed forward,
disregarding grape and canister shot, and advanced towards the
guns. When they saw a shell about to burst, they threw themselves
down on their faces to avoid the danger, then jumped up, and off
again. They reached the guns, drove away the gunners, and effected
a capture. The enemy, beaten away from the defences of the bridge,
retreated to a large walled village, where they had the courage to
stand a hand-to-hand contest for a time—a struggle which no native
troops could long continue against the British Rifles. As evening
came on, the enemy fled with speed to Delhi, leaving behind them
five guns, ammunition, and stores. Colonel Coustance followed them
some distance with the Carabiniers; but it was not deemed prudent
to continue the pursuit after nightfall. In this smart affair 11 were
killed, 21 wounded or missing. Captain Andrews, with four of his
riflemen, while taking possession of two heavy pieces of ordnance
on the causeway, close to the toll-house of the bridge, were blown
up by the explosion of an ammunition-wagon, fired by one of the
sepoy gunners.
The mutineers did not allow Brigadier Wilson to remain many hours
quiet. He saw parties of their horse reconnoitring his position all the
morning of the 31st; and he kept, therefore, well on the alert. At
one o’clock the enemy, supposed to be five thousand in number,
took up a position a mile in length, on a ridge on the opposite side
of the Hindoun, and about a mile distant from Wilson’s advanced
picket. Horse-artillery and two 18-pounders were at once sent
forward to reply to this fire, with a party of Carabiniers to support;
while another party, of Rifles, Carabiniers, and guns, went to support
the picket at the bridge. For nearly two hours the contest was one of
artillery alone, the British guns being repeatedly and vainly charged
by the enemy’s cavalry; the enemy’s fire then slackening, and the
Rifles having cleared a village on the left of the toll-bar, the brigadier
ordered a general advance. The result was as on the preceding day;
the mutineers were driven back. The British all regretted they could
not follow, and cut up the enemy in the retreat; but the brigadier,
seeing that many of his poor fellows fell sun-stricken, was forced to
call them back into camp when the action was over. This victory was
not so complete as that on the preceding day; for the mutineers
were able to carry off all their guns, two heavy and five light. The
killed and wounded on the side of the English were 24 in number, of
whom 10 were stricken down by the heat of the sun—a cause of
death that shews how terrible must have been the ordeal passed
through by all on such a day. Among the officers, Lieutenant Perkins
was killed, and Captain Johnson and Ensign Napier wounded.
After the struggle of the 31st of May, the enemy did not molest
Wilson in his temporary camp at Ghazeeoodeen Nuggur. He provided
for his wounded, refitted his brigade, and waited for reinforcements.
On the morning of the 3d of June he was joined by another hundred
of the 60th Rifles from Meerut, and by a Goorkha regiment, the
Sirmoor battalion, from Deyrah Dhoon; and then lost no time in
marching to the rendezvous. The route taken was very circuitous,
hilly, and rugged; and the brigade did not reach the rendezvous
head-quarters at Bhagput till the morning of the 6th.
We have now to trace the fortunes of the Umballa force. It was on
the 23d of May, as has been shewn, that General Anson put forth
the scheme for an advance towards Delhi, in which the brigade from
Meerut was to take part. He left Umballa on the 24th, and reached
Kurnaul on the 25th. All the proposed regiments and detachments
from Umballa had by that time come in to Kurnaul except two troops
of horse-artillery; but as the siege-train was far in arrear, Anson
telegraphed to Calcutta that he would not be in a position to
advance from Kurnaul towards Delhi until the 31st of the month. On
the 26th, the commander-in-chief’s plans were ended by the ending
of his life; an attack of cholera carried him off in a few hours. He
hastily summoned Sir Henry Barnard from Umballa; and his last
words were to place the Delhi force under the command of that
officer. At that time news and orders travelled slowly between
Calcutta and the northwest; for dâks were interrupted and telegraph
wires cut; and it was therefore necessary that the command should
at once be given to some one, without waiting for sanction from the
governor-general. Viscount Canning heard the news on the 3d of
June, and immediately confirmed the appointment of Sir Henry to
the command of the siege-army; but that confirmation was not
known to the besiegers till long afterwards. Major-general Reed, by
the death of Anson, became provisional commander-in-chief; and he
left Rawul Pindee on the 28th of May to join the head-quarters of
the siege-army, but without superseding Barnard. It was a terrible
time for all these generals: Anson and Halifax had both succumbed
to cholera; Reed was so thoroughly broken down by illness that he
could not command in person; and Barnard was summoned from a
sick-bed by the dying commander-in-chief.
Sir Henry Barnard did not feel justified in advancing from Kurnaul
until heavier guns than those he possessed could arrive from the
Punjaub. On the 31st, a 9-pounder battery—those already at hand
being only 6-pounders—came into camp; and the march from
Kurnaul to Paniput commenced on that evening. Sir Henry expected
to have met Brigadier Wilson at Raee, where there was a bridge of
boats over the Jumna; but through some misconstruction or
countermanding of orders, Wilson had taken a much more circuitous
route by Ghazeeoodeen Nuggur, and could not join the Umballa
brigade at the place or on the day expected. Barnard, after a brief
sojourn and a slight change of plan, sent out elephants to aid in
bringing forward the Meerut brigade, and advanced with the greater
portion of his own force to Alipore (or Aleepore), where he arrived
on the morning of the 5th of June. The chief artillery force being
with the Meerut brigade, Sir Henry waited for Wilson, who effected a
junction with him on the 6th; and on the 7th, the united forces were
reorganised, at a point so near Delhi that the troops looked forward
eagerly to a speedy encounter with the enemy.
Many of the soldiers who thus assembled at a place distant only a
few miles from the famous city, which they all hoped soon to retake
from the hands of the enemy, had marched great distances. Among
the number was the corps of Guides, whose march was one of those
determined exploits of which soldiers always feel proud, and to
which they point as proof that they shrink not from fatigue and heat
when a post of duty is assigned to them. This remarkable corps was
raised on the conclusion of the Sutlej campaign, to act either as
regular troops or as guides and spies, according as the exigencies of
the service might require. The men were chosen for their sagacity
and intelligence, as well as for their courage and hardihood. They
were inhabitants of the Punjaub, but belonged to no one selected
race or creed; for among them were to be found mountaineers,
borderers, men of the plains, and half-wild warriors. Among them
nearly all the dialects of Northern India were more or less known;
and they were as familiar with hill-fighting as with service on the
plains. They were often employed as intelligencers, and in
reconnoitring an enemy’s position. They were the best of all troops
to act against the robber hill-tribes, with whom India is so greatly
infested. Among the many useful pieces of Indian service effected by
Sir Henry Lawrence, was the suggestion of this corps; and Lord
Hardinge, when commander-in-chief, acted on it in 1846. The corps
was at first limited to one troop of cavalry and two companies of
artillery, less than three hundred men in all; but the Marquis of
Dalhousie afterwards raised it to three troops and six companies,
about eight hundred and fifty men, commanded by four European
officers and a surgeon. The men were dressed in a plain serviceable
drab uniform. Their pay was eight rupees per month for a foot-
soldier, and twenty-four for a trooper. These, then, were the Guides
of whom English newspaper-readers heard so much but knew so
little. They were stationed at a remote post in the Punjaub, not far
from the Afghan frontier, when orders reached them to march to
Delhi, a distance of no less than 750 miles. They set off, horse and
foot together, and accomplished the distance in twenty-eight days—a
really great achievement in the heat of an Indian summer; they
suffered much, of course; but all took pride in their work, and
obtained high praise from the commander-in-chief. One of the
English officers afterwards declared that he had never before
experienced the necessity of ‘roughing’ it as on this occasion.
Captain Daly commanded the whole corps, while Captain Quintin
Battye had special control of that portion of it which consisted of
troopers.
The Guides, as has just been shewn, were an exceptional corps,
raised among the natives for a peculiar service. But the siege-army
contained gallant regiments of ordinary troops, whose marching was
little less severe. One of these was the 1st Bengal European
Fusiliers; a British regiment wholly belonging to the Company, and
one which in old times was known as Lord Lake’s ‘dear old dirty
shirts.’ On the 13th of May it was at Dugshai, a sanatarium and hill-
station not far from Simla. Major Jacob rode in hastily from Simla,
announced that Meerut and Delhi were in revolt, and brought an
order for the regiment to march down to Umballa forthwith, to await
further orders. At five o’clock that same day the men marched forth,
with sixty rounds in pouch, and food in haversack. After a twenty-
four miles’ walk they refreshed on the ground, supping and sleeping
as best they could. At an hour after midnight they renewed their
march, taking advantage—as troops in India are wont to do—of the
cool hours of the night; they marched till six or seven, and then
rested during the heat of the day at Chundeegurh. From five till ten
in the evening they again advanced, and then had supper and three
hours’ rest at Mobarrackpore. Then, after a seven hours’ march
during the night of the 14th-15th, they reached Umballa—having
accomplished sixty miles in thirty-eight hours. Here they were
compelled to remain some days until the arrangements of the
general in other directions were completed; and during this
detention many of their number were carried off by cholera. At
length four companies were sent on towards Kurnaul on the 17th,
under Captain Dennis; while the other companies did not start till
the 21st. The two wings of the regiments afterwards effected a
junction, and marched by Paniput, Soomalka, and Sursowlie, to
Raee, where they arrived on the 31st of May. Under a scorching sun
every day, the troops were well-nigh beaten down; but the hope of
‘thrashing the rebels at Delhi’ cheered them on. One officer speaks
of the glee with which he and his companions came in sight of a
field of onions, ‘all green above and white below,’ and of the
delightful relish they enjoyed during a temporary rest. The regiment,
after remaining at Raee till the morning of the 5th of June, was then
joined by its commandant, Colonel Welchman. Forming now part of
Brigadier Showers’ brigade, the 1st Europeans marched to Alipore,
where its fortunes were mixed up with those of the other troops in
the besieging army.
Many at Calcutta wondered why Barnard did not make a more rapid
advance from Paniput and Raee to Alipore; and many at Raee
wondered why Wilson did not come in more quickly from
Ghazeeoodeen Nuggur. The brigadier was said to have had his plans
somewhat changed by suggestions from one of the Greatheds (Mr
H. H. Greathed was agent, and Lieutenant W. H. Greathed, aid-de-
camp, for the lieutenant-governor of the Northwest Provinces in the
camp of the siege-army); while Sir Henry was anxious both to secure
Wilson’s co-operation as soon as he started, and to preserve the
health of his men during the trying season of heat. It is greatly to
the credit of him and all the officers, that the various regiments,
notwithstanding their long marches and fierce exposure to heat,
reached Delhi in admirable health—leaving cholera many miles
behind them. Having been joined by a siege-train on the 6th of
June, and by Brigadier Wilson’s forces on the 7th, Barnard began at
once to organise his plans for an advance. The reinforcements
brought by Wilson were very miscellaneous;[51] but they had fought
well on the banks of the Hindoun, and were an indispensable aid to
the general. Major-general Reed arrived from Rawul Pindee at
midnight, not to take the command from Barnard, but to sanction
the line of proceedings as temporary commander-in-chief.
It was at one o’clock on the morning of the 8th of June that the
siege-army set out from Alipore, to march the ten miles which
separate that village from Delhi. Some of the reinforcements, such
as the Guides, had not yet arrived; but the troops which formed the
army of march on this morning, according to Sir Henry’s official
dispatch, were as noted below.[52] They advanced to a village, the
name of which is variously spelt in the dispatches, letters, and maps
as Badulla Serai, Bardul-ki-Serai, Badulee-ke-Serai, Bardeleeke Serai,
Budleeka Suraee, &c., about four miles from Delhi. Here the fighting
began; here the besiegers came in contact with the enemy who had
been so long sought. When within a short distance of the village, the
sepoy watch-fires were seen (for day had scarcely yet broken).
Suddenly a report was heard, and a shot and shell came roaring
down the road to the advancing British force; and then it became
necessary to plan a mode of dealing with the enemy, who were
several thousands in number, in a strongly intrenched position, with
artillery well served. Sir Henry Barnard intrusted Brigadiers Showers,
Graves, and Grant with distinct duties—the first to advance with his
brigade on the right of the main trunk-road; the second to take the
left of the same road; and the third to cross the canal, advance
quietly, and recross in the rear of the enemy’s position at such a
time as a signal should direct them to effect a surprise. The guns
were placed in and on both sides of the road. When the hostile
forces met, the enemy opened a severe fire—a fire so severe,
indeed, that the general resolved to stop it by capturing the battery
itself. This was effected in a gallant manner by the 75th foot and the
1st Europeans; it was perilous work, for the troops had to pass over
open ground, with very little shelter or cover. Several officers were
struck down at this point; but the most serious loss was produced by
a cannon-shot which killed Colonel Chester, adjutant-general of the
army. The battery was charged so determinedly that the artillerymen
were forced to flee, leaving their guns behind them; while the
advance of the other two brigades compelled them to a general
flight. Colonel Welchman, of the 1st Fusiliers, in his eagerness
galloped after three of the mutineers and cut one of them down; but
the act would have cost him his own life, had not a private of his
regiment come opportunely to his aid.
A question now arose, whether to halt for a while, or push on
towards Delhi. It was between five and six o’clock on a summer
morning; and Barnard decided that it would be advisable not to
allow the enemy time to reassemble in or near the village. The men
were much exhausted; but after a hasty taste of rum and biscuit,
they resumed their march. Advancing in two columns, Brigadiers
Wilson and Showers fought their way along the main trunk-road;
while Barnard and Graves turned off at Azadpore by the road which
led through the cantonment of Delhi—a cantonment lately in the
hands of the British authorities, but now deserted. This advance was
a continuous fight the whole way: the rebels disputing the passage
inch by inch. It then became perceptible that a rocky ridge which
bounds Delhi on the north was bristling with bayonets and cannon,
and that the conquest of this ridge would be a necessary preliminary
to an approach to Delhi. Barnard determined on a rapid flank-
movement to turn the right of the enemy’s position. With a force
consisting of the 60th Rifles under Colonel Jones, the 2d Europeans
under Captain Boyd, and a troop of horse-artillery under Captain
Money, Sir Henry rapidly advanced, ascended the ridge, took the
enemy in flank, compelled them to flee, and swept the whole length
of the ridge—the enemy abandoning twenty-six guns, with
ammunition and camp-equipage. The Rifles rendered signal service
in this movement; taking advantage of every slight cover, advancing
closer to the enemy’s guns than other infantry could safely do, and
picking off the gunners. Brigadier Wilson and his companions were
enabled to advance by the main road; and he and Barnard met on
the ridge. From that hour the besieging army took up its position
before Delhi—never to leave it till months of hard fighting had made
them masters of the place. During the struggle on the ridge, two
incidents greatly exasperated the troops: one was the discovery that
a captured cart, which they supposed to contain ammunition, was
full of the mangled limbs and trunks of their murdered fellow-
Christians; the other was that two or three Europeans were found
fighting for and with the rebels—probably soldiers of fortune, ready
to sell their services to the highest bidders. Every European—and it
was supposed that Delhi contained others of the kind—so caught
was sure to be cut to pieces by the enraged soldiery, with a far more
deadly hatred than sepoys themselves could have inspired. This
day’s work was not effected without serious loss. Colonel Chester,
we have said, was killed; as were Captains Delamain and Russell,
and Lieutenant Harrison. The wounded comprised Colonel Herbert;
Captains Dawson and Greville; Lieutenants Light, Hunter, Davidson,
Hare, Fitzgerald, Barter, Rivers, and Ellis; and Ensign Pym. In all,
officers and privates, there were 51 killed and 133 wounded. Nearly
50 horses were either killed or wounded.
Here, then, in the afternoon of the 8th of June, were the British
posted before Delhi. It will be necessary to have a clear notion of
the relative positions of the besiegers and the besieged, to
understand the narrative which is to follow. Of Delhi itself an account
is given elsewhere, with a brief notice of the defence-works;[53] but
the gates and bastions must here be enumerated somewhat more
minutely, as the plan of the siege mainly depended on them. A small
branch or nullah of the Jumna is separated from the main stream by
a sand-bank which forms an island; the junction or rejoining of the
two takes place where the Jumna is crossed by a bridge of boats,
and where the old fort called the Selimgurh was built. Beginning at
this point, we trace the circuit of the wall and its fortifications. From
the Selimgurh the wall borders—or rather bordered (for it will be
well to speak in the past tense)—the nullah for about three-quarters
of a mile, in a northwest direction, marked by the Calcutta Gate, a
martello tower, the Kaila Gate, the Nuseergunje Bastion, and the
Moree or Moira Bastion. The wall then turned sharply to the west, or
slightly southwest; and during a length of about three-quarters of a
mile presented the Moree Bastion just named, the Cashmere Gate,
the Moree Gate, and the Shah Bastion. To this succeeded a portion
about a mile in length, running nearly north and south, and marked
by the Cabool Gate, a martello tower, Burn Bastion, the Lahore Gate,
and the Gurstin Bastion. Then, an irregular polygonal line of two
miles in length carried the wall round to the bank of the Jumna, by a
course bending more and more to the east; here were presented the
Turushkana Gate, a martello tower, the Ajmeer Gate, the Akbar
Bastion, another martello tower, the Ochterlony Bastion, the
Turcoman Gate, a third and a fourth martello towers, and the Delhi
Gate. Lastly, along the bank of the river for a mile and a half, and
separated from the water at most times by a narrow sandy strip,
was a continuation of the wall, broken by the Wellesley and Nawab
Bastions, the Duryagunje Gate, a martello tower, the Rajghat Gate,
the wall of the imperial palace, and the defence-wall entirely
surrounding the Selimgurh. Such were the numerous gates,
bastions, and towers at that period; many parts of the wall and
bastions were formed of masonry twelve feet thick, and the whole
had been further strengthened by the rebels during four weeks of
occupation. Outside the defences was a broad ditch twenty feet
deep from the ground, or thirty-five from the top of the wall.
The position taken up by the besiegers may be thus briefly
described. The camp was pitched on the former parade-ground of
the deserted encampment, at a spot about a mile and a half from
the northern wall of the city, with a rocky ridge acting as a screen
between it and the city. This ridge was commanded by the rebels
until the afternoon of the 8th; but from that time it was in the hands
of the besiegers. The British line on this ridge rested on the left on
an old tower used as a signal-post, often called the Flagstaff Tower;
at its centre, upon an old mosque; and at its right, upon a house
with enclosures strongly placed at the point where the ridge begins
to slope down towards the plain. This house, formerly occupied by a
Mahratta chief named Hindoo Rao, was generally known as Hindoo
Rao’s house. Owing to the ridge being very oblique in reference to
the position of the city, the right of the line was of necessity thrown
much forward, and hence Hindoo Rao’s house became the most
important post in the line. Near this house, owing to its commanding
position, the British planted three batteries; and to protect these
batteries, Rifles, Guides, and Sirmoor Goorkhas were posted within
convenient distance. Luckily for the British, Hindoo Rao’s house was
‘pucka-built,’ that is, a substantial brick structure, and bore up well
against the storm of shot aimed at it by the rebels.
When the British had effected a permanent lodgment on the ridge,
with the camp pitched in the old cantonment behind the ridge as a
screen, the time had arrived when the detailed plan for the siege
was to be determined, if it had not been determined already. Some
military critics averred that Sir Henry Barnard, only acquainted in a
slight degree with that part of India, displayed indecision, giving and
countermanding orders repeatedly, and leaving his subordinates in
doubt concerning the real plan of the siege. Others contended that
the sudden assumption of command on the death of General Anson,
the small number of troops, and the want of large siege-guns, were
enough to render necessary great caution in the mode of procedure.
The truth appears to be, that the rebels were found stronger in
Delhi, than was suspected before the siege-army approached close
to the place; moreover, they had contested the advance from Alipore
more obstinately than had been expected—shewing that, though not
equal to British soldiers, it would not be safe to despise their
prowess. The plan of attack would obviously depend upon the real
or supposed defensive measures of the besieged. If the rebels risked
a battle outside the walls, they might very likely be defeated and
followed into the city and palace; but then would come a disastrous
street-fighting against enemies screened behind loopholed walls, and
firing upon besiegers much less numerous than themselves. Or the
half-crumbled walls might easily be scaled by active troops; but as
these troops would be a mere handful against large numbers, their
success would be very doubtful. A third plan, suggested by some
among the many advisers of that period, was to make an attack by
water, or on the river-side. The Jumna is at certain times so shallow
at Delhi as to be almost fordable, and leaving a strip of sand on
which batteries might be planted; these batteries might breach the
river-wall of the palace, and so disturb the garrison as to permit a
large body of the besiegers to enter under cover of the firing; but a
rise in the river would fatally affect this enterprise. A fourth plan
suggested was to attack near the Cashmere Gate, on the north side
of the city; the siege-army would in this case be protected on its left
flank by the river, and might employ all its force in breaching the
wall between the gate and the river; the guns would render the
mainguard untenable; when the assault was made, it would be on a
part where there is much vacant ground in the interior; and the
besieging troops would have a better chance than if at once
entangled among the intricacies of loopholed houses. Any project for
starving out the garrison, if it ever entered the mind of any soldier,
was soon abandoned; the boundary was too extensive, the gates too
many, and the besiegers too few, to effect this.

Hindoo Rao’s House—Battery in front.

During the early days after the arrival of the British, indications
appeared of an intention to blow open the Cashmere Gate, and
effect a forcible entry into the city at once; but these indications
soon ceased; and the besiegers found themselves compelled rather
to resist attacks than to make them; for the enemy, strong in
numbers, made repeated sorties from the various gates of the city,
and endeavoured to dislodge the British. One such sortie was made
about noon on the 9th, within twenty-four hours after the arrival of
the besiegers; the enemy were, however, easily repulsed, and driven
in again. The corps of Guides met with a loss on this day which
occasioned much regret. Among those who accompanied the hardy
men all the way from the Afghan frontier was Captain Quintin
Battye, a young officer much beloved as commandant of the cavalry
portion of the corps. They arrived on the 8th; and on the next day
poor Battye was shot through the body; he lived twenty-four hours
in great agony, and then sank. The Guides had a large share in this
day’s work; many of them fell, in dislodging the enemy from a rocky
position which they temporarily occupied. On the 10th a little
skirmishing took place, but not so serious as on the preceding day; it
was found, however, that the white shirts of the men were a little
too conspicuous; and they underwent an extemporaneous process of
dyeing to deepen the colour. On the 12th, early in the morning, the
enemy made a sudden attack on both flanks; but all points were
speedily defended. They were first driven back on the left; then,
after a repulse on the right, they advanced a second time under the
cover of thickly wooded gardens near the Subzee Mundee—a suburb
of Delhi about a mile and a quarter northwest of the Cabool Gate.
Major Jacob was then sent against them with some of the Bengal
Europeans; he beat them back till they got beyond the suburb, and
then returned to the camp. This morning’s affair was supposed to
have cost the enemy 250 men; the British loss was very small. On
this day, the British had the mortification of seeing two regiments of
Rohilcund mutineers, the 60th native infantry and the 4th native
cavalry, enter Delhi with bands playing and colours flying; the
defiant manner was quite as serious an affair as the augmentation of
the strength of the garrison. On the 13th a large enclosure in
advance of the British left, known as Metcalfe House, was occupied
by them, and the erection of a battery of heavy guns and mortars
commenced.
Not a day passed without some such struggles as have just been
adverted to. The besieging of the city had not really commenced, for
the British had not yet a force of artillery sufficient for that purpose;
indeed, they were now the besieged rather than the besiegers; for
the enemy came out of the city—horse, foot, and guns—and
attempted to effect a surprise on one part or other of the position on
the ridge. Against the battery at Metcalfe House a sortie was made
on the 15th, and another was made on the same day at the right of
the line. On the 17th an exciting encounter took place. A shot from
the city struck the corner of Hindoo Rao’s house, and glancing off,
killed Lieutenant Wheatley of the Goorkhas. It was then suspected
that the enemy, besides their attacks on this house in front, were
throwing up a battery outside the western gates of the town, at a
large building known as the Eedghah, formerly used as a serai.
Thereupon a force was immediately organised, consisting of horse-
artillery, cavalry, Goorkhas, and Rifles, to drive them away from that
position. They passed through the Subzee Mundee to the Eedghah,
drove out the enemy, and captured the only gun which had yet been
placed there. One of the officers on this duty had a finger shot off, a
bullet through the wrist, another through the cheek, and another
which broke the collar-bone; yet he recovered, to fight again.
On the 19th of June it came to the knowledge of Brigadier Grant
that the enemy intended to attack the camp in the rear; and as the
safety of the camp had been placed under his keeping, he made
instant preparations to frustrate the insurgents. These troops are
believed to have been augmentations of the insurgent forces,
consisting of the 15th and 30th native regiments from Nuseerabad.
The brigadier advanced with six guns and a squadron of lancers to
reconnoitre, and found the enemy in position half a mile in rear of
the Ochterlony Gardens, northwest of the camp. Troops quickly
arrived, and a rapid exchange of fire began, the enemy being strong
in artillery as well as in infantry. Just as the dusk of the evening
came on, the enemy, by a series of skilful and vigorous attacks,
aided by well-served artillery, very nearly succeeded in turning the
flank of the British, and in capturing two guns; but both these
disasters were frustrated. The dusk deepened into darkness; but the
brigadier felt that it would not do to allow the enemy to occupy that
position during the night. A charge was made with great impetuosity
by horse and foot, with so much success, that the enemy were
driven back quite into the town. The brigadier had to regret the loss
of Colonel Yule of the 9th Lancers, who was knocked off his horse,
and not found again by his men till next morning; when they were
shocked to see him dead and mangled, with both thighs broken, a
ball through the head just over the eyes, his throat cut, and his
hands much gashed. He had been on leave of absence in Cashmere,
but directly he heard of the work to be done, travelled night and day
till he reached his regiment just before its arrival at Delhi. Lieutenant
Alexander was also among the killed. Captain Daly of the Guides,
and six other officers, were wounded. All the officers of the Guides,
but one, received wounds. Altogether, the day’s fighting resulted to
the British in the loss of 19 killed and 77 wounded; and it was a
source of much regret that a few of these fell by the hands of their
own comrades, while fighting in some confusion as darkness
approached. No less than sixty horses fell. The brigadier did not fail
to mention the names of three private soldiers—Thomas Hancock,
John Purcell, and Roopur Khan—who behaved with great gallantry at
a critical moment.
Sir Henry Barnard, for very cogent reasons, watched every
movement on the part of the mutineers who sallied forth from Delhi.
On the 22d, he saw a body of them come out of the city; and as
they were not seen to return at night, he suspected a masked
attack. At six in the evening, he sent out a party of infantry, Guides,
and Sappers, to demolish two bridges which carried the great road
across a canal westward of the camp, and over which the enemy
were in the habit of taking their artillery and columns when they
wished to attack the camp in the rear; this was a work of six hours,
warmly contested but successfully accomplished. On the 23d, Sir
Henry, expecting a valuable convoy from the Punjaub, adopted
prompt measures for its protection. He sent out a strong escort,
which safely brought the convoy into camp. Scarcely had this been
effected, when his attention was drawn to the right of his position,
near Hindoo Rao’s house. It was afterwards ascertained that the
enemy, remembering the 23d of June as the centenary of the battle
of Plassy, had resolved to attempt a great victory over the British on
that day; incited, moreover, by the circumstance that two festivals,
one Mussulman and the other Hindoo, happened to occur on that
day; and they emerged from the city in vast force to effect this.
They commenced their attack on the Subzee Mundee side, having a
strong position in a village and among garden-walls. Here a combat
was maintained during the whole of the day, for the rebels continued
their attacks with much pertinacity; they lodged themselves in
loopholed houses, a serai, and a mosque, whence they could not be
dislodged till they had wrought much mischief by musketry. At
length, however, they were driven back into the city. The value of
the precaution taken on the preceding evening, in destroying the
bridges, was made fully evident; for the rebels were unable to cross
the canal to get to the rear of the camp. The 1st Europeans had a
desperate contest in the Subzee Mundee, where street-fighting, and
firing from windows and house-tops, continued for many hours. The
British troops suffered terribly from the heat of the midsummer sun,
to which they were exposed from sunrise to sunset. Many officers
were brought away sun-struck and powerless. The Guides fought for
fifteen hours uninterruptedly, with no food, and only a little water. At
one o’clock, when the enemy were strengthened by large
reinforcements from the city, the Guides found themselves without
ammunition, and had to send back to the camp for more; but as
great delay occurred, they were in imminent peril of annihilation.
Fortunately a corps of Sikhs, who had arrived at camp that morning,
rushed forward at a critical moment, and aided the Guides in driving
back the enemy. One of the incidents of the day has been thus
narrated, shewing how little scruple a Goorkha felt when he met a
sepoy: ‘In the intense heat, a soldier of the 2d Europeans and a
Goorkha sought the shade and protection of a house near the
Subzee Mundee, a window of which looked into a lane where they
were seated. Not long had they rested when, from the open window,
was seen to project the head of a sepoy. Now all Hindoos have what
ladies at home call “back-hair,” and this is usually turned up into a
knot; by this the unlucky wretch was at once seized, and before he
could even think of resistance, his head was at a stroke severed
from his body by the sharp curved knife of the Goorkha!’ This day’s
work was in every way very severe, and shewed the besiegers that
the rebels were in great strength. Lieutenant Jackson was killed;
Colonel Welchman, Captain Jones, and Lieutenant Murray, wounded.
The total loss of the day was 39 killed and 121 wounded. The
enemy’s loss was very much larger; indeed, one of the estimates
raised the number up to a thousand. The loss appears to have
somewhat dispirited the mutineers, for they made very few attacks
on the following three days.
But although there was a temporary cessation, Sir Henry Barnard, in
his official dispatches, shewed that he was much embarrassed by
this condition of affairs. His forces were few; those of the enemy
were very large; and the attacks were rendered more harassing by
the uncertainty of the point on which they would be made, and the
impossibility of judging whether they were about to be made on
more points than one. The onslaughts could only be successfully
repulsed by the untiring and unflinching gallantry of a small body of
men. The enemy, instead of being beleaguered within Delhi, were
free to emerge from the city and attack the besiegers’ position. The
British did not complain: it was not their wont; but they suffered
greatly from this harassing kind of warfare. Reinforcements were
slowly coming in; in the last week of June the Europeans numbered
about three thousand; and they were well satisfied with the native
corps who fought by their side—the Guides, the Goorkhas, and the
Sikhs—all of whom joined very heartily in opposing the rebel sepoys.
The siege-material at this time consisted of five batteries, mounting
about fifteen guns and mortars, placed on various points of the
ridge; the bombardment of the city by these guns was not very
effective, for the distance averaged nearly a mile, and the guns were
not of large calibre.
The interval from the 23d to the 30th of June passed much in the
same way as the two preceding weeks; the British siege-guns
wrought very little mischief to the city; while the enemy occasionally
sallied forth to attack either the camp or the works on the ridge. It
was often asserted, and facts seemed to corroborate the statement,
that when mutinous regiments from other places appeared before
Delhi, they were not afforded reception and shelter until they had
earned it by making an attack on the British position; and thus it
happened that the besiegers were opposed by a constantly
increasing number of the enemy. The defenders of the garrison
fitted up a large battery on the left of the Cashmere Gate, one at the
gate itself, one at the Moree Gate, one at the Ajmeer Gate, and one
directly opposite Hindoo Rao’s house; against these five batteries,
for a long time, the British had only three; so that the besieged were
stronger than the besiegers in every way. The gunners, too, within
Delhi, were fully equal to those of the siege-army in accuracy of aim;
their balls and shells fell near Hindoo Rao’s house so thickly as to
render that post a very perilous one to hold. One shell entered the
gateway, and killed eight or nine officers and men who were seeking
shelter from the mid-day heat.

The General and his Staff at the Mosque Picket before


Delhi.
It was pretty well ascertained, before June was half over, that Delhi
was not to be taken by a coup de main; and when Sir John
Lawrence became aware of that fact, he sent reinforcements down
from the Punjaub as rapidly as they could be collected. Every sepoy
regiment that was either disbanded or disarmed lessened his own
danger, for he trusted well in his Sikhs, Punjaubees, and Guides; and
on that account he was able to send Europeans and artillery. The
reserve and depôt companies of the regiments already serving
before Delhi were sent down from the hills to join their companions.
A wing of H.M. 61st foot, a portion of the 8th, artillery from
Jullundur, and artillerymen from Lahore, followed the Guides and
Sikhs, and gradually increased the besieging force. Then came
Punjaub rifles and Punjaub light horse; and there were still a few
Hindustani cavalry and horse-artillery in whom their officers placed
such unabated confidence that they were permitted to take part in
the siege-operations, on the ground that there were Europeans
enough to overawe them if they became unruly. These
reinforcements of course came in by degrees: we mention them all
in one paragraph, but many weeks elapsed before they could reach
the Delhi camp. Fortunately, supplies were plentiful; the country
between Delhi and the Sutlej was kept pretty free from the enemy;
and the villagers were glad to find good customers for the
commodities they had to sell. It hence arose that, during the later
days of June, the British were well able to render nugatory all sallies
made by the enemy; they had food and beverages in good store;
and they were free from pestilential diseases. On the other hand,
they suffered intensely from the heat; and were much dissatisfied at
the small progress made towards the conquest of the city. Some
expressed their dissatisfaction by adverse criticisms on the general’s
tactics; while others admitted that a storming of Delhi would not be
prudent without further reinforcements. As to the heat, the troops
wrote of it in all their letters, spoke of it in all their narrations. One
officer, who had seventy-two hours of outpost-duty on a plain
without the slightest shelter, described his sensation in the daytime
as if ‘a hot iron had been going into his head.’ On a certain day,
when some additional troops arrived at camp after a twenty-two
miles’ march, they had scarcely lain down to rest when they were
ordered out to repel an attack by the enemy: they went, and
gallantly did the work cut out for them; but some of them ‘were so
exhausted that they sank down on the road, even under fire, and
went off to sleep.’
July arrived. Brigadier Chamberlain had recently joined the camp,
and reinforcements were coming in; but on the other hand the
rebels were increasing their strength more rapidly than the British.
The enemy began the month by an attack which tried the prowess
of the Guides and Punjaubees, in a manner that brought great praise
to those corps. In the afternoon of the 1st, Major Reid, who was
established with the head-quarters of the Sirmoor battalion at
Hindoo Rao’s house, observed the mutineers turning out in great
force from the Ajmeer and Turcoman Gates, and assembling on the
open plain outside. Then, looking round on his rear right, he saw a
large force, which was supposed to have come out of Delhi on the
previous day; comprising thirteen guns and mortars, besides cavalry
and infantry. The two forces joined about a mile from the Eedghah
Serai. At sunset 5000 or 6000 infantry advanced, passed through the
Pahareepore and Kissengunje suburbs, and approached towards the
British lines, taking cover of the buildings as they passed. The
extreme right of the line was attacked at the Pagoda picket, which
was held only by 150 Punjaubees and Guides, under Captain
Travers. Major Reid sent him a message to reserve his fire till the
enemy approached near, in order to husband his resources; while
150 British were being collected to send to his aid. Throughout the
whole night did this little band of 300 men resist a large force of
infantry and artillery, never yielding an inch, but defending the few
works which had been constructed in that quarter. At daybreak, the
enemy renewed the attacks with further troops; but Reid brought a
few more of his gallant fellows to repel them. Evening, night,
morning, noon, all passed in this way; and it was not until the
contest had continued twenty-two hours that the enemy finally
retired into the city. There may have been sufficient military reasons
why larger reinforcements were not sent to Major Reid from the
camp behind the ridge; but let the reasons have been what they
may, the handful of troops fought in the ratio of hundreds against
thousands, and never for an instant flinched during this hard day’s
work. Major Reid had the command of all the pickets and defence-
works from Hindoo Rao’s house to the Subzee Mundee. During the
first twenty-eight days of the siege, his positions were attacked no
fewer than twenty-four times; yet his singular medley of troops—
Rifles, Guides, Sikhs, Punjaubees, Goorkhas, &c.—fought as if for
one common cause, without reference to differences of religion or of
nation. The officers, in these and similar encounters, often passed
through an ordeal which renders their survival almost inconceivable.
An artillery officer, in command of two horse-artillery guns, on one
occasion was surprised by 120 of the enemy’s cavalry; he had no
support, and could not apply his artillery because his guns were
limbered up. He fired four barrels of his revolver and killed two men;
and then knocked a third off his horse by throwing his empty pistol
at him. Two horsemen thereupon charged full tilt, and rolled him and
his horse over. He got up, and seeing a man on foot coming at him
to cut him down, rushed at him, got inside his sword, and hit him
full in the face with his fist. At that moment he was cut down from
behind; and was only saved from slaughter by a brother-officer, who
rode up, shot one sowar and sabred another, and then carried him
off, bleeding but safe.
On the 2d, the Bareilly mutineers—or rather Rohilcund mutineers
from Bareilly, Moradabad, and Shahjehanpoor, consisting of five
regiments and a battery of artillery—crossed the Jumna and
marched into Delhi, with bands playing and colours flying—a sight
sufficiently mortifying to the besiegers, who were powerless to
prevent it; for any advance in that direction would have left the rear
of their camp exposed. It afterwards became known that the Bareilly
leader was appointed general within Delhi. The emergence of a large
body of the enemy from the city on the night of the 3d of July,
induced Sir Henry Barnard to send Major Coke to oppose them; with
a force made up of portions of the Carabiniers, 9th Lancers, 61st
foot, Guides, Punjaubees, horse and foot artillery. Coke started at
two in the morning of the 4th. He went to Azadpore, the spot where
the great road and the road from the cantonment met. He found
that the enemy had planned an expedition to seize the British depôt
of stores at Alipore, and to cut off a convoy expected to arrive from
the Punjaub. When the major came up with them near the Rohtuk
road, he at once attacked them. During many hours, his troops were
confronted with numbers greatly exceeding their own; and what
with the sun above and swamps below, the major’s men became
thoroughly exhausted by the time they returned to camp. The
rebels, it was true, were driven back; but they got safely with their
guns into Delhi; and thus was one more added to the list of contests
in which the besiegers suffered without effecting anything towards
the real object of the siege. The enemy’s infantry on this occasion
seem to have comprised the Bareilly men. An officer of the
Engineers, writing concerning this day’s work, said: ‘The Bareilly
rascals had the impudence to come round to our rear, and our only
regret is that one of them ever got back. I was out with the force
sent against them, and cannot say that I felt much pity for the red-
coated villains with “18,” “28,” and “68” on their buttons.’ This officer
gives expression to the bitter feeling that prevailed generally in the
British camp against the ‘Pandies’[54] or mutinous sepoys, for their
treachery, black ingratitude, and cruelty. ‘This is a war in its very
worst phase, for generosity enters into no one’s mind. Mercy seems
to have fled from us; and if ever there was such a thing as war to
the knife, we certainly have it here. If any one owes these sepoys a
grudge, I think I have some claim to one; but I must say that I
cannot bring myself to put my sword through a wounded man. I
cannot say that I grieve much when I see it done, as it invariably is;
but grieve or not as you please—he is a clever man who can now
keep back a European from driving his bayonet through a sepoy,
even in the agonies of death.’ These were the motives and feelings
that rendered the Indian mutiny much more terrible than an ordinary
war. In allusion to sentiments at home, that the British soldiers were
becoming cruel and blood-thirsty, the same officer wrote to a friend:
‘If you hear any such sentiments, by all means ship off their
propounder to this country at once. Let him see one half of what we
have seen, and compare our brutality with that of the rebels; then
send him home again, and I think you will find him pretty quiet on
the subject for the rest of his life.’
A new engineer officer, Colonel Baird Smith, arrived to supersede
another whose operations had not met with approval. The colonel
took into consideration, with his commander, a plan for blowing in
the Moree and Cashmere Gates, and escalading the Moree and
Cashmere Bastions; but the plan was abandoned on account of the
weakness of the siege-army.
The 5th of July was marked by the death of Major-general Sir Henry
Barnard, who had held practical command of the Delhi field-force
during about five weeks, and had during that time borne much
anxiety and suffering. He knew that his countrymen at Calcutta as
well as in England would be continually propounding the question,
‘Why is Delhi not yet taken?’ and the varied responsibilities
connected with his position necessarily gave him much disquietude.
During the fierce heat of the 4th he was on horseback nearly all day,
directing the operations against the Bareilly mutineers. Early on the
following morning he sent for Colonel Baird Smith, and explained his
views concerning the mode in which he thought the siege-operations
should be carried on; immediately afterwards he sent for medical
aid; and before many hours had passed, he was a corpse. Many of
his friends afterwards complained that scant justice was done to the
memory of Sir Henry Barnard; in the halo that was destined to
surround the name of Wilson, men forgot that it was his predecessor
who had borne all the burden of collecting the siege-force, of
conducting it to the ridge outside Delhi, and of maintaining a
continued series of conflicts almost every day for five or six weeks.
Major-general Reed, invalid as he was, immediately took the
command of the force after Barnard’s death; leaving, however, the
active direction mainly to Brigadier Chamberlain. It became every
day more and more apparent that, notwithstanding reinforcements,
the British artillery was too weak to cope with that of the enemy—
whose artillerymen, taught by those whom they now opposed, had
become very skilful; and whose guns were of heavier metal. The
besiegers’ batteries were still nearly a mile from the walls, for any
nearer position could not be taken up without terrible loss. To effect
a breach with a few 18-pounders at this distance was out of the
question; and although the field-guns were twenty or thirty in
number, they were nearly useless for battering down defences.
The attacks from the enemy continued much as before, but
resistance to them became complicated by a new difficulty. There
were two regiments of Bengal irregular cavalry among the troops in
the siege-army, and there were a few ‘Poorbeahs’ or Hindustanis in
the Punjaub regiments. These men were carefully watched from the
first; and it became by degrees apparent that they were a danger
instead of an aid to the British. Early in the month a Brahmin
subadar in a Punjaubee regiment was detected inciting his
companions-in-arms to murder their officers, and go over to Delhi,
saying it was God’s will the Feringhee ‘raj’ should cease. One of the
Punjaubees immediately revealed this plot to the officers, and the
incendiary was put to death that same evening. The other
Poorbeahs in the regiment were at once paid up, and discharged
from the camp—doubtless swelling the number of insurgents who
entered Delhi. Again, on the 9th, a party of the enemy’s cavalry,
while attempting an attack on the camp, was joined by some of the
9th irregulars belonging to the siege-army, and with them tried to
tempt the men of the native horse-artillery. They were beaten back;
and the afternoon of the same day, the 9th of July, was marked by
one of the many struggles in the Subzee Mundee, all of which ended
by the enemy being driven into Delhi. If the rebel infantry had
fought as well as the artillery, it might have gone hard with the
besiegers, for the sallies were generally made in very great force.
The rebels counted much on the value of the Subzee Mundee; as a
suburb, it had been rendered a mass of ruins by repeated conflicts,
and these ruins precisely suited the sepoy mode of fighting. The
sepoys found shelter in narrow streets and old houses, and behind
garden-walls, besides being protected by heavy guns from the city.
In this kind of skirmishing they were not far inferior to their
opponents; but in the open field, and especially under a charge with
the bayonet, they were invariably beaten, let the disparity of
numbers be what it might. All the officers, in their letters, spoke of
the terrible efficacy of the British bayonet; the sepoys became
paralysed with terror when this mode of attack was resorted to. On
one occasion they were constructing a defensive post at the
Eedghah; the British attacked it and drove in the entrance; there
was no exit on the other side, and the defenders were all bayoneted
in the prison-house which they had thus unwittingly constructed for
themselves.
On the morning of the 14th, the mutineers poured out in great
numbers, and attacked the batteries at Hindoo Rao’s house, and the
picket in the Subzee Mundee. The troops stationed at those places
remained on the defensive till three o’clock in the afternoon,
struggling against a force consisting of many regiments of insurgent
infantry, a large body of cavalry, and several field-pieces. It was
indeed a most determined attack, supported, moreover, by a fire of
heavy artillery from the walls. Why it was that so many hours
elapsed before succour was sent forth, is not very clear; but the
troops who had to bear the brunt of this onslaught comprised only
detachments of the 60th and 75th foot, with the Goorkhas of the
Sirmoor battalion and the infantry of the Guides. A column was
formed, however, at the house above named, under Brigadier
Showers, consisting of the 1st Punjaub infantry, the 1st Europeans,
and six horse-artillery guns. Then commenced a double contest;
Showers attacking the enemy at the picket-house, and Major Reid at
Hindoo Rao’s house. After a fierce struggle the enemy were driven
back into the city, and narrowly escaped losing some of their guns.
It was a day’s work that could not be accomplished without a serious
loss. None of the officers, it is true, were killed in the field; but the
list of wounded was very large, comprising Brigadier Chamberlain (at
that time adjutant-general of the army), and Lieutenants Roberts,
Thompson, Walker, Geneste, Carnegie, Rivers, Faithful, Daniell, Ross,
Tulloch, Chester, Shebbeare, Hawes, Debrett, and Pollock. Tho
wounding of so many subalterns shews how actively different
companies of troops must have been engaged. Altogether, the
operations of this day brought down 15 men killed and 193 officers
and men wounded.
The heat was by this time somewhat alleviated by rains, which,
however, brought sickness and other discomforts with them. Men fell
ill after remaining many hours in damp clothes; and it was found
that the fierce heat was, after all, not so detrimental to health. Many
young officers, it is true, lately arrived from England, and not yet
acclimatised, were smitten down by sun-stroke, and a few died of
apoplexy; but it is nevertheless true that the army was surprisingly
healthy during the hot weather. One of the Carabiniers, writing in
the rainy season, said: ‘The last three days have been exceedingly
wet; notwithstanding which we are constantly in the saddle; no
sooner has one alarm subsided than we are turned out to meet the
mutineers in another quarter.’ An officer of Sappers, employed in
blowing up a bridge, said: ‘We started about two P.M., and returned
about twelve at night drenched through and thoroughly miserable, it
having rained the whole time.’
The state of affairs in the middle of July was peculiar. It seemed to
the nation at home that the army of Delhi ought to be strong
enough to retake the city, especially when a goodly proportion of the
number were Europeans. Yet that this was not the case, was the
opinion both of Reed and of Wilson; although many daring spirits in
the army longed to breach the walls and take the place by storm.
Twelve hundred wounded and sick men had to be tended; all the
others were kept fully employed in repelling the sallies of the enemy.
Major-general Reed, who ought never to have assumed the
command at all—so broken-down was he in health—gave in
altogether on the 17th, after the wounding of Chamberlain; he
named Brigadier Wilson, who had brought forward the Meerut
brigade, as his successor. The new commander immediately wrote to
Sir John Lawrence a letter (in French, as if distrusting spies), in
which he candidly announced that it would be dangerous and
disastrous to attempt a storm of the city; that the enemy were in
great force, well armed, strong in position, and constantly reinforced
by accessions of insurgent regiments; that they daily attacked the
British, who could do little more than repel the attacks; that his army
was gradually diminishing by these daily losses; that it would be
impossible to take Delhi without at least one more European
regiment and two more Sikh regiments from the Punjaub; and that if
those additions did not speedily reach him, he would be obliged to
raise the siege, retreat to Kurnaul, and leave the country all around
Delhi to be ravaged by the mutineers. This letter shewed the gravity
with which Brigadier Wilson regarded the state of matters at that
critical time. Lawrence fully recognised the importance of the issue,
for he redoubled his exertions to send 900 European Fusiliers and
1600 Punjaubees to the camp.
General Reed’s resignation was twofold. He resigned the provisional
command-in-chief of the Bengal army as soon as he was officially
informed of the assumption of that office by Sir Patrick Grant; and
he resigned the command of the Delhi field-force to Brigadier
Wilson, because his health was too far broken to permit him to take
part in active duties. It was the virtual ending of his part in the wars
of the mutiny; he went to the hills, in search of that health which he
could never have recovered in the plains.
Among the many contests in the second half of the month was one
near Ludlow Castle, a name given to the residence of Mr Fraser, the
commissioner of Delhi, one of those foully murdered on the 11th of
May. This house was within half a mile of the Cashmere Gate, near
the river; the enemy were found to be occupying it; but their works
were attacked and destroyed by a force under Brigadier Showers;
while Sir T. Metcalfe’s house, further northward, was taken and
strengthened as a defensive post by the British.
Mr Colvin, writing from Agra to Havelock on the 22d of July, giving
an account of such proceedings at Delhi as had come to his
knowledge, made the following observations on the character which
the struggle had assumed: ‘The spirit by which both Hindoos and
Mohammedans act together at Delhi is very remarkable. You would
well understand a gathering of Mohammedan fanatical feeling at
that place; but what is locally, I find, known by the name of
“Pandyism,” is just as strong. Pandies are, among the Hindoos, all
Brahmins. What absurd, distorted suspicions of our intentions (which
have been so perfectly innocent towards them) may have been first
worked upon, it is scarcely possible to say; but the thing has now
got beyond this, and it is a struggle for mastery, not a question of
mistrust or discontent. Mohammedans seem to be actively
misleading Hindoos for their own purposes. Sir Patrick Grant will not
know the Bengal army again. The Goorkhas, Sikhs, and Punjaubee
Mohammedans have remained quite faithful, and done their duty
nobly at Delhi; the bad spirit is wholly with the Poorbeahs.’ Mr
Greathed, Colvin’s commissioner with the siege-army, made every
attempt to ascertain, by means of spies and deserters, what were
the alleged and what the real motives for the stubborn resistance of
the mutineers to British rule. He wrote on this subject: ‘The result of
all questionings of sepoys who have fallen into our hands, regarding
the cause of the mutiny, is the same. They invariably cite the
“cartouche” (cartridge) as the origin; no other cause of complaint
has been alluded to. His majesty of Delhi has composed a couplet,
to the effect that the English, who boast of having vanquished rods
of iron, have been overthrown in Hindostan by a single cartridge. A
consciousness of power had grown up in the army, which could only
be exercised by mutiny. The cry of the cartridges brought the latent
spirit of revolt into action.’ Mr Muir of Agra, commenting on these
remarks, said: ‘I fully believe this to be the case with the main body
of the sepoys. There were ringleaders, no doubt, who had selfish
views, and possibly held correspondence with the Delhi family, &c.;
but they made use of the cartridge as their argument to gain over
the mass of the army to the belief that their caste was threatened.’
General Wilson.

It will be unnecessary to trace day by day the struggles outside


Delhi. They continued as before; but the frequency was somewhat
lessened, and the danger also, for the defence-works on the ridge
had been much strengthened. Every bridge over the canal was
blown up, except that on the main road to Kurnaul and Umballa; and
thus the enemy could not easily attack the camp in the rear. It was
not yet really a siege, for the British poured very few shot or shell
into the city or against the walls. It was not an investment; for the
British could not send a single regiment to the southwest, south, or
east of the city. It was little more than a process of waiting till
further reinforcements could arrive.

You might also like