100% found this document useful (3 votes)
16 views

Java XML and JSON: Document Processing for Java SE 2nd Edition Jeff Friesen - Download the ebook today and own the complete version

The document is about the ebook 'Java XML and JSON: Document Processing for Java SE, 2nd Edition' by Jeff Friesen, which covers XML and JSON technologies and their integration with Java. It includes detailed chapters on parsing, creating, and transforming XML and JSON documents using various Java APIs. The book also provides exercises and supplementary materials available for download on the publisher's website.

Uploaded by

chiezasylyku
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
16 views

Java XML and JSON: Document Processing for Java SE 2nd Edition Jeff Friesen - Download the ebook today and own the complete version

The document is about the ebook 'Java XML and JSON: Document Processing for Java SE, 2nd Edition' by Jeff Friesen, which covers XML and JSON technologies and their integration with Java. It includes detailed chapters on parsing, creating, and transforming XML and JSON documents using various Java APIs. The book also provides exercises and supplementary materials available for download on the publisher's website.

Uploaded by

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

Explore the full ebook collection and download it now at textbookfull.

com

Java XML and JSON: Document Processing for Java SE


2nd Edition Jeff Friesen

https://textbookfull.com/product/java-xml-and-json-document-
processing-for-java-se-2nd-edition-jeff-friesen/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

Java XML and JSON: Document Processing for Java SE 2nd


Edition Jeff Friesen

https://textbookfull.com/product/java-xml-and-json-document-
processing-for-java-se-2nd-edition-jeff-friesen/

textbookfull.com

Java XML and JSON Friesen Jeff

https://textbookfull.com/product/java-xml-and-json-friesen-jeff/

textbookfull.com

Learn Java for Android Development Friesen Jeff

https://textbookfull.com/product/learn-java-for-android-development-
friesen-jeff/

textbookfull.com

Learn Java for Android Development: Migrating Java SE


Programming Skills to Mobile Development 4th Edition Peter
Späth
https://textbookfull.com/product/learn-java-for-android-development-
migrating-java-se-programming-skills-to-mobile-development-4th-
edition-peter-spath/
textbookfull.com
Beginning XML with C# 7: XML Processing and Data Access
for C# Developers 2nd Edition Bipin Joshi (Auth.)

https://textbookfull.com/product/beginning-xml-with-c-7-xml-
processing-and-data-access-for-c-developers-2nd-edition-bipin-joshi-
auth/
textbookfull.com

OCA Java SE 8 Programmer I Certification Guide 1st Edition


Mala Gupta

https://textbookfull.com/product/oca-java-se-8-programmer-i-
certification-guide-1st-edition-mala-gupta/

textbookfull.com

Java Performance In Depth Advice for Tuning and


Programming Java 8 11 and Beyond 2nd Edition Scott Oaks

https://textbookfull.com/product/java-performance-in-depth-advice-for-
tuning-and-programming-java-8-11-and-beyond-2nd-edition-scott-oaks/

textbookfull.com

Java Image Processing Recipes: With OpenCV and JVM Modrzyk

https://textbookfull.com/product/java-image-processing-recipes-with-
opencv-and-jvm-modrzyk/

textbookfull.com

OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809)


Kathy Sierra

https://textbookfull.com/product/ocp-java-se-8-programmer-ii-exam-
guide-exam-1z0-809-kathy-sierra/

textbookfull.com
Contents
1. Cover
2. Front Matter
3. Part I. Exploring XML

1. 1. Introducing XML
2. 2. Parsing XML Documents with SAX
3. 3. Parsing and Creating XML Documents with DOM
4. 4. Parsing and Creating XML Documents with StAX
5. 5. Selecting Nodes with XPath
6. 6. Transforming XML Documents with XSLT

4. Part II. Exploring JSON

1. 7. Introducing JSON
2. 8. Parsing and Creating JSON Objects with mJson
3. 9. Parsing and Creating JSON Objects with Gson
4. 10. Extracting JSON Values with JsonPath
5. 11. Processing JSON with Jackson
6. 12. Processing JSON with JSON-P

5. Part III. Appendixes


1. Answers to Exercises
6. Back Matter

Landmarks
1. Cover
2. Table of Contents
3. Body Matter
Jeff Friesen

Java XML and JSON


Document Processing for Java SE
2nd ed.
Jeff Friesen
Dauphin, MB, Canada

Any source code or other supplementary material


referenced by the author in this book is available
to readers on GitHub via the book’s product page,
located at www.apress.com/978-1-4842-4329-9 .
For more detailed information, please visit
http://www.apress.com/source-code .
ISBN 978-1-4842-4329-9 e-ISBN 978-1-4842-4330-5
https://doi.org/10.1007/978-1-4842-4330-5

Library of Congress Control Number: 2018968598

© Jeff Friesen 2019

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.

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.

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 orders-ny@springer-sbm.com, 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.
To my parents.
Introduction
XML and (the more popular) JSON let you organize
data in textual formats. This book introduces you
to these technologies along with Java APIs for
integrating them into your Java code. This book
introduces you to XML and JSON as of Java 11.

Chapter 1 introduces XML, where you learn


about basic language features (such as the XML
declaration, elements and attributes, and
namespaces). You also learn about well-formed
XML documents and how to validate them via the
Document Type Definition and XML Schema
grammar languages.

Chapter 2 focuses on Java’s SAX API for parsing


XML documents. You learn how to obtain a SAX 2
parser; you then tour XMLReader methods along
with handler and entity resolver interfaces. Finally,
you explore a demonstration of this API and learn
how to create a custom entity resolver.

Chapter 3 addresses Java’s DOM API for


parsing and creating XML documents. After
discovering the various nodes that form a DOM
document tree, you explore the DOM API, where
you learn how to obtain a DOM parser/document
builder and how to parse and create XML
documents. You then explore the Java DOM APIs
related to the Load and Save, and Traversal and
Range specifications.

Chapter 4 places the spotlight on Java’s StAX


API for parsing and creating XML documents. You
learn how to use StAX to parse XML documents
with stream-based and event-based readers and to
create XML documents with stream-based and
event-based writers.

Moving on, Chapter 5 presents Java’s XPath API


for simplifying access to a DOM tree’s nodes. You
receive a primer on the XPath language, learning
about location path expressions and general
expressions. You also explore advanced features
starting with namespace contexts.

Chapter 6 completes my coverage of XML by


targetting Java’s XSLT API. You learn about
transformer factories and transformers, and much
more. You also go beyond the XSLT 1.0 and XPath
1.0 APIs supported by Java.

Chapter 7 switches gears to JSON. You receive


an introduction to JSON, take a tour of its syntax,
explore a demonstration of JSON in a JavaScript
context (because Java doesn’t yet officially support
JSON), and learn how to validate JSON objects in
the context of JSON Schema.

You’ll need to work with third-party libraries to


parse and create JSON documents. Chapter 8
introduces you to the mJson library. After learning
how to obtain and use mJson, you explore the
Json class, which is the entry point for working
with mJSon.

Google has released an even more powerful


library for parsing and creating JSON documents.
The Gson library is the focus of Chapter 9 . In this
chapter, you learn how to parse JSON objects
through deserialization, how to create JSON
objects through serialization, and much more.

Chapter 10 focuses on the JsonPath API for


performing XPath-like operations on JSON
documents.

Chapter 11 introduces you to Jackson, a


popular suite of APIs for parsing and creating JSON
documents.

Chapter 12 introduces you to JSON-P, an Oracle


API that was planned for inclusion in Java SE, but
was made available to Java EE instead.
Each chapter ends with assorted exercises that
are designed to help you master the content. Along
with long answers and true/false questions, you
are often confronted with programming exercises.
Appendix A provides the answers and solutions.

