File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
## Unreleased
9
9
10
+ - Fix parsing ` xs:noNamespaceSchemaLocation `
11
+
10
12
## [ v0.13.4] - 2022-05-13
11
13
12
14
- Support nested ` derivedFrom ` for ` expand `
Original file line number Diff line number Diff line change @@ -45,11 +45,13 @@ impl Parse for Device {
45
45
if let Some ( width) = optional :: < u32 > ( "width" , tree, & ( ) ) ? {
46
46
device = device. width ( width)
47
47
}
48
- if let Some ( xmlns_xs) = tree. attribute ( "xmlns:xs" ) {
48
+ // TODO: accept namespace other than `xs`
49
+ // Now assert `xs` exists and `noNamespaceSchemaLocation` is under `xs`
50
+ if let Some ( xmlns_xs) = tree. lookup_namespace_uri ( Some ( "xs" ) ) {
49
51
device = device. xmlns_xs ( xmlns_xs. to_string ( ) ) ;
50
- }
51
- if let Some ( location ) = tree . attribute ( "xs:noNamespaceSchemaLocation" ) {
52
- device = device . no_namespace_schema_location ( location . to_string ( ) ) ;
52
+ if let Some ( location ) = tree . attribute ( ( xmlns_xs , "noNamespaceSchemaLocation" ) ) {
53
+ device = device . no_namespace_schema_location ( location . to_string ( ) ) ;
54
+ }
53
55
}
54
56
if let Some ( schema_version) = tree. attribute ( "schemaVersion" ) {
55
57
device = device. schema_version ( schema_version. to_string ( ) ) ;
You can’t perform that action at this time.
0 commit comments