Skip to content
Merged

Next #429

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .github/scripts/validate-and-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Validate the XML file structure and lint XSD and XML files, e.g. indentation
#
# You need the binary `xmllint`
# apt-get install libxml2-utils

# The -e flag causes the script to exit as soon as one command returns a non-zero exit code
set -e

echo "Validating XML file structure and linting XSD and XML files ..."

PARSING_ERROR=0
# Iterate all XML and XSD files
while IFS= read -r -d $'\0' filename; do
# Prettify the file using xmllint and save the result to ${filename}.pretty
if XMLLINT_INDENT=$'\t' xmllint --encode UTF-8 --pretty 1 "${filename}" >"${filename}.pretty"; then
# Remove lines containing the term "xmlspy" to get rid of advertising this and save the result as ${filename}
grep -i -v "xmlspy" "${filename}.pretty" >"${filename}"
else
PARSING_ERROR=$?
echo -e "\033[0;Validating XML structure of file '${filename}' failed\033[0m"
fi
# Remove temp file
rm "${filename}.pretty"
done < <(/usr/bin/find . -type f \( -name "*.xsd" -or -name "*.xml" \) -print0)

if [ ${PARSING_ERROR} -ne 0 ]; then
exit ${PARSING_ERROR}
fi
echo -e '\033[0;32mFinished validating XML file structure and linting XSD and XML files\033[0m'
17 changes: 17 additions & 0 deletions .github/scripts/validate-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Validate all OJP XML examples from the examples/ directory against the OJP XSD schema
#
# You need the binary `xmllint`
# apt-get install libxml2-utils

# The -e flag causes the script to exit as soon as one command returns a non-zero exit code
set -e

echo "Validating NeTEx XML examples ..."

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
echo -e '\033[0;32mValidating NeTEx XML examples succeeded\033[0m'
else
echo -e '\033[0;31mValidating NeTEx XML examples failed\033[0m'
exit 1
fi
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on: push

jobs:
run:
runs-on: ubuntu-latest

steps:
- run: echo "Job was automatically triggered by a ${{ github.event_name }} event for branch ${{ github.ref }}"

- name: Check out repository code
uses: actions/checkout@v3

- name: Install xmllint and xsltproc
run: |
sudo apt-get update
sudo apt-get install libxml2-utils xsltproc

- name: Validate structure and lint XSD and XML files
run: ./.github/scripts/validate-and-lint.sh

- name: Validate NeTEx XML examples
run: ./.github/scripts/validate-examples.sh

- name: Commit changes
uses: EndBug/add-and-commit@v9 # https://github.com/marketplace/actions/add-commit
with:
default_author: github_actions
message: 'Lint and update documentation tables'
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion examples/functions/calendar/NeTEx_Calendar_se_PA1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- ==== Example of suggested NeTEx Calendar version====== -->
<PublicationDelivery xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd">
<PublicationTimestamp>2001-12-17T09:30:47.0Z</PublicationTimestamp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==== FSYO First Passes==== -->
<PublicationDelivery version="1.1" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd" xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PublicationDelivery xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd">
<PublicationTimestamp>2017-12-17T09:30:47.0Z</PublicationTimestamp>
<ParticipantRef>SYS001</ParticipantRef>
<!-- ======WHAT WAS REQUESTED ========== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ A COMPOSITE FRAME is used to group the component FRAMEs
There is a common frae and then separate frames for each mode
A RESOURCE is used to contain the GEOGRAPHICAL UNITs, etc
-->
<PublicationDelivery version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd" xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PublicationDelivery xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd">
<PublicationTimestamp>2010-12-17T09:30:47.0Z</PublicationTimestamp>
<ParticipantRef>SYS001</ParticipantRef>
<!--- ======WHAT WAS REQUESTED ========== -->
Expand Down Expand Up @@ -2707,7 +2707,7 @@ And registered on the scheme </Description>
<UserProfileRef version="any" ref="tfl:concession"/>
</UsageParameterPrice>
<UsageParameterPrice version="any" id="tfl:concession@free">
<Name>100% discount></Name>
<Name>100% discount&gt;</Name>
<DiscountingRuleRef version="any" ref="tfl:100%"/>
<UserProfileRef version="any" ref="tfl:concession"/>
</UsageParameterPrice>
Expand Down Expand Up @@ -5368,7 +5368,7 @@ You can only get these as paper tickets, not on an Oyster card, and they must be
<salesOfferPackageElements>
<SalesOfferPackageElement order="1" version="any" id="tfl:Oyster_Top_Up-SOP@Prepaid_trip@Oyster_Top_Up">
<TypeOfTravelDocumentRef version="any" ref="tfl:smartcard"/>
<SupplementProductRef version="any" ref="tfl:Oyster_Top_Up"/>
<SupplementProductRef version="any" ref="tfl:Oyster_Top_Up"/>
</SalesOfferPackageElement>
</salesOfferPackageElements>
</SalesOfferPackage>
Expand All @@ -5383,8 +5383,6 @@ You can only get these as paper tickets, not on an Oyster card, and they must be
<SalesOfferPackageElement order="1" version="any" id="tfl:Oyster_Auto_Top_Up-SOP@Prepaid_trip@Oyster_Top_Up">
<TypeOfTravelDocumentRef version="any" ref="tfl:smartcard"/>
<SupplementProductRef version="any" ref="tfl:Oyster_Auto_Top_Up"/>


