mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
correct handling of empty element tags
This commit is contained in:
parent
699fa20344
commit
9286139ab6
1 changed files with 72 additions and 43 deletions
|
@ -1459,6 +1459,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
XmlPullUtil.exit(pp, "itdDepartureList");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1864,8 +1868,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
XmlPullUtil.enter(pp, "itdTripDateTime");
|
||||
XmlPullUtil.enter(pp, "itdDateTime");
|
||||
if (!XmlPullUtil.test(pp, "itdDate"))
|
||||
throw new IllegalStateException("cannot find <itdDate />");
|
||||
XmlPullUtil.require(pp, "itdDate");
|
||||
if (!pp.isEmptyElementTag())
|
||||
{
|
||||
XmlPullUtil.enter(pp, "itdDate");
|
||||
|
@ -1879,6 +1882,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
XmlPullUtil.exit(pp, "itdDate");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
XmlPullUtil.exit(pp, "itdDateTime");
|
||||
|
||||
final Calendar time = new GregorianCalendar(timeZone());
|
||||
|
@ -2030,7 +2037,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.next(pp);
|
||||
|
||||
boolean lowFloorVehicle = false;
|
||||
if (XmlPullUtil.test(pp, "itdInfoTextList") && !pp.isEmptyElementTag())
|
||||
if (XmlPullUtil.test(pp, "itdInfoTextList"))
|
||||
{
|
||||
if (!pp.isEmptyElementTag())
|
||||
{
|
||||
XmlPullUtil.enter(pp, "itdInfoTextList");
|
||||
while (XmlPullUtil.test(pp, "infoTextListElem"))
|
||||
|
@ -2043,6 +2052,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
XmlPullUtil.exit(pp, "itdInfoTextList");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
}
|
||||
|
||||
if (XmlPullUtil.test(pp, "itdFootPathInfo"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
@ -2155,7 +2169,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.exit(pp, "itdPartialRouteList");
|
||||
|
||||
final List<Fare> fares = new ArrayList<Fare>(2);
|
||||
if (XmlPullUtil.test(pp, "itdFare") && !pp.isEmptyElementTag())
|
||||
if (XmlPullUtil.test(pp, "itdFare"))
|
||||
{
|
||||
if (!pp.isEmptyElementTag())
|
||||
{
|
||||
XmlPullUtil.enter(pp, "itdFare");
|
||||
if (XmlPullUtil.test(pp, "itdSingleTicket"))
|
||||
|
@ -2194,9 +2210,18 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
XmlPullUtil.exit(pp, "itdSingleTicket");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
}
|
||||
XmlPullUtil.exit(pp, "itdFare");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
}
|
||||
connections.add(new Connection(id, firstDeparture, lastArrival, parts, fares.isEmpty() ? null : fares, null, numChanges));
|
||||
XmlPullUtil.exit(pp, "itdRoute");
|
||||
}
|
||||
|
@ -2270,6 +2295,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
value = value.trim();
|
||||
XmlPullUtil.exit(pp, "value");
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlPullUtil.next(pp);
|
||||
}
|
||||
|
||||
if (key.equals("FOR_RIDER"))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue