Commit d47639f
committed
fix: handle unbound prefixes when xmlns:dlna is absent
The strict=False recovery added in #35 anchored its namespace injection
on an existing `xmlns:dlna` declaration. Some real-world devices (JBL
Authentics, WiiM/LinkPlay) emit `<song:*>` tags without declaring
`xmlns:dlna`, so the injection was silently skipped and the unbound
prefix remained, raising ParseError when otherwise recoverable.
Anchor the injection on the DIDL-Lite root opening tag instead. That
element is guaranteed to be present in any valid DIDL-Lite document, so
the recovery works regardless of which namespace declarations the
producer chose to include.
Also batch all missing prefixes into a single regex substitution and add
a regression test that exercises the no-dlna-namespace case.1 parent bc2d7dc commit d47639f
3 files changed
Lines changed: 47 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1072 | 1083 | | |
1073 | 1084 | | |
1074 | 1085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
699 | 728 | | |
700 | 729 | | |
701 | 730 | | |
| |||
0 commit comments