Thanks for purchasing this book. I hope you


find it helpful in understanding XML and JSON in a
Java context.

Jeff Friesen (October 2018)

NOTE You can download this book’s source


code by pointing your web browser to
www.apress.com/9781484243299 and
clicking the Source Code tab followed by the
Download Now link.
Acknowledgments
I thank Apress Acquisition Editor Jonathan
Gennick and the Apress Editorial Board for giving
me the opportunity to create this second edition. I
also thank Editor Jill Balzano for guiding me
through the book development process. Finally, I
thank my technical reviewer and copy editor for
catching mistakes and making the book look great.
TABLE OF CONTENTS
Part I: Exploring XML
Chapter 1: Introducing XML
What Is XML?
Language Features Tour
XML Declaration
Elements and Attributes
Character References and CDATA Sections
Namespaces
Comments and Processing Instructions
Well-Formed Documents
Valid Documents
Document Type Definition
XML Schema
Summary
Chapter 2: Parsing XML Documents with SAX
What Is SAX?
Exploring the SAX API
Obtaining a SAX 2 Parser
Touring XMLReader Methods
Touring the Handler and Resolver Interfaces
Demonstrating the SAX API
Creating a Custom Entity Resolver
Summary
Chapter 3: Parsing and Creating XML Documents with DOM
What Is DOM?
A Tree of Nodes
Exploring the DOM API
Obtaining a DOM Parser/Document Builder
Parsing and Creating XML Documents
Demonstrating the DOM API
Parsing an XML Document
Creating an XML Document
Working with Load and Save
Loading an XML Document into a DOM Tree
Configuring a Parser
Filtering an XML Document While Parsing
Saving a DOM Tree to an XML Document
Working with Traversal and Range
Performing Traversals
Performing Range Operations
Summary
Chapter 4: Parsing and Creating XML Documents with StAX
What Is StAX?
Exploring StAX
Parsing XML Documents
Creating XML Documents
Summary
Chapter 5: Selecting Nodes with XPath
What Is XPath?
XPath Language Primer
Location Path Expressions
General Expressions
XPath and DOM
Advanced XPath
Namespace Contexts
Extension Functions and Function Resolvers
Variables and Variable Resolvers
Summary
Chapter 6: Transforming XML Documents with XSLT
What Is XSLT?
Exploring the XSLT API
Demonstrating the XSLT API
Going Beyond XSLT 1.0 and XPath 1.0
Downloading and Testing SAXON-HE 9.9
Playing with SAXON-HE 9.9
Summary
Part II: Exploring JSON
Chapter 7: Introducing JSON
What Is JSON?
JSON Syntax Tour
Demonstrating JSON with JavaScript
Validating JSON Objects
Summary
Chapter 8: Parsing and Creating JSON Objects with mJson
What Is mJson?
Obtaining and Using mJson
Exploring the Json Class
Creating Json Objects
Learning About Json Objects
Navigating Json Object Hierarchies
Modifying Json Objects
Validation
Customization via Factories
Summary
Chapter 9: Parsing and Creating JSON Objects with Gson
What Is Gson?
Obtaining and Using Gson
Exploring Gson
Introducing the Gson Class
Parsing JSON Objects Through Deserialization
Creating JSON Objects Through Serialization
Learning More About Gson
Summary
Chapter 10: Extracting JSON Values with JsonPath
What Is JsonPath?
Learning the JsonPath Language
Obtaining and Using the JsonPath Library
Exploring the JsonPath Library
Extracting Values from JSON Objects
Using Predicates to Filter Items
Summary
Chapter 11: Processing JSON with Jackson
What Is Jackson?
Obtaining and Using Jackson
Working with Jackson’s Basic Features
Streaming
Tree Model
Data Binding
Working with Jackson’s Advanced Features
Annotation Types
Custom Pretty Printers
Factory, Parser, and Generator Features
Summary
Chapter 12: Processing JSON with JSON-P
What Is JSON-P?
JSON-P 1.0
JSON-P 1.1
Obtaining and Using JSON-P
Working with JSON-P 1.0
Working with the Object Model API
Working with the Streaming Model API
Working with JSON-P 1.1’s Advanced Features
JSON Pointer
JSON Patch
JSON Merge Patch
Editing/Transformation Operations
Java SE 8 Support
Summary
Part III: Appendixes
Appendix A: Answers to Exercises
Chapter 1: Introducing XML
Chapter 2: Parsing XML Documents with SAX
Chapter 3: Parsing and Creating XML Documents with
DOM
Chapter 4: Parsing and Creating XML Documents with
StAX
Chapter 5: Selecting Nodes with XPath
Chapter 6: Transforming XML Documents with XSLT
Chapter 7: Introducing JSON
Chapter 8: Parsing and Creating JSON Objects with mJson
Chapter 9: Parsing and Creating JSON Objects with Gson
Chapter 10: Extracting JSON Values with JsonPath
Chapter 11: Processing JSON with Jackson
Chapter 12: Processing JSON with JSON-P
Index
ABOUT THE AUTHOR AND
ABOUT THE TECHNICAL
REVIEWER

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), Java Threads and
the Concurrency Utilities
(Apress), and the first
edition of this book, 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 ).

ABOUT THE TECHNICAL REVIEWER


Massimo Nardone

has more than 24 years of


experiences in Security,
web/mobile development,
Cloud, and IT architecture.
His true IT passions are
Security and Android.

He has been
programming and teaching
how to program with Android, Perl, PHP, Java, VB,
Python, C/C++, and MySQL for more than 20 years.

He holds a Master of Science degree in


Computing Science from the University of Salerno,
Italy.

He has worked as a Project Manager, Software


Engineer, Research Engineer, Chief Security
Architect, Information Security Manager,
PCI/SCADA Auditor, and Senior Lead IT
Security/Cloud/SCADA Architect for many years.

His technical skills include Security, Android,


Cloud, Java, MySQL, Drupal, Cobol, Perl, web and
mobile development, MongoDB, D3, Joomla,
Couchbase, C/C++, WebGL, Python, Pro Rails,
Django CMS, Jekyll, Scratch, etc.

He worked as visiting lecturer and supervisor


for exercises at the Networking Laboratory of the
Helsinki University of Technology (Aalto
University). He holds four international patents
(PKI, SIP, SAML, and Proxy areas).

He currently works as Chief Information


Security Officer (CISO) for Cargotec Oyj, and he is
member of ISACA Finland Chapter Board.

Massimo has been reviewing more than 45 IT


books for different publishing companies, and he is
the coauthor of Pro Android Games (Apress, 2015),
Pro JPA 2 in Java EE 8 (APress 2018), and
Beginning EJB in Java EE 8 (Apress, 2018).
Part I
Exploring XML
© Jeff Friesen 2019
Jeff Friesen, Java XML and JSON
https://doi.org/10.1007/978-1-4842-4330-5_1

1. Introducing XML
Jeff Friesen1
(1) Dauphin, MB, Canada

Applications commonly use XML documents to


store and exchange data. XML defines rules for
encoding documents in a format that is both
human-readable and machine-readable. Chapter 1
introduces XML, tours the XML language features,
and discusses well-formed and valid documents.

