Skip to content

Commit aacab19

Browse files
authored
Formatting corrections
1 parent 41efa44 commit aacab19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# XMLReaderReg
22
An extension of PHP's XMLReader to include a simplified interface.
33

4-
### Quick Start
4+
## Quick Start
55

66
Rather than having to use boiler plate code to fetch particular elements, XMLReaderReg allows you to register an interest in certain elements along with a callback. This effectively changes it from a pull parser to a push parser.
77

@@ -29,7 +29,7 @@ $reader->close();
2929

3030
The main addition is the `process()` method, rather than looping through the document structure, `process()` is passed an array of regex and associated callback elements. When a particular XML element matches the pattern you are interested in the callback will be passed the data from that element.
3131

32-
#How the document hierarchy is encoded
32+
## How the document hierarchy is encoded
3333
As the document is loaded, the code builds a simple document hierarchy based on the nesting of the elements. So...
3434

3535
```xml
@@ -81,7 +81,7 @@ will produce the following tree...
8181
/root/firstname[1]
8282
```
8383

84-
### Regex matching
84+
## Regex matching
8585
The matching process is as simple as working out where the data you want lies in the document. You can be as explicit or as vague as you wish using regex's ability to match the content of the above hierarchy.
8686

8787
From the quick start sample code...
@@ -98,7 +98,7 @@ will find any `<person>` element and allow an optional suffix for use when multi
9898

9999
Also something useful in regex's is capture groups, notice that this last regex is actually `(.*/person(?:\[\d*\])?)` in the code. The capture groups will be passed to the callback.
100100

101-
#The callback function
101+
## The callback function
102102
The basic callback function definition is
103103

104104
```
@@ -152,7 +152,7 @@ When using DOMDocument, the owner of a created node can be important. If you wa
152152

153153
If this is not called, all nodes will be owned by an internally created document.
154154

155-
#Namespace usage - Matching
155+
### Namespace usage - Matching
156156

157157
```php
158158
public function setUseNamespaces ( bool $useNamespaces ): void;

0 commit comments

Comments
 (0)