</SalesOfferPackageElement>
</salesOfferPackageElements>
</SalesOfferPackage>
Expand Down Expand Up @@ -6179,7 +6177,7 @@ Wallington After 09:20
-->
<!--- ====Trip definitions======= -->
<FareStructureElement version="any" id="tfl:metro_trip">
<Name>TfL Metro network ></Name>
<Name>TfL Metro network &gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="nr:metro_trip@01" order="1">
<IsFirstInSequence>true</IsFirstInSequence>
Expand Down Expand Up @@ -6216,7 +6214,7 @@ Wallington After 09:20
</FareStructureElement>
<!--- ====Acccess definitions======= -->
<FareStructureElement version="any" id="tfl:TfL_Network">
<Name>TfL Zone Network ></Name>
<Name>TfL Zone Network &gt;</Name>
<validityParameterAssignments>
<GenericParameterAssignment version="any" order="1" id="tfl:TfL_Network@01">
<validityParameters>
Expand Down Expand Up @@ -10445,7 +10443,7 @@ Wallington After 09:20
<!--- ====Fare Structure Elements======= -->
<fareStructureElements>
<FareStructureElement version="any" id="nr:rail_only_trip">
<Name>Oyster Area Rail Only Trip></Name>
<Name>Oyster Area Rail Only Trip&gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="nr:rail_only_trip_01" order="1">
<ValidableElementRef version="any" ref="nr:rail_trip"/>
Expand All @@ -10464,7 +10462,7 @@ Wallington After 09:20
</fareStructureElementsInSequence>
</FareStructureElement>
<FareStructureElement version="any" id="nr:rail_through_trip">
<Name>Rail Through rip></Name>
<Name>Rail Through rip&gt;</Name>
<Description> The extension fare will be charged as a National Rail though fare when:
Any part of your journey is on a red route on the map,
And National Rail through fares apply for the journey you are making, ???
Expand Down Expand Up @@ -10502,7 +10500,7 @@ Wallington After 09:20
</fareStructureElementsInSequence>
</FareStructureElement>
<FareStructureElement version="any" id="nr:rail_extension_trip">
<Name>Rail extension trip TfL Parts of Rail Network ></Name>
<Name>Rail extension trip TfL Parts of Rail Network &gt;</Name>
<Description>The extension fare will be charged as a Zone 1 TfL fare when:

