mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 22:18:48 +00:00
Work around broken XML by stupidly embedding html within attributes
This commit is contained in:
parent
65127104d2
commit
ae259223ad
2 changed files with 22 additions and 1 deletions
|
@ -30,6 +30,7 @@ import de.schildbach.pte.dto.Product;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryTripsContext;
|
import de.schildbach.pte.dto.QueryTripsContext;
|
||||||
import de.schildbach.pte.dto.QueryTripsResult;
|
import de.schildbach.pte.dto.QueryTripsResult;
|
||||||
|
import de.schildbach.pte.util.StringReplaceReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
|
@ -190,6 +191,18 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
return xmlQueryDepartures(uri.toString(), stationId);
|
return xmlQueryDepartures(uri.toString(), stationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addCustomReplaces(final StringReplaceReader reader)
|
||||||
|
{
|
||||||
|
reader.replace("<br />", " ");
|
||||||
|
reader.replace("<ul>", " ");
|
||||||
|
reader.replace("</ul>", " ");
|
||||||
|
reader.replace("<li>", " ");
|
||||||
|
reader.replace("</li>", " ");
|
||||||
|
reader.replace("<b>", " ");
|
||||||
|
reader.replace("</b>", " ");
|
||||||
|
}
|
||||||
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||||
{
|
{
|
||||||
final StringBuilder uri = new StringBuilder(getStopEndpoint);
|
final StringBuilder uri = new StringBuilder(getStopEndpoint);
|
||||||
|
|
|
@ -65,8 +65,16 @@ public class RmvProviderLiveTest extends AbstractProviderLiveTest
|
||||||
public void queryDepartures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures(3000408, 0, false);
|
final QueryDeparturesResult result = provider.queryDepartures(3000408, 0, false);
|
||||||
|
|
||||||
print(result);
|
print(result);
|
||||||
|
|
||||||
|
final QueryDeparturesResult result2 = provider.queryDepartures(3000010, 0, false);
|
||||||
|
print(result2);
|
||||||
|
|
||||||
|
final QueryDeparturesResult result3 = provider.queryDepartures(3015989, 0, false);
|
||||||
|
print(result3);
|
||||||
|
|
||||||
|
final QueryDeparturesResult result4 = provider.queryDepartures(3000139, 0, false);
|
||||||
|
print(result4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue