Skip to content

Commit 44d9568

Browse files
authored
Formatting corrections
1 parent 9ab8a90 commit 44d9568

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### XMLReaderReg
1+
# 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

@@ -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...
@@ -101,7 +101,7 @@ Also something useful in regex's is capture groups, notice that this last regex
101101
#The callback function
102102
The basic callback function definition is
103103

104-
```php
104+
```
105105
function (mixed $data[, mixed $path]): void {}
106106
```
107107

@@ -141,9 +141,9 @@ The capture group(s) from the regex.
141141

142142
If you don't use capture groups, you can omit the `$path` parameter. If you do use capture groups, then it will pass an array which is the return value of `$matches` from [preg_match()](https://www.php.net/manual/en/function.preg-match.php) which is used internally to check the path against the regex patterns.
143143

144-
##Options
144+
## Options
145145

146-
#DOM Document owner
146+
### DOM Document owner
147147

148148
```php
149149
public function setDocument ( DOMDocument $doc ): void;
@@ -178,7 +178,7 @@ set to `false`, it will generate a path hierarchy of
178178
/root
179179
/root/person
180180
```
181-
#Namespace usage - Output
181+
### Namespace usage - Output
182182

183183
```php
184184
public function setOutputNamespaces ( bool $outputNamespace ) : void;
@@ -187,7 +187,7 @@ If you don't need/want the namespaces in the output, calling this with `false` w
187187

188188
Due to the processing this will incur an overhead.
189189

190-
#Configuring array notation
190+
### Configuring array notation
191191
By default array notation is turned off, this will present duplicated elements as
192192

193193
```
@@ -209,7 +209,7 @@ Calling this with `false` will stop the generation of array indicies when matchi
209209
/root/firstname
210210
/root/firstname[1]
211211
```
212-
#Stop the processing
212+
### Stop the processing
213213

214214
```php
215215
public function flagToStop () : void;
@@ -225,12 +225,12 @@ function (DOMElement $data, $path)
225225
$reader->flagToStop();
226226
}
227227
```
228-
##Examples
228+
## Examples
229229
examples/XMLReaderBasic.php has a brief set of examples on how to use XMLReaderReg
230230

231-
##Tests
231+
## Tests
232232
tests/XMLReaderRegTest.php is a PHPUnit test set for XMLReaderReg.
233233

234234
Please note that `testFetchLargeFullRead` reads a 25MB XML file so will take some time to complete.
235-
##License
235+
## License
236236
Please see the LICENSE file.

0 commit comments

Comments
 (0)