What Is XML?
XML (eXtensible Markup Language) is a meta-
language (a language used to describe other
languages) for defining vocabularies (custom
markup languages), which is the key to XML’s
importance and popularity. XML-based
vocabularies (such as XHTML) let you describe
documents in a meaningful way.
XML vocabulary documents are like HTML (see
http://en.wikipedia.org/wiki/HTML )
documents in that they are text-based and consist
of markup (encoded descriptions of a document’s
logical structure) and content (document text not
interpreted as markup). Markup is evidenced via
tags (angle bracket–delimited syntactic
constructs), and each tag has a name.
Furthermore, some tags have attributes
(name/value pairs).

NOTE XML and HTML are descendants of


Standard Generalized Markup Language (SGML),
which is the original meta-language for creating
vocabularies—XML is essentially a restricted
form of SGML, while HTML is an application of
SGML. The key difference between XML and
HTML is that XML invites you to create your own
vocabularies with their own tags and rules,
whereas HTML gives you a single pre-created
vocabulary with its own fixed set of tags and
rules. XHTML and other XML-based vocabularies
are XML applications. XHTML was created to be a
cleaner implementation of HTML.

If you haven’t previously encountered XML, you might be


surprised by its simplicity and how closely its vocabularies
resemble HTML. You don’t need to be a rocket scientist to learn
how to create an XML document. To prove this to yourself, check
out Listing 1-1.

<recipe>
<title>
Grilled Cheese Sandwich
</title>
<ingredients>
<ingredient qty="2">
bread slice
</ingredient>
<ingredient>
cheese slice
</ingredient>
<ingredient qty="2">
margarine pat
</ingredient>
</ingredients>
<instructions>
Place frying pan on element and select
medium heat.
For each bread slice, smear one pat of
margarine on
one side of bread slice. Place cheese
slice between
bread slices with margarine-smeared
sides away from
the cheese. Place sandwich in frying pan
with one
margarine-smeared side in contact with
pan. Fry for
a couple of minutes and flip. Fry other
side for a
minute and serve.
</instructions>
</recipe>

Listing 1-1 XML-Based Recipe for a


Grilled Cheese Sandwich
Listing 1-1 presents an XML document that
describes a recipe for making a grilled cheese
sandwich. This document is reminiscent of an
HTML document in that it consists of tags,
attributes, and content. However, that’s where the
similarity ends. Instead of presenting HTML tags
such as <html>, <head>, <img>, and <p>, this
informal recipe language presents its own
<recipe>, <ingredients>, and other tags.

NOTE Although Listing 1-1’s <title> and


</title> tags are also found in HTML, they
differ from their HTML counterparts. Web
Discovering Diverse Content Through
Random Scribd Documents
every direction were on fire, and a few wretched inhabitants standing
about in the streets with despair and horror marked in their faces.
Kincaid and I went into a house where an old man was seated; he had
been lame in both legs for many years. A French soldier, on leaving
the house, had given him two deep sabre wounds on the head and
another on the arm. This place was a true picture of everything that
was wretched.
I was sent on this morning with a party of the piquet. Found 15th
near the roadside, quantities of ammunition that had been
buried by the French, also a French officer and numbers of men dead;
a deserter from the Brunswickers I took prisoner. The enemy had
retired in the night so as to have a little start of us, as the battalions
engaged yesterday had been too severely handled. At every step this
morning we found sick and dead Frenchmen, gun-carriages, waggons,
baggage; horses, mules, and donkeys abandoned by their masters,
not being able to carry their loads farther, some from frightful sore
backs, others from lameness and starvation. We passed through
Miranda do Corvo in pursuit of the enemy. The town was almost filled
with sick, wounded, and dying men, abandoned to their fate, and
dead. The rascally French had even plundered this place and
committed every sort of wanton atrocity upon the inhabitants, and
then left many of their helpless countrymen for the infuriated
inhabitants to wreak their vengeance upon. Luckily for these poor
wretches, we followed the French so rapidly that they fell into our
hands, and were put in charge of British soldiers, or they would have
been butchered indiscriminately.

Combat of Foz de Aronce

After marching a league from the latter town, we found the enemy's
rear-guard had taken up a position at Foz de Aronce, with their back
to the river Ceira, and the bridge behind them blown up. The
remainder of their army was in position on the other side, having
passed by fording, but in consequence of heavy rains, the river
became so swollen that it was in a few hours impassable. Our gallant
chief observed with his penetrating eye the egregious mistake that the
officer, Marshal Ney, who commanded the French rear-guard, had
made. We were all hungry and tired. I was frying some beef and
anxiously watching the savoury morsel, when an order was given by
Lord Wellington himself to Colonel Beckwith: "Fall in your battalion
and attack the enemy; drive in their skirmishers, and I will turn their
flank with the 3rd and 1st Divisions." The whole Light Division were
smartly engaged. The enemy opposed to the company (Captain
Beckwith's) I was with, were behind a low wall. The approach was
through a pine wood, and the branches were rattling about our ears
from the enemy's bullets. Lieutenant Kincaid got shot through his cap,
which grazed the top of his head. He fell as if a sledge hammer had
hit him. However, he came to himself and soon rallied again.
Lieutenant M'Cullock was shot through the shoulder. The attack
commenced about five in the afternoon and lasted till after dark, the
rain falling abundantly during part of the time. The French fought very
hard, and, some finding resistance to be in vain, threw themselves
upon our generosity, but the greater part rushed into the river, which
was tumbling along in its course most furiously, and there soon found
a watery grave. The enemy so little dreamt of being disturbed this
night that their cooking utensils were left upon their fires for strangers
to enjoy their contents. Such are the chances of war! I was quite
exhausted and tired, and was with about fifteen of the company in the
same state, when we made a great prize. One of the men found a
dozen pots upon a fire, the embers of which were low and caused the
place to escape notice. Here we adjourned, and soon made the fire
burn brightly. We found the different messes most savoury ones, and
complimented the French for their knowledge of making savoury
dishes, and many jokes were passed upon them. The men looked
about and found several knapsacks; they emptied them at the fireside
to see their contents and added to their own kits, shoes and shirts of
better quality than their own. In every packet I observed twenty
biscuits nicely rolled up or deposited in a bag; they were to last each
man so many days, and he must, unless he got anything else, be his
own commissary. We had been very ill-off for some days for bread, so
that some of these proved a great luxury.
16th
At two o'clock this morning the enemy had the arches of the bridge
more effectually blown up. The weather began to clear at daylight. We
saw numbers of the enemy dead in the river, and lying about near the
bushes as the water had left them. It was judged about 700 or 800
had been drowned, and the 39th Regiment lost their Eagles in the
water. A great quantity of baggage must have been destroyed or
thrown into the water, as there were a great many mules and donkeys
close to the river-side, hamstrung in the hind leg. These poor animals
looked so wretched that one could not help feeling for them, and
disgusted us with the barbarous cruelty of the French. To have killed
and put them out of their misery at once would have been far better.
We remained in bivouac.
The Light Division forded the river, a little more than knee- 17th
deep now, which the day before yesterday had caused so
many Frenchmen to wind up all worldly accounts. Bivouacked for the
night in a pine wood after a short march, as, owing to our rapid
advance, it became difficult to get up a sufficient supply of rations for
the army from Lisbon. Some deserters say the enemy has buried
many pieces of cannon. Gun-carriages, ammunition-waggons, and
every material of war is abandoned by the enemy, which makes us
regret that provisions should be the cause of delay in not pursuing
more effectually the great advantages we have already gained. A
deserter informed us that after dark the other night the enemy sent
several battalions down to the river to assist, if possible, the rear-
guard in passing the river, but that they got into confusion and fired
upon each other.
Advanced early this morning to the river Alva, found the bridge 18th
blown up, and the enemy in position on very strong ground at
Ponte de Murcella with some guns in position commanding the
approach to the river. We formed opposite the enemy and had a fine
view of a large body of them. Some nine-pounders were soon got up,
and commenced pounding their columns. I never saw Johnny go off in
such confusion. The cavalry followed for some distance. The Light
Division went into bivouac in the pine woods for the night.
An extract from the General Orders of the Day shows the high
estimation in which our gallant Commander holds the three British
regiments of the Light Division for their services in the field for the last
ten days.
Adjt.-General's Office, Lous̃a,
16th March 1811.
"The Commander of the Forces returns his thanks to the
general and staff officers, officers, and troops for their
excellent conduct in the operations of the last ten days
against the enemy, and he requests the commanding
officers of the 43rd, 52nd, and first battalion 95th (Rifles)
to name a sergeant of each regiment to be recommended
for promotion to an ensigncy as a testimony of the
particular approbation the Commander of the Forces
entertains for the conduct of these regiments.
"E. Pakenham, Deputy Adjt.-General."
A wooden bridge having been thrown across the river during 19th
last night, we passed over this morning and advanced through
Sobreira. A league farther we bivouacked in a wood of pines. The
cavalry followed the enemy's rear-guard, and in crossing a plain took
800 prisoners. One was a Portuguese and aide-de-camp to Loison. He
had a Spanish girl in a Hussar uniform as his companion. This fellow,
on his arrival in Lisbon, will be put to death as a traitor to his country
if he has not better luck than he deserves.
Light Division moved through Galizes and went into bivouac in 20th
a fir grove near Vendas Novas. The French rear-guard was
vigorously pursued by the cavalry and Horse Artillery, who took
numbers of prisoners and stragglers. We found numbers of tumbrils,
carts, waggons, and other articles abandoned by the French.
Occasionally we found Portuguese peasants that had been most
wantonly shot by the enemy.
The Light Division marched on to the fir groves above Maceira 21st
and bivouacked. Two hundred more of the enemy taken by the
cavalry.
Went into houses at Moimenta da Serva in consequence of the 22nd
weather being very bad. Several of the poor people gave us a
melancholy account of the cruelties they had suffered from the
French; and in every village on the line of their march they had
murdered many of the inhabitants in a most savage manner. A priest
in the above village dead, and his body mutilated.
Marched in front of Sampayo and bivouacked in a wood. 23rd

Lodged in the town of Mello. 24th

Bivouacked in a wood. Supposed to be waiting for supplies. 25th

Letter No. XI
Mello (near Celorico), Portugal,
26th March 1811.
My dear Parents—I received the melancholy account of poor John with
sorrow.[19] It is a great misfortune, and under the present
circumstances it is utterly impossible to give him the least support. I
hope by this time you have received more authentic information as to
his situation. It is entirely out of my power to gain any knowledge of
him or be of the slightest use, distant as I am from England. Your plan
will be to make inquiry through the Transport Board, but it is so
entirely out of my way, I cannot advise you how to act with certainty.
In a mercantile place like Hull you will find numbers very well
acquainted with the business. If it would be possible to remit him
money occasionally, it would be the best way of serving him. It would
be cruel of me to say anything further regarding my displeasure when
I heard of him binding himself in so low a capacity; it is done, and the
result has proved truly unfortunate. We cannot foresee evils, but we
should endeavour to prevent them. If he had been a soldier, or a
sailor in a King's ship, he would, though a prisoner, have had some
little liberty, but in his situation he will not be noticed, but mix with
men of all descriptions. I endeavour to look upon his unfortunate
situation in the best manner possible. I flatter myself an exchange of
prisoners may take place before long. I hope his constitution is good.
He may possibly make his escape, though when once safe in France, it
is unlikely. I sometimes fancy he may get away after recovering from
the wounds he received, being near the coast. If he is enterprising, I
think he may have several chances; but, poor fellow, his youth may
make him careless. I wish I had the chance of attacking the escort
that guards him on the road. I think you would then soon have a
favourable account of him. Give me all the information you can about
him in your next.
I joined my regiment at Valle on the 22nd of February, the place I left
them at, my health quite restored and my thigh much better. I heard
of Maud's regiment being on the other side of the Tagus in good
quarters; it induced me to go. He was delighted to see me. He
regretted much the account of poor John. I dined with him, and
stayed until late the day following. Before I left his quarters he gave
me an excellent dinner and plenty of good wine. I was much pleased
with his manner of living, having a good stock of useful and necessary
things, a canteen with knives, forks, plates, etc.—in short, everything
useful, with a donkey to carry them. He is very steady, and has saved
money. I paid him some very high compliments on his conduct. He is
taller than I, and I assure you a very handsome, stout fellow. I told
him about the little trinkets I had sent Ann from Lisbon, which, by the
bye, I hope have arrived safe; acquaint me regarding them in your
next. He means to make Ann some presents when he returns. The
officers of his regiment behaved very politely, and invited me to spend
some days, but that was impossible. My brother came a little way with
me, and with regret we parted. We continued at Valle within pistol-
shot of the enemy's sentries until 6th March. At daybreak we found
the enemy had left this strong position and withdrawn his piquets. Our
Division directly followed. The French went off in the night, consisting
of the rear-guard of 12,000 men. They had been for some days taking
sick and baggage to the rear and heavy cannon also. We passed
through the fine town of Santarem, which was dreadfully sacked. I
was in the town when full of people and wealth; this sight hurt my
feelings much. A few half-starved miserable wretches came to cheer
us, nearly dead with hunger. I looked for the house I was once billeted
upon, but, alas! only the bare walls remained. The unfortunate owner
was a fine liberal old man, and treated me very kindly. I made some
inquiries, but could hear nothing. We halted for the night in a village.
At daybreak we followed the French, and passed through several
towns on fire. We did not come up with them. This night was on
outlying piquet. A little cottage by the roadside struck my fancy. I took
up my abode in order to have my pound of meat cooked and to be
sheltered, being rainy. The woman of the house welcomed me in and
offered me her chair. She had four children lying near her literally
starving. The French had robbed her of everything worth taking.
Some of the soldiers cut her with their swords for endeavouring to
stop them from taking away her daughter, and one villain had the
meanness to return to the house and tell her, "Your children are
starving; if you will give two dollars for this loaf, you shall have it."
She went where the last of her money was secreted; he watched her,
and took the money, abused her, and walked off. The poor creature
and her children appeared so wretched; she was continually praying
the English would revenge her wrongs. I did what I could to console
her, and gave them some of my little stock of provisions, which,
circumstanced as we are, we must, from real necessity, be very
careful of, as the towns are all left by the inhabitants.
It is beyond everything horrid the way these European savages have
treated the unfortunate Portuguese. Almost every man they get hold
of they murder. The women they use too brutally for me to describe.
They even cut the throats of infants. The towns are mostly on fire—in
short, they are guilty of every species of cruelty. I have seen such
sights as have made me shudder with horror, and which I really could
not have believed unless an eye-witness of them. It is needless for me
to enter into particulars, as I could fill a volume with their barbarities.
We continued marching, daily taking French sick and stragglers. If
they fell by any chance into the hands of the Portuguese, they either
dashed their brains out or stabbed them without ceremony. From the
Portuguese they certainly deserve no quarter, for they give none.
On the 9th, one company of us had some little skirmishing. The
Hussars and the 16th Light Dragoons, amounting to two troops,
charged double the number of French; killed and wounded fifteen and
took ten horses.
On the 11th we followed the enemy; two companies of ours drove
them from the woods; the enemy halted at Pombal, and occupied the
heights and castle. After some sharp fighting the enemy were driven
from their position, on the 3rd Caçadores (pronounced Cassadores)
coming up. One officer wounded and several men.
On the 12th we passed through several towns on fire; about eleven
o'clock a.m. we came up with the French, and found them posted upon
some heights in great force, both cavalry and infantry. On their right
and left were woods filled with sharp-shooters. Our columns moved
up and our regiment, the 43rd, 52nd, and Portuguese Light Infantry,
amounting to 5000, extended to the distance of three miles. The
order was given, and we filled the woods. The French threw numbers
of shot and shells, which only killed a few men. The woods were of fir-
trees and upon the sides of steep hills; as soon as we gained the top,
the French gave us a volley. It was of no consequence; our Boys
would not be stopped. The French, finding they could not stop us,
retired in the greatest confusion through the town of Redinha, which
was on fire. We kept at their heels, and the town was filled with our
men in a moment. We plied the enemy so hard that numbers threw
away their arms, and upwards of fifty fell over the bridge and were
drowned. A party of my men were blazing away at the rascals; one
espied an officer endeavouring to get through the water; he jumped
in and brought him out by the neck. He gave the soldier thirty-six
doubloons and a medal dedicated to the Legion of Honour. The soldier
gave me the medal. I should have returned it to the officer, but having
something of a more serious nature to mind, I afterwards had not an
opportunity. Halted for the night in a wood.
No fighting of consequence on the 13th.
On the 14th we drove in the enemy's piquets at daylight. Our whole
Division was engaged. Lieutenant Strode of the same company was
badly wounded in the thigh, and Major Stewart mortally wounded. We
continued fighting until three o'clock p.m. Strode when he fell called to
me to take his rifle, exclaiming, "This, Simmons, may be of service." I
had no time to stand on ceremony, but moved on. The French were
driven back on all sides, and very glad to give over fighting.
A very good town near where we halted was on fire, and numbers of
the inhabitants murdered.
At daybreak on the 15th found the enemy were gone. We immediately
followed, and came up with them at half-past four o'clock p.m.
occupying a very strong position and in great force. We began to build
huts about a mile from them and cook our breakfast, dinner, and
supper all at once; soldiers eat when they can. However, we were
disappointed, an order coming from Lord Wellington for an immediate
attack. Every man to his post, and in ten minutes exposed to a heavy
fire of shot, shells, and musketry. In passing the plain to get at the
enemy in the wood, I was for the moment startled; a musket ball
struck my rifle (Strode's), and shattered the butt to pieces, which
luckily saved my right thigh. I laughed and pushed on.
We here had some very hard fighting, having twelve French battalions
opposed to us. Our men and the Portuguese went in skirmishing order
up to their line. The French fired volleys. Their officers behaved very
gallantly. Just at dark the enemy were beaten back in all directions,
and as caution is necessary, we gave up the pursuit. This fight took
place near, and in, the village of Foz de Aronce. Above 500 of the
enemy were driven into the river and drowned, numbers killed and
wounded, nearly 300 mules and asses killed for fear of falling into our
hands. We quartered ourselves in the French camp; they left us good
fires. I roasted some pork which the French left, and had plenty of
biscuit, took a glass of grog and a pipe, and talked over the business
of the day with my brother-officers. Very happy to find I had a whole
skin, which was more than I expected; rolled myself in my cloak, lay
by the fire, and slept as well as I could wish.
In the whole of these affairs we have had one major killed, a very fine
gallant soldier, and six lieutenants wounded; I cannot say how many
men. The Gazette will give a more circumstantial account. The 43rd
and 52nd have also suffered severely. Some light companies of other
regiments were with us. The Portuguese deserve every praise; they
fight like lions. We have paid off the French for old scores, and also
taught them what they must expect to meet with if ever they dare to
invade our happy country. As for my gallant countrymen, I cannot say
too much for them; proud I am indeed to be worthy the name of a
Briton. I have confidence and pleasure in feeling I have done my duty
under all the privations I have laboured under, and at a time when
hardly recovered from a very bad illness. I have great reason to thank
the Almighty for His merciful goodness to me, and for my preservation
hitherto. I hope it is for a good purpose. I must own it would grieve
me to leave you under your present circumstances. I yet flatter myself
some day or other I shall have it in my power to show some mark of
my affection to the best of parents; if not: God's will be done. My last
words will be prayers for the welfare of those dearer to me than life.
I have seen a letter from Cadiz. I find the rascally Spaniards have
deceived General Graham, but the English alone gave the French a
terrible beating. Our regiment had one lieutenant-colonel wounded,
one captain killed, and four lieutenants wounded. Our regiment gets
terribly cut up. We think nothing of it. Every man glories in doing his
duty, and those that survive must be promoted.
The French said they would drive us into the sea, but Lord Wellington,
the finest General in the British service, has, from his penetration,
starved and nearly driven them back out of Portugal. We are at
Celorico, only six leagues from the frontiers of Spain, and in a few
days I shall once more see Almeida. I hope not to be so unlucky as
before. If we can bring the French to a general action, you will have a
fine account of the result. I hope it will be the case in a few days. Our
men have got quantities of money and plunder from the French. In
the whole business we have taken 1500 prisoners. I cannot ascertain
how many were drowned in the two rivers, but the last business was a
glorious one for us. The river appeared covered with bodies of fine
handsome fellows. We march in the morning, but the enemy seem to
wish to be off and have no more to do with us.—I am, your
affectionate son,
Geo. Simmons, Lt., 95th Regmt.
Joseph, I hope, is at school; Charles and Betsy also. My love to my
dear Ann. She must endeavour to spell better. Always let me see some
of her writing. Joseph may as well likewise give me a specimen.
When I am richer I shall send some things of more value to Ann. The
snuff-box, I hope, will please my dear mother. Be particular in stating
when you write, which must be on receipt of this, whether the trinkets
have safely arrived. I have no doubts upon the subject, as the officer I
entrusted them to is a particular friend. You must excuse omissions in
this letter, as I had only a little time to give you this account, and that
after a hard day's march, when I ought to have been sleeping instead
of writing.
CHAPTER VII
Journal—16th March-25th May 1811
rench dislodged from Freixeda and their baking operations stopped—
Death of Lieutenant James Stewart (Brigade-Major)—Dreadful
murder of a Spanish woman by the French—Action of Sabugal—
Desperate fighting—Lieutenant Arbuthnot killed—Advance resumed
—The Spanish frontier crossed—The Light Division takes up the old
line of outposts on the Agueda—Reconnaissances of Almeida, held
by the French—Defence of the bridge of Marialba—The French
driven off—Lord Wellington rejoins the army—The Royal Dragoons
and 14th Light Dragoons hold the advanced posts—The French
occupy Gallegos—The Light Division falls back—Marshal Massena
concentrates a strong force in front of Fuentes de Oñoro—The
British army forms up behind the town—Combats at Fuentes de
Oñoro—Battle of Fuentes de Oñoro—The Chasseurs Britanniques
repulse a charge of French cavalry—Successful charge by British
cavalry under General Stewart—The French occupy the village, but
on debouching are charged by the 74th and 88th Regiments and
driven back—Bivouac on the battlefield—French and English
outposts in touch—General Brenier evacuates Almeida, blowing up
his magazines and destroying his guns—Marshal Beresford invests
Badajoz—News of the battle of Albuera (the only general action in
the Peninsular War in which some of the Rifles were not present).
Letter No. XII
To his Parents from Espeja, dated 18th May 1811
raphic account of the action near Sabugal—A running fight for two
miles—The 43rd Light Infantry and Portuguese Caçadores support
the Rifles—The skirmishers suddenly come upon the French posted
in strength, and have to fall back—Colonel Beckwith's coolness in
action—Picton's Division arrives—Gallantry of the French officers—
The French retire—Skirmishing about Almeida—The fighting prior to
the battle of Fuentes de Oñoro—The inhabitants of the town
ordered to clear out—Battle of Fuentes de Oñoro—Losses of the
Rifles—Exceptional amount of fighting which fell to them—Anxiety
as to the welfare of his family—Scarcity of food and clothing—A
brown "Green jacket"—Wants a good "spy-glass."

Journal—26th March-25th May 1811


Marched to Celorico. The enemy evacuated it 1811 March 26th
yesterday, and had an officer and thirty men taken by
our cavalry.
The Division remained in bivouac. 27th

The Light Division (with the exception of the right wing 95th) 28th
crossed the Mondego and occupied the villages of Baraca and
Minhoeal. That wing made a forced march to Alverca da Beira, where
the cavalry had their outposts. A party of Rifles (100), under the
command of Captain Beckwith, was sent to dislodge a body of the
enemy from a mill in the front of Freixeda, at which mill, Johnny was
busily employed grinding flour, and another body of the enemy was
baking it in the town. The enemy were driven from the mill, and
twenty prisoners captured, but we had to regret the loss of a gallant
fellow in Brigade-Major Stewart, who was killed on incautiously
entering the town, some French soldiers firing at him quite close, from
a window. I was requested to examine his wound by Colonel
Beckwith, and report how he came by his death, as his head was
deeply cut in the forehead and it was feared by some that when
wounded he had been deliberately murdered. I gave my opinion that
from a musket ball having entered his left breast, and passed through
his heart as he rode forward, he had instantly fallen upon his head.
The place he was riding over being granite rocks, and he being a
heavy man, the fall had scarred his head as it then appeared. My
supposition satisfied every one.
Before day we deposited poor Stewart in his last worldly 29th
tenement, wrapped in his cloak, near the village, and then
moved forward towards Guarda after the enemy, the 3rd and 6th
Divisions co-operating. We expected to have had warm work, but on
perceiving us move to attack in the direction of Sabugal, Johnny
moved off in the greatest possible hurry, followed up by cavalry and
Horse Artillery, who took near 200 prisoners.
The 3rd Division occupied Guarda, and saved the church, as well as
many houses, from being burnt. The doors of the church were on fire.
In a village in the front of Guarda, named Carapeta, I saw a woman
laid in the street near her own door, murdered. The ruffians had
placed upon her bosom a huge piece of granite taken from the market
cross, so heavy that it took me and six men to remove it. The blood
was running from her ears and mouth. Her dress upwards was most
respectable, but her lower habiliments had been dragged off her. A
peasant informed me that she was the wife of the juiz de fore of the
village (that is the Mayor). The Division occupied all the villages at the
foot of the high hill that Guarda stands upon. I was quartered in
Carapeta. I visited Guarda, which stands very high and upon a ridge
named the Sierra de Carapeta, connected with the Estrella mountains,
and is the most elevated town in Portugal, and also very ancient, with
a castle, and encircled by a dilapidated Moorish wall. The cathedral is
very ancient and the church superbly finished. The organ must, from
its large size, have produced a great musical effect. The church had
been converted into a stable and the organ sadly cut and hacked
about in the most wanton manner (by Catholics).
Marched to Pega, where we halted an hour. Very rainy. 1811 April 1st
Moved forward to Quintas de San Bartolomé, near the
Coa and opposite Sabugal, where the enemy was in great force. A
most dreadful night and very close. On piquet, with orders never to
quit the post, in case the enemy attacked me during the night, and to
be very vigilant indeed.
Went into quarters at a village. 2nd

Action of Sabugal

3rd
Colonel Beckwith's Brigade crossed the river Coa; the sides steep; the
95th led. It was deep and came up to my arm-pits. The officer
commanding the French piquet ordered his men to fire a few shots
and retire. On getting footing, we moved up in skirmishing order and
followed in the track of the piquet. We were met by a regiment, and
kept skirmishing until the rest of the Brigade came up, when we
pushed the enemy through some fine groves of large chestnut-trees
upon the main body (Regnier's Corps or 2nd). Two guns opened on us
and fired several discharges of round and grape. The guns were
repeatedly charged, but the enemy were so strong that we were
obliged to retire a little. Three columns of the enemy moved forward
with drums beating and the officers dancing like madmen with their
hats frequently hoisted upon their swords. Our men kept up a terrible
fire. They went back a little, and we followed. This was done several
times, when we were reinforced by the other Brigades, and the guns
were taken. But from the enemy's numbers being very much superior,
the combat was kept up very warmly until General Picton's (3rd)
Division came up and pushed out its Light companies on their flank,
the 5th Regiment forming a line in support. The 5th Division, under
General Dunlop, soon crossed at this bridge and passed through
Sabugal. The enemy gave way and went off in confusion; the rain now
fell in torrents and materially assisted their retreat. Our cavalry was
unluckily too distant to take advantage of the loose manner in which
they moved off. The Light Division was put into the town for the night,
as a compliment for its conduct on this day, and the remainder of the
army in bivouac. Lieutenant Arbuthnot was killed, Lieutenant Haggup
wounded, Colonel Beckwith wounded and his horse shot. Lieutenant
Kincaid and I, with our baggage, were provided with a dilapidated
habitation. We had very little to eat, but were sheltered from the
pelting rain. In one corner of the place several miserable human
beings were huddled together, nearly starved to death. I gave a poor
little child some of my bread, but then all the wretched creatures
began to beg from me. I could not assist them, not having enough to
satisfy the cravings of a hungry stomach, and being aware of another
rapid march awaiting me, and more exertions and dangers to
encounter before we could put the French over the frontiers of
Portugal; and as Sancho says, "It is the belly that keeps up the heart,
not the heart the belly."
The Light Division marched to Quadrazaes and Val d'Espinho, 4th
formed a junction with the 3rd Division, and passed through
Alfayates, where the latter halted. We moved forward to the frontier
village of Forcalhos.
Marched to Albergueria. Once more upon Spanish ground, and 5th
now able to get something more comfortable to eat and a
good mattress to sleep upon.
The enemy retired across the Agueda, leaving a garrison of 6th
1000 men in Almeida under General Brenier.
The 2nd Battalion 52nd joined from England on the march 7th
from Ponte de Murcella, and were put into Colonel
Drummond's Brigade. Remained in quarters.
Marched into Fuentes de Oñoro. 8th

The Light Division took up the old line of outpost upon the 9th
Agueda, occupying the villages of Gallegos, Espeja, and
Fuentes de Oñoro, and forming the line of advanced posts to the Duas
Casas, the fortress of Almeida being now blockaded by the British and
Portuguese.
Captain Cameron, Lieutenants Cox, Coxen, and myself went 10th
with 150 Rifle Men to San Pedro, near Almeida.
Before day, marched close to the town with a company of the 11th
2nd Battalion 52nd, under Captain Snodgrass, who supported
us. Several cannon shot were fired from the town at us. We
succeeded in making the garrison take within its walls several bullocks
and sheep that were feeding under the range of their guns. When it
became dusk we returned to San Pedro.
Marched to near Almeida and attacked the party that were 12th
guarding the cattle. The cattle were taken into the town. The
enemy fired some heavy guns repeatedly at us. Sergeant M'Donald
was killed. Continued watching near the town amongst the rocks, but
the cattle were kept within the gates. Returned at dusk for the night
to San Pedro.
Returned to Almeida, fired at the cattle, made the enemy take 13th
them within the walls. This was a very unpleasant service,
attended with more risk than profit. If we had been able to obtain a
sirloin of beef occasionally it would have been well enough.
Went as usual to Almeida. 14th

Returned to Fuentes de Oñoro and joined my company, as the 15th


detachment belonged to several companies. Two complete
companies marched to Malpartida to perform this daily service.
Marched to Molino dos Flores and found the Light Division 16th
upon the heights, expecting to move forward to intercept a
convoy on the road from Salamanca to Ciudad Rodrigo, but did not
effect our purpose and returned to quarters. Some of our cavalry got
between 300 French infantry and the town; the enemy took shelter in
an old ruin; the party was asked to surrender, but refused. The officer
should have immediately sent for some infantry, but he waited too
long before he decided upon it, and a body of French came from
Ciudad Rodrigo to release them. Heavy firing of cannon and small
arms at Almeida. Lord Wellington left us to visit the Corps in Alentejo.
Two battalions of French infantry and a squadron of cavalry 22nd
came by Carpio to the heights above Marialba, on the Azava,
where they halted, and sent a party forward to attack the 52nd
piquet, stationed at the bridge. The pass was disputed with spirit, and
soon after another company, with some of the 95th Rifles, came to
their assistance, and the enemy were compelled to retire. The enemy
moved away in the direction of Ciudad Rodrigo.
Some piquets that the enemy had outside Almeida were driven in,
which caused the firing mentioned.
The 6th Division is stationed before Almeida under General 24th
Campbell; it is now most rigorously blockaded. Sir Stapleton
Cotton has arrived from England, and is appointed to command the
whole line of outposts. Sir B. Spencer commands the army in the
absence of Lord Wellington.
Colonel Beckwith's Brigade occupied the villages of Sexmiro, 26th
Barquilla, and Villar del Puerco, which are near each other and
to the left of Gallegos.
Marched early in the morning to Almeida, and then went to 27th
the rear of Gallegos, where our Brigade was assembled.
Colonel Drummond's Brigade was now assembled in front of this
place. The piquets exchanged a few shots with the enemy. We were
informed by deserters that Marshal Massena had arrived at Ciudad
Rodrigo, and that the French army was concentrating its force in the
neighbourhood for the purpose of relieving Almeida.
Lord Wellington returned to the army. The Royal Dragoons and 28th
14th came to the advanced posts and entered Sexmiro,
Barquilla, and Villar del Puerco. A sortie was made by the garrison of
Almeida, but effected nothing of consequence; a sergeant and three
soldiers were made prisoners.
Marched to Sexmiro, as a strong piquet of French infantry was 30th
placed at the ford over the Agueda not far from it.
Six squadrons of cavalry and a column of French infantry made their
appearance about noon on the heights of Carpio and Marialba, and
withdrew after remaining some hours.
The 3rd Battalion 1st Foot marched to Almeida to support the Light
Division. The outpost at Sexmiro was confided to the cavalry.
Marched to Almeida. Marched to Espeja and joined the 1811 May 1st
Brigade. The enemy in force; cavalry, infantry, and
guns moved forward a little after daybreak upon Gallegos and Espeja.
Colonel Drummond's Brigade joined ours. The Light Division retired
before the enemy about three miles and formed column of regiments
in a very extensive wood. The British cavalry were drawn up in a plain
to our front. It was occupied by them for the night. Bivouacked.
2nd
Yesterday the French army had concentrated in our vicinity ready to
advance, and having a large force of cavalry (far more numerous than
ours), we retired, without firing a shot, through the village of Fuentes
de Oñoro, and found the British and Portuguese troops in position,
with the Duas Casas River in our front, the right of the army resting
upon a Portuguese village—Nava de Avel. Don Julian with his
guerrillas, horse and foot, and some light guns, were also there for
the purpose of acting upon the enemy's flank. Our centre was behind
Fuentes de Oñoro, and parallel with it (our position being much
higher), our left being upon Fort Concepçion and Aldea de Obispo,
which was four miles in front of Almeida. We overlooked the villages
and adjacent country, where we observed the enemy moving into
position and advancing towards us along the same tracks we had a
few hours before been passing over. It was obvious that Marshal
Massena had concentrated this large army either to attempt to carry
off the garrison of Almeida, or to throw succour into it. Lord
Wellington was determined to prevent him, and placed his army as I
have described. About mid-day the enemy's light troops, supported by
columns of infantry, entered the village, and were met by Light
companies of the 3rd Division, and those of Generals Nightingale's and
Howard's Brigades and the King's German Legion, supported by the
83rd Regiment (2nd Battalion). The village being built of granite, and
the walls intersecting it in every direction of the same material, the
contest became amusing and lively, and was supported on both sides
with great bravery. A very heavy column now entered and was
carrying all before it, when the 24th, 71st, and 79th Regiments were
thrown into the village, and checked its advance. At daybreak the
firing ceased on both sides. The Light companies and the 83rd were
withdrawn, leaving the 71st and 79th supported by the 24th.
The Light Division was kept in reserve the greater part of the 3rd
day directly behind Fuentes de Oñoro, and a line of the 3rd
Division was formed ready to enter into the spirit of any attack made
in this quarter, which, being the key to our position, in all probability
would be assailed with the most vigour. The Light Division towards
evening moved to the left, as the enemy appeared in great force in
that part of our line. A brisk cannonade was kept up by the French
during the whole of the day, although they had gained no advantage,
but lost a great number of men in Fuentes de Oñoro.
The enemy's General made a reconnaissance of our position. 4th
Smart fighting in Fuentes de Oñoro.
Major-General Craufurd assumed the command of the Light Division,
having joined from England. Towards evening the Light Division
moved in the rear of the centre to support it in case of an attack,
being the key to our position.

Battle of Fuentes de Oñoro

This morning we observed the enemy had concentrated a 5th


large force of all arms in the vicinity of Fuentes de Oñoro. The
Light Division was moved to the right and also some distance to its
front, and entered a large wood, throwing out skirmishers to our
front, as it was expected from the enemy's manœuvres that a large
force was concentrating there under cover, for the purpose of making
a sudden attack upon the right of our line. Their skirmishers kept up a
fire, but did not attempt to drive us out until a large body of their
cavalry had debouched some distance to our right and when clear of
the wood, wheeled to their right, so as to intercept our retrograde
movement. The enemy's skirmishers then followed us up, keeping up
a smart fire until we left the wood and formed column at quarter-
distance ready to form square at any moment if charged by cavalry,
and in this way we marched to that part of the position where the
Guards were formed in line. A body of cavalry hovered about us, but
from our formidable appearance and the steady manner with which
the movement was conducted, the enemy did not charge us. A
company of Guards wheeled back, their battalion being in line; we
passed through and then halted in column and became a support to
that part of our line. The 7th Division was on the right of our line. A
heavy column of French cavalry moved upon Nava de Avel as well as
infantry, and Don Julian, with his guerrillas, horse and foot, retired
before them. The French columns were passing from the wood
towards the right in large bodies, which made it obvious what were
the intentions of the enemy. Our illustrious Chief, having the eye of an
eagle, in an instant penetrated through the designs of Massena and
ordered the 7th Division to refuse its right, which was effected so well
that the enemy gained no advantage. The Chasseurs Britanniques, a
regiment in our service in the 7th Division, principally composed of
renegade Frenchmen, was charged by a body of the enemy's cavalry
in line, and repulsed them in good style. "When Greek meets Greek
then comes the tug of war." We were highly amused at this rencontre.
Some squadrons of ours, headed by General Stewart, attacked a large
body of French cavalry and hacked their way through it, bringing off a
colonel of Dragoons and several men, besides leaving a number hors
de combat. The enemy passed the Duas Casas at Paya Velha ford, and
occupied the place where part of the 7th Division had retired from, in
consequence of the right of the army being thrown back. Five
companies of Rifle Men occupied some rugged ground through which
the Turon pursued its course, on the right of the 1st Division, and
between it and the 7th. The enemy attempted to penetrate this valley,
but were kept in check by our men and some Light companies of the
1st Division. The left of the 7th Division rested upon the Turon, and its
right towards the Coa, covering the road to Almeida. The 5th Division
was stationed at Fort Concepçion and Aldea de Obispo. General Park's
Portuguese Brigade and 2nd Regiment blockaded Almeida. A company
of the Guards, who did not get out of the wood at the time we retired
(from mistake, I suppose), were sharply attacked, and Colonel Hill,
who commanded, was taken prisoner as well as several men, and
some killed. The enemy's guns kept up a very heavy cannonade upon
our line. Our heavy artillery was drawn up in front of the 1st Division,
and kept up a well-directed fire upon the enemy's guns and silenced
several. As our men were lying down in column just behind the line of
the 1st Division, ready to be slipped at anything that might be thought
necessary, a body of French cavalry menaced a charge upon our guns
and came up in the boldest manner, receiving repeated discharges of
grape-shot, that literally made lanes through them. Finding it of no
use, the cavalry moved off. The enemy, not being able to make any
impression upon our right, attacked the village of Fuentes de Oñoro
with great vigour, continually bringing up more men to the assistance
of those engaged. The 24th, 71st, and 79th defended the upper parts
of the village with great resolution, and repeatedly repulsed the
different attacks. The enemy ultimately arrived at the head of the
village by the principal road, and were beginning to make a formation
upon the plain opposite our line, when the head of their column was
repulsed in grand style by the 74th and 88th Regiments. They were
led by Colonel Pakenham, D.A.G., a most able soldier.[20] The place
was covered with dead, and a number of officers who had led the
head of this imposing column were killed. No further operations of
importance occurred during the day. The Light troops on both sides
kept up a continual tiralade from behind the village walls, and many
gallant little affairs took place by individuals that were known only to
those who were principals on that occasion. Night put a stop to
further havoc, and the British soldiers rested upon the field of battle,
with that proud feeling which a man only can have under such
circumstances—of having fulfilled his duty to his country by repulsing
a much larger force of cavalry and infantry at all points, and that
under one of the enemy's most able generals, Marshal Massena,
Prince of Essling, the "spoiled child of Fortune" (for so Massena was
designated by the French Emperor). The Light Division relieved the
piquets. I was on piquet in the lower part of the village, near a little
stream of water which passed through part of the town. The enemy
had a captain's piquet on the opposite side of the little rill, and a
heavy column of infantry was formed behind a small church, either
waiting for orders or fearing an attack. We gave some badly-wounded
Frenchmen to the piquet, and the officer allowed some of ours to be
given up. A French officer said to me, "This place is appropriately
named the Fountain of Honour; God knows how many of our friends
on both sides have drunk deep of its waters, and with to-morrow's
dawn most likely many more will do so." My only reply to this was,
"The fortune of war will decide that, and we are ready to try its
chances when our illustrious chief gives the order to advance." The
remainder of the night was occupied in knocking down many an
honest man's garden wall and making a strong breast-work to fire
over as soon as the day dawned. Only a few random shots were fired
during the night. Before day every man stood to his arms and
carefully watched its dawning.
The enemy we found, when visible, to be not inclined to fight 6th
us; they had been busily occupied in getting their wounded
and heavy guns away to the rear, as well as all incumbrances, in order
to be able, if pressed, to make a clean start and be off. Relieved from
piquet.
Remained as yesterday. Went on piquet in the village in the 7th
evening.
Relieved as before by the 2nd Brigade, Light Division. The 8th
weather very warm, and great numbers of dead, all stripped
naked, were spread in every direction and swollen in a disgusting
manner from putrefaction, and exhaling most offensive smells. Such is
the general result of a hard-fought battle when the dead are not
buried.
On piquet. 9th

At daybreak found the enemy had moved off and only left a 10th
small cavalry piquet here and there along the line of posts
they had before so strongly occupied as a rear-guard. Our columns
were soon moving forward and the French withdrawing to join a very
strong body of cavalry, which kept ours in check and prevented us
from taking many prisoners. The Light Division went into quarters
again at Gallegos and Espeja. This night the garrison of Almeida under
General Brenier, after mining the works and fixing the loaded cannon
muzzle to muzzle and having the trains laid to fire them, left the town
and passed over the very bodies of the blockaders in a close column.
The pickets followed and fired upon them, the French now and then
firing a few shots, but making the best of their way to Barba del
Puerco, where they arrived at daylight, and were attacked by some of
the 4th and 36th Regiments in winding through the intricate passes
over the Agueda. In the eagerness of pursuit the 36th Light company
passed the bridge and went too far, and a body of French from San
Felices moved to assist their comrades and beat back the Light
company with loss. Colonel Cochrane, who commanded the regiment
on that occasion, was very much annoyed at some remarks afterwards
made. Brenier's mines exploded most effectually, and the guns also
were split in pieces; in fact, altogether it was a most masterly
movement. Colonel Bevan was too late at Barba del Puerco with his
regiment, owing to Sir W. Erskine, by accident, not sending him an
order in time. Poor Bevan was censured by Lord Wellington, which
circumstance preyed so much upon his mind, knowing that he had
done his duty, that he blew his brains out. The order alluded to was
sent from the headquarters by Lord Wellington's direction, and Sir
William Erskine forgot to forward it, and literally after the business
was over found the document in his pocket. What trifles some men's
fate hangs upon!
A Brigade of French Dragoons moved forward to the heights of 12th
Carpio this morning. Our cavalry piquets retired towards
Espeja, followed by a squadron. The 1st Brigade, Light Division,
moved in front of the town, and skirmishers (Rifle Men) fired upon the
French. They retreated, and our cavalry reoccupied their post at
Carpio, beyond the Azava.
Lord Wellington left the headquarters at Valermosa and went 16th
to visit Marshal Beresford, who had commenced the siege of
Badajoz.
Accounts of a sanguinary battle having been fought there on May 16th
arrived. Marshal Beresford had marched from before Badajoz to
Albuera, where he encountered, with the British, Portuguese, and two
Divisions of Spaniards, under Blake and Castaños, the French army,
commanded by Marshal Soult, and eventually, after sustaining
repeated attacks, drove it back. On the night of the 17th the French
moved off, and Badajoz was again invested on the 19th. My brother
Maud, Lieutenant, 34th Regiment, commanded a company, his captain
being killed early in the action.

Letter No. XII


Espeja, Spain, 18th May 1811.
My dear Parents—This very wet morning, being disengaged, I feel great
pleasure through the medium of this sheet to impart my adventures
since I last wrote from Celorico on 26th March, which I am well aware
will be gladly received by my dear mother when she finds her son has
always had the good-fortune to be engaged in every affair with his
regiment against the enemy. After halting one day at Celorico, we
marched towards the Coa, first driving the French from the strong
position at Guarda. In a skirmish at Freixeda we lost a valuable officer,
shot from a window. Our men were so enraged at the circumstance as
to be with difficulty prevented killing some rascals we took. The Light
Division moved near Sabugal on the 2nd of April—a very bad day. I
was with half our company on piquet, our sentries within pistol shot of
the enemy, and being a very rainy and stormy night, it was necessary
to be much upon the alert for fear of surprise. By the bye, the enemy
have been so severely handled in five or six attempts to surprise
piquets of the Light Division in the night as to make them very
cautious how they attempt such manœuvres. I smoked my pipe to
keep me warm, and had an immense wood fire, round which our lads
sat joking and passing the night with the greatest cheerfulness.
Early the next morning the piquets were called in, and Lieutenant-
Colonel Beckwith's Brigade ordered to cross the river and attack the
enemy. The river was rapid and at the ford took me to the waist. I
fully expected the enemy would have greeted our approach with
grape-shot and shells, but they suffered us to pass unmolested. As
soon as the Rifle Men crossed, they extended and moved up the steep
hills, covered with mountain heath and brushwood. On approaching
the summit of the first chain of heights, the enemy commenced
skirmishing. By this time the 43rd Light Infantry and Caçadores had
joined us. The enemy were driven from one chain of hills to another
for two miles, when suddenly, on gaining the top of a third chain of
hills, our whole line in skirmishing order came in contact with seven
columns of French.
The company I was leading on pounced upon a column, and, owing to
the situation of the ground, came literally within twenty yards of it
before we could see it. Guess my astonishment! The most hideous
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like