xml-twig 1.2.78 → 1.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -230,10 +230,12 @@ With option `{ namespaces : true }` you will get access to the `.namespace` prop
|
|
|
230
230
|
`.attribute(condition)`: Get attributes as object or `null` if no matching attribute was found. If `condition` is `undefined`, then all attributes are returned.
|
|
231
231
|
|
|
232
232
|
Specify attribute name or regular expression or custom condition. For details see [AttributeCondition](./doc/twig.md#AttributeCondition).<br>
|
|
233
|
-
Let's assume an XML element like this:
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
Let's assume an XML element like this:
|
|
234
|
+
```js
|
|
235
|
+
<person firstName="Jean-Luc", lastName="Picard", age="59" />
|
|
236
236
|
```
|
|
237
|
+
Here are some examples the get attribute and values:
|
|
238
|
+
```js
|
|
237
239
|
.hasAttribute('foo') => false
|
|
238
240
|
.hasAttribute('age') => true
|
|
239
241
|
|