Any part of your journey is on a National Rail route (either red or green on the map) - Rail OK
Expand Down Expand Up @@ -12455,7 +12453,7 @@ Are buying or leasing a vehicle through the Motability scheme A copy of the leas
<!--- === Fare Structure Elements ======= -->
<fareStructureElements>
<FareStructureElement version="any" id="lbsl:bus_or_tram_trip">
<Name>Flat Fare Bus Trip></Name>
<Name>Flat Fare Bus Trip&gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="lbsl:bus_or_tram_trip" order="1">
<IsFirstInSequence>true</IsFirstInSequence>
Expand Down Expand Up @@ -12791,7 +12789,7 @@ Find out more about using contactless payment cards on buses</Description>
<!--- === Fare Structure Elements ======= -->
<fareStructureElements>
<FareStructureElement version="any" id="lrs:river_trip">
<Name>RiverT rip></Name>
<Name>RiverT rip&gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="lbsl:river_trip@01" order="1">
<IsFirstInSequence>true</IsFirstInSequence>
Expand All @@ -12811,7 +12809,7 @@ Find out more about using contactless payment cards on buses</Description>
</fareStructureElementsInSequence>
</FareStructureElement>
<FareStructureElement version="any" id="lrs:River_cruise">
<Name>River Cruise></Name>
<Name>River Cruise&gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="lbsl:River_cruise@01" order="1">
<ValidableElementRef version="any" ref="lrs:River_cruise"/>
Expand All @@ -12829,7 +12827,7 @@ Find out more about using contactless payment cards on buses</Description>
</fareStructureElementsInSequence>
</FareStructureElement>
<FareStructureElement version="any" id="lrs:river_hop_on_hop_off">
<Name>River Cruise></Name>
<Name>River Cruise&gt;</Name>
<fareStructureElementsInSequence>
<FareStructureElementInSequence version="any" id="lbsl:river_hop_on_hop_off@01" order="1">
<ValidableElementRef version="any" ref="lrs:River_cruise"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ A COMPOSITE FRAME is used to group the component FRAMEs
A separate FARE FRAME is used to contain the FARE price elements
A RESOURCE FRAME is used to contain common code values
-->
<PublicationDelivery version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd" xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PublicationDelivery xmlns="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.netex.org.uk/netex ../../../xsd/NeTEx_publication.xsd">
<PublicationTimestamp>2010-12-17T09:30:47.0Z</PublicationTimestamp>
<ParticipantRef>SYS001</ParticipantRef>
<!--- ======WHAT WAS REQUESTED ========== -->
Expand Down Expand Up @@ -313,10 +313,9 @@ A COMPOSITE FRAME is used to group the component FRAMEs
<FrameDefaults>
<DefaultCurrency>EUR</DefaultCurrency>
</FrameDefaults>

<prerequisites>
<FareFrameRef version="1.0" ref="myfares:DTA@Line_1@products"/>
</prerequisites>
</prerequisites>
<priceGroups>
<PriceGroup version="1.0" id="myfares:Line_1">
<members>
Expand Down Expand Up @@ -366,7 +365,7 @@ A COMPOSITE FRAME is used to group the component FRAMEs
<TypeOfTariff version="ntx:v1.0" id="ntx:zonal">
<Name>Zonal</Name>
</TypeOfTariff>
<TypeOfTariff version="ntx:v1.0" id="ntx:unit_distance">
<TypeOfTariff version="ntx:v1.0" id="ntx:unit_distance">
<Name>Unit distance (count of stops, sections, zones)</Name>
</TypeOfTariff>
<TypeOfTariff version="ntx:v1.0" id="ntx:section">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ A COMPOSITE FRAME is used to group the component FRAMEs
</ServiceFrame>
<!--- =============== FAREs =========== -->
<FareFrame version="1.0" id="myfares:DTA@Line24@products">
<prerequisites>
<prerequisites>
<ServiceFrameRef version="1.0" ref="mybus:DTA@Line24@network"/>
</prerequisites>
<!--- ====Fare Structure======= -->
<tariffs>
<Tariff version="1.0" id="myfares:PointToPoint_01">
<Name>Point to Point Tariff</Name>
<OperatorRef version="any" ref="mybus:DTA"/>
<TypeOfTariffRef version="ntx:v1.0" ref="ntx:point_to_point"/>
<TypeOfTariffRef version="ntx:v1.0" ref="ntx:point_to_point"/>
<fareStructureElements>
<FareStructureElement version="1.0" id="myfares:PointToPoint_01@access">
<distanceMatrixElements>
Expand Down Expand Up @@ -288,8 +288,8 @@ A COMPOSITE FRAME is used to group the component FRAMEs
<MaximalFrequency>1</MaximalFrequency>
</FrequencyOfUse>
<Interchanging version="1.0" id="myfares:PointToPoint_01@conditions_of_travel@interchanging">
<FromMode>bus</FromMode>
<ToMode>bus</ToMode>
<FromMode>bus</FromMode>
<ToMode>bus</ToMode>
<MaximumNumberOfInterchanges>0</MaximumNumberOfInterchanges>
</Interchanging>
</limitations>
Expand Down Expand Up @@ -344,7 +344,7 @@ A COMPOSITE FRAME is used to group the component FRAMEs
<fareProducts>
<PreassignedFareProduct version="1.0" id="myfares:Trip">
<Name>Standard Point To Point Trip fare </Name>
<TypeOfFareProductRef version="ntx:v1.0" ref="ntx:trip"/>
<TypeOfFareProductRef version="ntx:v1.0" ref="ntx:trip"/>
<OperatorRef version="any" ref="mybus:DTA"/>
<!--- ====VALIDABLE ELEMENTs====== -->
<validableElements>
Expand Down Expand Up @@ -419,11 +419,10 @@ A COMPOSITE FRAME is used to group the component FRAMEs
</FareFrame>
<!--- =============== FAREs =========== -->
<FareFrame version="1.0" id="myfares:DTA@Line24@prices">
<Name>Prices for Line 24</Name>
<Name>Prices for Line 24</Name>
<prerequisites>
<FareFrameRef version="1.0" ref="myfares:DTA@Line24@products"/>
</prerequisites>

