HAFAS: Work around yet another case of invalid XML
This commit is contained in:
parent
16c1d12373
commit
9221ddce85
1 changed files with 6 additions and 2 deletions
|
@ -198,10 +198,14 @@ sub get_xml_p {
|
|||
$body =~ s{Wagen \d+ \K&}{&};
|
||||
$body =~ s{Wagen \d+, \d+ \K&}{&};
|
||||
|
||||
# <Attribute [...] text="[...] "[...]"" /> is invalid XML.
|
||||
# <Attribute [...] text="[...]"[...]"" /> is invalid XML.
|
||||
# Work around it.
|
||||
$body
|
||||
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=]*)""}{<Attribute$1text="$2*$3*"}s;
|
||||
=~ s{<Attribute([^>]+)text="([^"]*)"([^"=>]*)""}{<Attribute$1text="$2*$3*"}s;
|
||||
|
||||
# Same for <HIMMessage lead="[...]"[...]"[...]" />
|
||||
$body
|
||||
=~ s{<HIMMessage([^>]+)lead="([^"]*)"([^"=>]*)"([^"]*)"}{<Attribute$1text="$2*$3*$4"}s;
|
||||
|
||||
# Dito for <HIMMessage [...] lead="[...]<br>[...]">.
|
||||
while ( $body
|
||||
|
|
Loading…
Reference in a new issue