Skip to content

Commit a4b85b4

Browse files
authored
Merge pull request #55 from eminence/xml_1
Update to the v1 of the xml crate (previously known as xml-rs)
2 parents 91c84fd + d97bebb commit a4b85b4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "xmltree"
3-
version = "0.11.0"
3+
version = "0.12.0"
44
authors = ["Andrew Chin <achin@eminence32.net>"]
55
description = "Parse an XML file into a simple tree-like structure"
66
documentation = "https://docs.rs/xmltree/"
@@ -12,7 +12,7 @@ categories = ["parsing", "data-structures"]
1212
edition = "2018"
1313

1414
[dependencies]
15-
xml-rs = "0.8"
15+
xml = "1"
1616
indexmap = { version = "2", optional = true }
1717

1818
[features]

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add the following to your `Cargo.toml` file:
1515

1616
```toml
1717
[dependencies]
18-
xmltree = "0.11"
18+
xmltree = "0.12"
1919
```
2020

2121
### Feature-flags
@@ -24,14 +24,15 @@ xmltree = "0.11"
2424

2525
* `attribute-sorted` - change the data structure that stores attributes to one that uses sorted order. This changes the type definition.
2626

27-
## Compatibility with xml-rs
28-
This crate will export some types from the xml-rs crate. If your own crate also uses the xml-rs
27+
## Compatibility with xml crate
28+
This crate will export some types from the [xml](https://crates.io/crates/xml) crate. If your own crate also uses the xml
2929
crate, but with a different version, the types may be incompatible. One way to solve this is to
3030
only use the exported types, but sometimes that is not always possible. In those cases you should
31-
use a version of xmltree that matches the version of xml-rs you are using:
31+
use a version of xmltree that matches the version of xml you are using:
3232

33-
| xml-rs version | xmltree version |
33+
| xml version | xmltree version |
3434
|----------------|-----------------|
35+
| 1 | 0.12 |
3536
| 0.8 | 0.11 |
3637
| 0.7 | 0.8 |
3738
| 0.6 | 0.6 |

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ fn build<B: Read>(reader: &mut EventReader<B>, mut elem: Element) -> Result<Elem
241241
Ok(XmlEvent::StartDocument { .. }) | Ok(XmlEvent::EndDocument) => {
242242
return Err(ParseError::CannotParse)
243243
}
244+
Ok(XmlEvent::Doctype { .. }) => (),
244245
Err(e) => return Err(ParseError::MalformedXml(e)),
245246
}
246247
}
@@ -315,6 +316,7 @@ impl Element {
315316
}
316317
Ok(XmlEvent::EndElement { .. }) => (),
317318
Ok(XmlEvent::EndDocument) => return Ok(root_nodes),
319+
Ok(XmlEvent::Doctype { .. }) => (),
318320
Err(e) => return Err(ParseError::MalformedXml(e)),
319321
}
320322
}

0 commit comments

Comments
 (0)