</prerequisites>
<!--- ====Pricing Parmaters======= -->
<PricingParameterSet version="1.0" id="myfares:Line24">
<pricingRules>
Expand Down Expand Up @@ -579,16 +578,15 @@ A COMPOSITE FRAME is used to group the component FRAMEs
</FareFrame>
<!-- ==== COMMON RESOURCES == -->
<ResourceFrame version="1.0" id="mybus:DTA@Common_resources">
<codespaces>
<codespaces>
<Codespace id="ntx">
<Xmlns>ntx</Xmlns>
<XmlnsUrl>http://netex.org.uk/</XmlnsUrl>
<Description>Netex built in value</Description>
</Codespace>
</codespaces>
<typesOfValue>

<ValueSet version="ntx:v1.0" id="ntx:Types_of_Tariff" classOfValues="TypeOfTariff">
<ValueSet version="ntx:v1.0" id="ntx:Types_of_Tariff" classOfValues="TypeOfTariff">
<Name>Types of Tariff</Name>
<values>
<!--- ====Types OfTariff ========= -->
Expand Down Expand Up @@ -627,29 +625,26 @@ A COMPOSITE FRAME is used to group the component FRAMEs
</TypeOfTariff>
</values>
</ValueSet>


<ValueSet version="ntx:v1.0" id="ntx:Types_of_FareProduct" classOfValues="TypeOfFareProduct">
<Name>Types of Fare Product</Name>
<values>
<values>
<TypeOfFareProduct version="ntx:v1.0" id="ntx:trip">
<Name>Trip product</Name>
</TypeOfFareProduct>
<TypeOfFareProduct version="ntx:v1.0" id="ntx:multi_trip">
<TypeOfFareProduct version="ntx:v1.0" id="ntx:multi_trip">
<Name>Multitrip / carnet product</Name>
</TypeOfFareProduct>
<TypeOfFareProduct version="ntx:v1.0" id="ntx:period_pass">
<TypeOfFareProduct version="ntx:v1.0" id="ntx:period_pass">
<Name>Peroid pass product</Name>
</TypeOfFareProduct>
<TypeOfFareProduct version="ntx:v1.0" id="ntx:day_pass">
<TypeOfFareProduct version="ntx:v1.0" id="ntx:day_pass">
<Name>Day pass product</Name>
</TypeOfFareProduct>
<TypeOfFareProduct version="ntx:v1.0" id="ntx:discount_card">
<TypeOfFareProduct version="ntx:v1.0" id="ntx:discount_card">
<Name>Discount product</Name>
</TypeOfFareProduct>

</values>
</ValueSet>
</ValueSet>
<ValueSet version="any" id="myfares:Classes_of_Use" classOfValues="ClassOfUse">
<values>
<!--- ==== ClassOfUse========= -->
Expand Down
Loading