Skip to content

Commit 6047d63

Browse files
authored
Next forward master (#428)
* Manual lint * remove netex_all_filters * Redo #339 * ConditionSummaryChargingGroup * Fix errors and align with specificaions in NeTEx pt 3 * Update * Update * Move from Travis to github actions * Lint merge
1 parent 3eee3e5 commit 6047d63

File tree

15 files changed

+120
-108
lines changed

15 files changed

+120
-108
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Validate the XML file structure and lint XSD and XML files, e.g. indentation
3+
#
4+
# You need the binary `xmllint`
5+
# apt-get install libxml2-utils
6+
7+
# The -e flag causes the script to exit as soon as one command returns a non-zero exit code
8+
set -e
9+
10+
echo "Validating XML file structure and linting XSD and XML files ..."
11+
12+
PARSING_ERROR=0
13+
# Iterate all XML and XSD files
14+
while IFS= read -r -d $'\0' filename; do
15+
# Prettify the file using xmllint and save the result to ${filename}.pretty
16+
if XMLLINT_INDENT=$'\t' xmllint --encode UTF-8 --pretty 1 "${filename}" >"${filename}.pretty"; then
17+
# Remove lines containing the term "xmlspy" to get rid of advertising this and save the result as ${filename}
18+
grep -i -v "xmlspy" "${filename}.pretty" >"${filename}"
19+
else
20+
PARSING_ERROR=$?
21+
echo -e "\033[0;Validating XML structure of file '${filename}' failed\033[0m"
22+
fi
23+
# Remove temp file
24+
rm "${filename}.pretty"
25+
done < <(/usr/bin/find . -type f \( -name "*.xsd" -or -name "*.xml" \) -print0)
26+
27+
if [ ${PARSING_ERROR} -ne 0 ]; then
28+
exit ${PARSING_ERROR}
29+
fi
30+
echo -e '\033[0;32mFinished validating XML file structure and linting XSD and XML files\033[0m'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# Validate all OJP XML examples from the examples/ directory against the OJP XSD schema
3+
#
4+
# You need the binary `xmllint`
5+
# apt-get install libxml2-utils
6+
7+
# The -e flag causes the script to exit as soon as one command returns a non-zero exit code
8+
set -e
9+
10+
echo "Validating NeTEx XML examples ..."
11+
12+
if xmllint --noout --schema xsd/NeTEx_publication.xsd examples/functions/calendar/*xml examples/functions/fares/*xml examples/functions/grouping/*xml examples/functions/newModes/*xml examples/functions/patterns/*xml examples/functions/pointOfInterest/*xml examples/functions/simpleNetwork/*xml examples/functions/site/*xml examples/functions/stopPlace/*xml examples/functions/timetable/*xml examples/functions/validityCondition/*xml examples/functions/variant/*xml examples/functions/vehicleSchedule/*xml examples/functions/versioning/*xml examples/standards/epip/*xml examples/standards/era_uic/*xml examples/standards/fxc/*xml examples/standards/gbfs/*xml examples/standards/gtfs/*xml examples/standards/neptune/*xml examples/standards/noptis/*xml examples/standards/tap_tsi/*xml examples/standards/txc/*xml examples/standards/vdv452/*/*xml examples/standards/vdv452/*/*/*xml; then
13+
echo -e '\033[0;32mValidating NeTEx XML examples succeeded\033[0m'
14+
else
15+
echo -e '\033[0;31mValidating NeTEx XML examples failed\033[0m'
16+
exit 1
17+
fi

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- run: echo "Job was automatically triggered by a ${{ github.event_name }} event for branch ${{ github.ref }}"
11+
12+
- name: Check out repository code
13+
uses: actions/checkout@v3
14+
15+
- name: Install xmllint and xsltproc
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install libxml2-utils xsltproc
19+
20+
- name: Validate structure and lint XSD and XML files
21+
run: ./.github/scripts/validate-and-lint.sh
22+
23+
- name: Validate NeTEx XML examples
24+
run: ./.github/scripts/validate-examples.sh
25+
26+
- name: Commit changes
27+
uses: EndBug/add-and-commit@v9 # https://github.com/marketplace/actions/add-commit
28+
with:
29+
default_author: github_actions
30+
message: 'Lint and update documentation tables'

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

xsd/netex_framework/netex_reusableComponents/netex_facility_support.xsd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
</Date>
1616
<Date><Modified>2011-02-05</Modified>Name Space changes
1717
</Date>
18-
<Date><Modified>2013-01-07</Modified>No Pull request correct spelling of coffeeShop, nofoodavailable enum value
18+
<Date><Modified>2013-01-07</Modified>No Pull request correct spelling of coffeeShop, nofoodavailable enum value
1919
</Date>
2020
<Date><Modified>2017-05-25</Modified>Add buggy and umbrella to accessibility tools
2121
</Date>
2222
<Date><Modified>2017-11-10</Modified>Update Nuisance list to match UML
2323
</Date>
24-
<Date><Modified>2019-03-25</Modified>Fix #43 by Skinkie from 2019.01.07 Fix typo on _tactilePlatformEdges.
24+
<Date><Modified>2019-03-25</Modified>Fix #43 by Skinkie from 2019.01.07 Fix typo on _tactilePlatformEdges.
2525
</Date>
2626
<Date><Modified>2019-03-25</Modified>NL32 CD #61 Add new values to (Site) AccessFacility enum; wheelchairLift, automaticRamp and slidingStep.
2727
NJSK Review: Keep Site and Service aspects separate; add separate VehicleAccessFacility enum with values unknown, wheelchairLift, manualRamp, automaticRamp, steps, slidingStep, narrowEntrance, lowFloorAccess, validator.
@@ -32,7 +32,7 @@
3232
Fix Add missing animalsAllowed values to NuisanceFacility
3333
Add unspecifed to Gender list
3434
</Date>
35-
<Date><Modified>2021-04-15</Modified>New modes: Align Hirefacility values with spec and add values scooterHire, vehicleHire, boatHire and other.
35+
<Date><Modified>2021-04-15</Modified>New modes: Align Hirefacility values with spec and add values scooterHire, vehicleHire, boatHire and other.
3636
</Date>
3737
<Date><Modified>2021-07-07</Modified>Add values to NuisanceFacility, MobilityFacility, LuggageCarriageFacility and AccommodationFacility
3838
</Date>

xsd/netex_part_1/part1_tacticalPlanning/netex_journeyPattern_version.xsd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<Date><Modified>2011-02-05</Modified>Name Space changes</Date>
2020
<Date><Modified>2017-12-05</Modified> dd Notice Assignments
2121
</Date>
22-
<Date><Created>2019-01-10</Created>
22+
<Date>
23+
<Created>2019-01-10</Created>
2324
</Date>
2425
<Description>
2526
<p>NeTEx is a European CEN standard for the exchange of Public Transport data including timetables.</p>

xsd/netex_part_1/part1_tacticalPlanning/netex_servicePattern_support.xsd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</Date>
1919
<Date><Modified>2011-02-05</Modified>Name Space changes
2020
</Date>
21-
<Date><Modified>2011-02-05</Modified> Add Service Pattern Section
21+
<Date><Modified>2011-02-05</Modified> Add Service Pattern Section
2222
</Date>
2323
<Date><Modified>2017-05-10</Modified> Make ServiceLinkRef a type of Timing Link Ref and ScheduledStopPoint a type of TimingPoint - allows reuse of points
2424
</Date>
@@ -426,9 +426,9 @@ Rail transport, Roads and Road transport
426426
<xsd:documentation>Use Sms to request stop</xsd:documentation>
427427
</xsd:annotation>
428428
</xsd:enumeration>
429-
<xsd:enumeration value="informStaffOnboard">
429+
<xsd:enumeration value="speakToDriverOnboard">
430430
<xsd:annotation>
431-
<xsd:documentation>Inform staff onboard about the request stop. Mainly used for on demand traffic, where the route depends on where passengers want to leave the vehicle.</xsd:documentation>
431+
<xsd:documentation>Tell the driver to request stop. Mainly used for on demand traffic, where the route depends on where passengers want to leave the vehicle.</xsd:documentation>
432432
</xsd:annotation>
433433
</xsd:enumeration>
434434
<xsd:enumeration value="other">

xsd/netex_part_3/part3_fares/netex_distanceMatrixElement_version.xsd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
</Date>
1919
<Date><Modified>2011-02-05</Modified>Name Space changes
2020
</Date>
21-
<Date><Modified>2017-12-10</Modified>Fix add notice assignments as per spec
21+
<Date><Modified>2017-12-10</Modified>Fix add notice assignments as per spec
2222
</Date>
2323
<Date><Modified>2019-03-01</Modified>EURA-(nk) Add DistanceMatrixInverseRef for backwards direction of reference to a DIstance Matrix Element
2424
</Date>
2525
<Date><Modified>2019-03-08</Modified>UK-44 Improve ability to construct large tariffs
2626
Add UseToExclude flag to GroupOfDistanceMatrixElements
2727
</Date>
28-
<Date><Modified>2019-03-25</Modified>Fix #40 by Skinkie from 2019.01.07 . Fix typo on DistanceMatrixElement.IsDirect.
29-
NB this will break existing XML that uses IsDirect.
28+
<Date><Modified>2019-03-25</Modified>Fix #40 by Skinkie from 2019.01.07 . Fix typo on DistanceMatrixElement.IsDirect.
29+
NB this will break existing XML that uses IsDirect.
3030
</Date>
3131
<Date><Modified>2021-02-05</Modified>Add DynamicDistanceMatrixElement for on-the-fly creation when pre-computing all possible combinations is not feasible
3232
</Date>

xsd/netex_part_3/part3_fares/netex_fareConditionSummary_version.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Rail transport, Roads and Road transport
9797
<xsd:group ref="ConditionSummaryTravelGroup"/>
9898
<xsd:group ref="ConditionSummaryCommercialGroup"/>
9999
<xsd:group ref="ConditionSummaryReservationGroup"/>
100+
<xsd:group ref="ConditionSummaryChargingGroup"/>
100101
<xsd:group ref="ConditionSummaryRentalGroup"/>
101102
</xsd:sequence>
102103
</xsd:complexType>

xsd/netex_part_3/part3_fares/netex_usageParameterAfterSales_version.xsd

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Rail transport, Roads and Road transport
138138
</xsd:element>
139139
<xsd:element name="OnlyAtCertainDistributionPoints" type="xsd:boolean" minOccurs="0">
140140
<xsd:annotation>
141-
<xsd:documentation>Whether refund/Exchaneg can only be done in ceratin places.</xsd:documentation>
141+
<xsd:documentation>Whether reselling can only be done in certain places.</xsd:documentation>
142142
</xsd:annotation>
143143
</xsd:element>
144144
<xsd:group ref="ResellingPeriodGroup"/>
@@ -157,35 +157,35 @@ Rail transport, Roads and Road transport
157157
<xsd:sequence>
158158
<xsd:element name="ResellWhen" type="ResellWhenEnumeration" minOccurs="0">
159159
<xsd:annotation>
160-
<xsd:documentation>Event marking when the is exchangable status of the ticket changes.</xsd:documentation>
160+
<xsd:documentation>Event marking when there is resell status of the ticket changes.</xsd:documentation>
161161
</xsd:annotation>
162162
</xsd:element>
163163
<xsd:choice minOccurs="0">
164164
<xsd:element name="ExchangableFromAnyTime" type="EmptyType">
165165
<xsd:annotation>
166-
<xsd:documentation>Special value Can be exhanged from Purchase onwards.</xsd:documentation>
166+
<xsd:documentation>Special value - Can be resold from any point after purchase.</xsd:documentation>
167167
</xsd:annotation>
168168
</xsd:element>
169169
<xsd:element name="ExchangableFromDuration" type="xsd:duration">
170170
<xsd:annotation>
171-
<xsd:documentation>Duration to start of period before (negative) or after (positive) the trigger point (i.e. either Start of Validity or First Use ) or that ticket.</xsd:documentation>
171+
<xsd:documentation>Duration to start of period before (negative) or after (positive) the trigger point (i.e. either Start of Validity or First Use ) after which ticket may be resold.</xsd:documentation>
172172
</xsd:annotation>
173173
</xsd:element>
174174
<xsd:element name="ExchangableFromPercentUse" type="xsd:decimal">
175175
<xsd:annotation>
176-
<xsd:documentation>Can be exchanged once a certain percentage of duration or use has been achieved. +v1.1</xsd:documentation>
176+
<xsd:documentation>Can be resold once a certain percentage of duration or use has been achieved. +v1.1</xsd:documentation>
177177
</xsd:annotation>
178178
</xsd:element>
179179
</xsd:choice>
180180
<xsd:element name="ExchangableFromIntervalRef" type="TimeIntervalRefStructure" minOccurs="0">
181181
<xsd:annotation>
182-
<xsd:documentation>Period to start of period before (negative) or after (positive) the trigger point- as arbitrary interval.</xsd:documentation>
182+
<xsd:documentation>Reference to arbitrary TimeInterval determining period from which reselling can be done relative to trigger point.</xsd:documentation>
183183
</xsd:annotation>
184184
</xsd:element>
185185
<xsd:choice minOccurs="0">
186186
<xsd:element name="ExchangableUntilAnyTime" type="EmptyType">
187187
<xsd:annotation>
188-
<xsd:documentation>Can be exchanged anyTime.</xsd:documentation>
188+
<xsd:documentation>Can be resold anyTime.</xsd:documentation>
189189
</xsd:annotation>
190190
</xsd:element>
191191
<xsd:element name="ExchangableUntilDuration" type="xsd:duration">
@@ -195,13 +195,13 @@ Rail transport, Roads and Road transport
195195
</xsd:element>
196196
<xsd:element name="ExchangableUntilPercentUse" type="xsd:decimal">
197197
<xsd:annotation>
198-
<xsd:documentation>Can be exchanged until a certain percentage of duration or use has been achieved. +v1.1</xsd:documentation>
198+
<xsd:documentation>Can be resold until a certain percentage of duration or use has been achieved. +v1.1</xsd:documentation>
199199
</xsd:annotation>
200200
</xsd:element>
201201
</xsd:choice>
202202
<xsd:element name="ExchangableUntilIntervalRef" type="TimeIntervalRefStructure" minOccurs="0">
203203
<xsd:annotation>
204-
<xsd:documentation>Period to endof period before (negative) or after (positive) the trigger point- as arbitrary interval.</xsd:documentation>
204+
<xsd:documentation>Reference to arbitrary TimeInterval determining period up until which reselling can be done relative to trigger point.</xsd:documentation>
205205
</xsd:annotation>
206206
</xsd:element>
207207
<xsd:element name="EffectiveFrom" type="EffectiveFromEnumeration" minOccurs="0">
@@ -211,8 +211,7 @@ Rail transport, Roads and Road transport
211211
</xsd:element>
212212
<xsd:element name="NotificationPeriod" type="xsd:duration" minOccurs="0">
213213
<xsd:annotation>
214-
<xsd:documentation>Notice period needed before transaction can be made. + v1.1
215-
</xsd:documentation>
214+
<xsd:documentation>Notice period needed before transaction can be made. + v1.1</xsd:documentation>
216215
</xsd:annotation>
217216
</xsd:element>
218217
</xsd:sequence>
@@ -224,12 +223,12 @@ Rail transport, Roads and Road transport
224223
<xsd:sequence>
225224
<xsd:element name="HasFee" type="xsd:boolean" minOccurs="0">
226225
<xsd:annotation>
227-
<xsd:documentation>Whether othere is a fee for reselling.</xsd:documentation>
226+
<xsd:documentation>Whether these is a fee for a resale.</xsd:documentation>
228227
</xsd:annotation>
229228
</xsd:element>
230229
<xsd:element name="RefundBasis" type="PerBasisEnumeration" minOccurs="0">
231230
<xsd:annotation>
232-
<xsd:documentation>Whether there is a fee for reselling.</xsd:documentation>
231+
<xsd:documentation>Basis on which resale is made.</xsd:documentation>
233232
</xsd:annotation>
234233
</xsd:element>
235234
</xsd:sequence>
@@ -246,7 +245,7 @@ Rail transport, Roads and Road transport
246245
</xsd:element>
247246
<xsd:element name="typesOfPaymentMethodRef" type="TypeOfPaymentMethodRefs_RelStructure" minOccurs="0">
248247
<xsd:annotation>
249-
<xsd:documentation>POther AYMENT METHODs allowd to pay fee or to make refund.</xsd:documentation>
248+
<xsd:documentation>Other PAYMENT METHODs allowd to pay fee or to make refund.</xsd:documentation>
250249
</xsd:annotation>
251250
</xsd:element>
252251
</xsd:sequence>

0 commit comments

Comments
 (0)