Skip to content

Add example for line and operator filter in StopEventRequest#470

Open
leonardehrenfried wants to merge 3 commits intoVDVde:developfrom
leonardehrenfried:line-filter
Open

Add example for line and operator filter in StopEventRequest#470
leonardehrenfried wants to merge 3 commits intoVDVde:developfrom
leonardehrenfried:line-filter

Conversation

@leonardehrenfried
Copy link

@leonardehrenfried leonardehrenfried commented Feb 21, 2025

I'm familiarising myself with OJP but I'm a little puzzled about how to set a line filter in the StopEventRequest.

Intellij's autocomplete and the HTML documentation suggests that you can do it like in the example in this PR but xmllint and weirdly Intellij itself complain about it.

examples/basic/StopEventRequest-LineFilter.xml:25: element LineFilter: Schemas validity error : Element '{http://www.vdv.de/ojp}LineFilter': This element is not expected. Expected is one of ( {http://www.vdv.de/ojp}IncludePlacesContext, {http://www.vdv.de/ojp}IncludeSituationsContext, {http://www.vdv.de/ojp}IncludeStopHierarchy, {http://www.vdv.de/ojp}Extension ).

Is the below example correct?

@leonardehrenfried leonardehrenfried changed the title How do I include a LineFilter that passes the XSD validation? How do I set a StopEventRequest's LineFilter that passes the XSD validation? Feb 22, 2025
@herlitze
Copy link
Contributor

@leonardehrenfried the order of your Params is incorrect. LineFilter should come before the other Params:

<?xml version="1.0" encoding="UTF-8"?> <OJP xmlns="http://www.vdv.de/ojp" xmlns:siri="http://www.siri.org.uk/siri" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/ojp file:///D:/Schnittstellen/OJP-release-2.0/OJP.xsd"> <OJPRequest> <siri:ServiceRequest> <siri:RequestTimestamp>2020-01-20T12:00:00Z</siri:RequestTimestamp> <siri:RequestorRef>IRMA</siri:RequestorRef> <OJPStopEventRequest> <siri:RequestTimestamp>2020-01-20T12:00:00Z</siri:RequestTimestamp> <siri:MessageIdentifier>756</siri:MessageIdentifier> <Location xmlns:siri="http://www.siri.org.uk/siri"> <PlaceRef> <StopPlaceRef>8530813</StopPlaceRef> <Name> <Text>Zürich Kreuzplatz</Text> </Name> </PlaceRef> <DepArrTime>2020-12-01T12:00:00Z</DepArrTime> </Location> <Params> <LineFilter> <Line> <siri:LineRef>7311234</siri:LineRef> </Line> <Exclude>true</Exclude> </LineFilter> <StopEventType>both</StopEventType> <IncludePreviousCalls>true</IncludePreviousCalls> <IncludeOnwardCalls>true</IncludeOnwardCalls> <IncludeOperatingDays>true</IncludeOperatingDays> <UseRealtimeData>full</UseRealtimeData> </Params> </OJPStopEventRequest> </siri:ServiceRequest> </OJPRequest> </OJP>

@leonardehrenfried
Copy link
Author

Aha - thank you for this!

If you're interested in having these examples you may merge this or close this PR if not.

@leonardehrenfried leonardehrenfried changed the title How do I set a StopEventRequest's LineFilter that passes the XSD validation? Add example for line and operator filter in StopEventRequest Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants