-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: xml defaultNamespace serialization and detection (#20)
* fixes: serialization with defaultNS fails [#12](#12) * fixes: defaultNamespace detection fails on XML-attributes when deserializing [#11](#11) --------- Signed-off-by: Jan Kowalleck <[email protected]>
- Loading branch information
1 parent
a2b5503
commit 59eaa5f
Showing
9 changed files
with
254 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<book xmlns="http://the.phoenix.project/testing/defaultNS" isbn_number="978-1942788294"> | ||
<id>f3758bf0-0ff7-4366-a5e5-c209d4352b2d</id> | ||
<title>The Phoenix Project</title> | ||
<edition number="5">5th Anniversary Limited Edition</edition> | ||
<publish_date>2018-04-16</publish_date> | ||
<author>Gene Kim</author> | ||
<author>George Spafford</author> | ||
<author>Kevin Behr</author> | ||
<type>fiction</type> | ||
<publisher> | ||
<address>10 Downing Street</address> | ||
<name>IT Revolution Press LLC</name> | ||
</publisher> | ||
<references> | ||
<reference ref="my-ref-1"/> | ||
<reference ref="my-ref-3"> | ||
<reference ref="sub-ref-2"/> | ||
</reference> | ||
<reference ref="my-ref-2"> | ||
<reference ref="sub-ref-1"/> | ||
<reference ref="sub-ref-3"/> | ||
</reference> | ||
</references> | ||
<chapters> | ||
<chapter> | ||
<number>1</number> | ||
<title>Tuesday, September 2</title> | ||
</chapter> | ||
<chapter> | ||
<number>2</number> | ||
<title>Tuesday, September 2</title> | ||
</chapter> | ||
<chapter> | ||
<number>3</number> | ||
<title>Tuesday, September 2</title> | ||
</chapter> | ||
<chapter> | ||
<number>4</number> | ||
<title>Wednesday, September 3</title> | ||
</chapter> | ||
</chapters> | ||
</book> |
1 change: 1 addition & 0 deletions
1
tests/fixtures/the-phoenix-project-defaultNS-isset.SNAPSHOT.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<book xmlns="http://the.phoenix.project/testing/defaultNS" isbn_number="978-1942788294"><id>f3758bf0-0ff7-4366-a5e5-c209d4352b2d</id><title>The Phoenix Project</title><edition number="5">5th Anniversary Limited Edition</edition><publish_date>2018-04-16</publish_date><author>Karl Ranseier</author><type>fiction</type><publisher><name>IT Revolution Press LLC</name></publisher><chapters><chapter><number>1</number><title>Tuesday, September 2</title></chapter><chapter><number>2</number><title>Tuesday, September 2</title></chapter><chapter><number>3</number><title>Tuesday, September 2</title></chapter><chapter><number>4</number><title>Wednesday, September 3</title></chapter></chapters></book> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<!-- elements are in special NS, attributes in defaultNS --> | ||
<my:book xmlns:my="http://the.phoenix.project/testing/defaultNS" isbn_number="978-1942788294"> | ||
<my:id>f3758bf0-0ff7-4366-a5e5-c209d4352b2d</my:id> | ||
<my:title>The Phoenix Project</my:title> | ||
<my:edition number="5">5th Anniversary Limited Edition</my:edition> | ||
<my:publish_date>2018-04-16</my:publish_date> | ||
<my:author>Gene Kim</my:author> | ||
<my:author>George Spafford</my:author> | ||
<my:author>Kevin Behr</my:author> | ||
<my:type>fiction</my:type> | ||
<my:publisher> | ||
<my:address>10 Downing Street</my:address> | ||
<my:name>IT Revolution Press LLC</my:name> | ||
</my:publisher> | ||
<my:references> | ||
<my:reference ref="my-ref-1"/> | ||
<my:reference ref="my-ref-3"> | ||
<my:reference ref="sub-ref-2"/> | ||
</my:reference> | ||
<my:reference ref="my-ref-2"> | ||
<my:reference ref="sub-ref-1"/> | ||
<my:reference ref="sub-ref-3"/> | ||
</my:reference> | ||
</my:references> | ||
<my:chapters> | ||
<my:chapter> | ||
<my:number>1</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>2</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>3</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>4</my:number> | ||
<my:title>Wednesday, September 3</my:title> | ||
</my:chapter> | ||
</my:chapters> | ||
</my:book> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<my:book xmlns:my="http://the.phoenix.project/testing/defaultNS" my:isbn_number="978-1942788294"> | ||
<my:id>f3758bf0-0ff7-4366-a5e5-c209d4352b2d</my:id> | ||
<my:title>The Phoenix Project</my:title> | ||
<my:edition my:number="5">5th Anniversary Limited Edition</my:edition> | ||
<my:publish_date>2018-04-16</my:publish_date> | ||
<my:author>Gene Kim</my:author> | ||
<my:author>George Spafford</my:author> | ||
<my:author>Kevin Behr</my:author> | ||
<my:type>fiction</my:type> | ||
<my:publisher> | ||
<my:address>10 Downing Street</my:address> | ||
<my:name>IT Revolution Press LLC</my:name> | ||
</my:publisher> | ||
<my:references> | ||
<my:reference my:ref="my-ref-1"/> | ||
<my:reference my:ref="my-ref-3"> | ||
<my:reference my:ref="sub-ref-2"/> | ||
</my:reference> | ||
<my:reference my:ref="my-ref-2"> | ||
<my:reference my:ref="sub-ref-1"/> | ||
<my:reference my:ref="sub-ref-3"/> | ||
</my:reference> | ||
</my:references> | ||
<my:chapters> | ||
<my:chapter> | ||
<my:number>1</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>2</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>3</my:number> | ||
<my:title>Tuesday, September 2</my:title> | ||
</my:chapter> | ||
<my:chapter> | ||
<my:number>4</my:number> | ||
<my:title>Wednesday, September 3</my:title> | ||
</my:chapter> | ||
</my:chapters> | ||
</my:book> |
1 change: 1 addition & 0 deletions
1
tests/fixtures/the-phoenix-project-defaultNS-unset.SNAPSHOT.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ns0:book xmlns:ns0="http://the.phoenix.project/testing/defaultNS" ns0:isbn_number="978-1942788294"><ns0:id>f3758bf0-0ff7-4366-a5e5-c209d4352b2d</ns0:id><ns0:title>The Phoenix Project</ns0:title><ns0:edition ns0:number="5">5th Anniversary Limited Edition</ns0:edition><ns0:publish_date>2018-04-16</ns0:publish_date><ns0:author>Karl Ranseier</ns0:author><ns0:type>fiction</ns0:type><ns0:publisher><ns0:name>IT Revolution Press LLC</ns0:name></ns0:publisher><ns0:chapters><ns0:chapter><ns0:number>1</ns0:number><ns0:title>Tuesday, September 2</ns0:title></ns0:chapter><ns0:chapter><ns0:number>2</ns0:number><ns0:title>Tuesday, September 2</ns0:title></ns0:chapter><ns0:chapter><ns0:number>3</ns0:number><ns0:title>Tuesday, September 2</ns0:title></ns0:chapter><ns0:chapter><ns0:number>4</ns0:number><ns0:title>Wednesday, September 3</ns0:title></ns0:chapter></ns0:chapters></ns0:book> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters