mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 00:08:49 +00:00
fix parsing of journey attributes with Switzerland
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@377 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
bf182039ac
commit
8ee14bc4b7
2 changed files with 10 additions and 3 deletions
|
@ -244,7 +244,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
throws IOException
|
||||
{
|
||||
// System.out.println(request);
|
||||
// System.out.println(ParserUtils.scrape(apiUri, true, wrap(request), null, false));
|
||||
// ParserUtils.printXml(ParserUtils.scrape(apiUri, true, wrap(request), null, false));
|
||||
|
||||
final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
|
@ -358,9 +358,9 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
String longCategory = null;
|
||||
while (XmlPullUtil.test(pp, "JourneyAttribute"))
|
||||
{
|
||||
XmlPullUtil.enter(pp);
|
||||
XmlPullUtil.enter(pp, "JourneyAttribute");
|
||||
XmlPullUtil.require(pp, "Attribute");
|
||||
final String attrName = XmlPullUtil.attr(pp, "type");
|
||||
final String attrName = pp.getAttributeValue(null, "type");
|
||||
XmlPullUtil.enter(pp);
|
||||
final Map<String, String> attributeVariants = parseAttributeVariants(pp);
|
||||
XmlPullUtil.exit(pp);
|
||||
|
|
|
@ -307,6 +307,13 @@ public final class ParserUtils
|
|||
System.out.println("group " + i + ":" + (m.group(i) != null ? "'" + m.group(i) + "'" : "null"));
|
||||
}
|
||||
|
||||
public static void printXml(final CharSequence xml)
|
||||
{
|
||||
final Matcher m = Pattern.compile("(<.{80}.*?>)\\s*").matcher(xml);
|
||||
while (m.find())
|
||||
System.out.println(m.group(1));
|
||||
}
|
||||
|
||||
public static String urlEncode(final String str)
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue