Did you ever use XML?

mrki444

Well-Known Member
Sep 17, 2019
XML or eXtensible Markup Language is why how to transport or save data. You can save all in one XML file and just import from it on second location. XML use hierarchical structure for saving dana. It has very similar stuff like HTML, example open and closed tags. I use XML to save data and import it into another program. Using it I made my blog with car specs.

Here is example of my XML structure:

Code:
<car>
	<Brand>Brand</Brand>
	<Brandvalue>Audi</Brandvalue>
	<Model>Model</Model>
	<Modelvalue>A4</Modelvalue>
	<Generation>Generation</Generation>
	<Generationvalue>A4 (B9 8W, facelift 2019)</Generationvalue>
	<ModificationEngine>Modification (Engine)</ModificationEngine>
	<ModificationEnginevalue>45 TFSI (245 Hp) quattro MHEV S tronic</ModificationEnginevalue>
	<Startofproduction>Start of production</Startofproduction>
	<Startofproductionvalue>2019 year</Startofproductionvalue>
	<Bodytype>Body type</Bodytype>
	<Bodytypevalue>Sedan</Bodytypevalue>
	<Seats>Seats</Seats>
	<Seatsvalue>5</Seatsvalue>
	<Doors>Doors</Doors>
	<Doorsvalue>4</Doorsvalue>
	<Fuelconsumptioneconomy-urban>Fuel consumption (economy) - urban</Fuelconsumptioneconomy-urban>
	<Fuelconsumptioneconomy-urbanvalue>8.5-8.7 l/100 km</Fuelconsumptioneconomy-urbanvalue>
	<Fuelconsumptioneconomy-urbanvalue2>27.67 - 27.04 US mpg 33.23 - 32.47 UK mpg</Fuelconsumptioneconomy-urbanvalue2>
	<Fuelconsumptioneconomy-extraurban>Fuel consumption (economy) - extra urban</Fuelconsumptioneconomy-extraurban>
	<Fuelconsumptioneconomy-extraurbanvalue>5.3-5.8 l/100 km</Fuelconsumptioneconomy-extraurbanvalue>
	<Fuelconsumptioneconomy-extraurbanvalue2>44.38 - 40.55 US mpg 53.3 - 48.7 UK mpg</Fuelconsumptioneconomy-extraurbanvalue2>
	<Fuelconsumptioneconomy-combined>Fuel consumption (economy) - combined</Fuelconsumptioneconomy-combined>
	<Fuelconsumptioneconomy-combinedvalue>6.5-6.8 l/100 km</Fuelconsumptioneconomy-combinedvalue>
	<Fuelconsumptioneconomy-combinedvalue2>36.19 - 34.59 US mpg 43.46 - 41.54 UK mpg</Fuelconsumptioneconomy-combinedvalue2>
	<FuelType>Fuel Type</FuelType>
	<FuelTypevalue>Petrol (Gasoline)</FuelTypevalue>
	<Acceleration0-100kmh>Acceleration 0 - 100 km/h</Acceleration0-100kmh>
	<Acceleration0-100kmhvalue>5.8 sec</Acceleration0-100kmhvalue>
	<Maximumspeed>Maximum speed</Maximumspeed>
	<Maximumspeedvalue>250 km/h</Maximumspeedvalue>
	<Maximumspeedvalue2>155.34 mph</Maximumspeedvalue2>
	<Emissionstandard>Emission standard</Emissionstandard>
	<Emissionstandardvalue>EURO VId - TEMP - EVAP - ISC</Emissionstandardvalue>
	<CO2emissions>CO2 emissions</CO2emissions>
	<CO2emissionsvalue>146-155 g/km</CO2emissionsvalue>
	<Power>Power</Power>
	<Powervalue>245 hp @ 5000-6500 rpm.</Powervalue>
	<Torque>Torque</Torque>
	<Torquevalue>370 Nm @ 1600-4300 rpm.</Torquevalue>
	<Torquevalue2>272.9 lb.-ft. @ 1600-4300 rpm.</Torquevalue2>
	<Positionofengine>Position of engine</Positionofengine>
	<Positionofenginevalue>Front, longitudinal</Positionofenginevalue>
	<Enginedisplacement>Engine displacement</Enginedisplacement>
	<Enginedisplacementvalue>1984 cm3</Enginedisplacementvalue>
	<Enginedisplacementvalue2>121.07 cu. in.</Enginedisplacementvalue2>
	<Numberofcylinders>Number of cylinders</Numberofcylinders>
	<Numberofcylindersvalue>4</Numberofcylindersvalue>
	<Positionofcylinders>Position of cylinders</Positionofcylinders>
	<Positionofcylindersvalue>Inline</Positionofcylindersvalue>
	<Numberofvalvespercylinder>Number of valves per cylinder</Numberofvalvespercylinder>
	<Numberofvalvespercylindervalue>4</Numberofvalvespercylindervalue>
	<FuelSystem>Fuel System</FuelSystem>
	<FuelSystemvalue>Direct injection</FuelSystemvalue>
	<Turbine>Turbine</Turbine>
	<Turbinevalue>Turbocharger</Turbinevalue>
	<KerbWeight>Kerb Weight</KerbWeight>
	<KerbWeightvalue>1545 kg</KerbWeightvalue>
	<KerbWeightvalue2>3406.14 lbs.</KerbWeightvalue2>
	<Maxweight>Max. weight</Maxweight>
	<Maxweightvalue>2110 kg</Maxweightvalue>
	<Maxweightvalue2>4651.75 lbs.</Maxweightvalue2>
	<Fueltankvolume>Fuel tank volume</Fueltankvolume>
	<Fueltankvolumevalue>58 l</Fueltankvolumevalue>
	<Fueltankvolumevalue2>15.32 US gal | 12.76 UK gal</Fueltankvolumevalue2>
	<Maxroofload>Max. roof load</Maxroofload>
	<Maxroofloadvalue>90 kg</Maxroofloadvalue>
	<Maxroofloadvalue2>198.42 lbs.</Maxroofloadvalue2>
	<Permittedtrailerloadwithbrakes8>Permitted trailer load with brakes (8%)</Permittedtrailerloadwithbrakes8>
	<Permittedtrailerloadwithbrakes8value>1700 kg</Permittedtrailerloadwithbrakes8value>
	<Permittedtrailerloadwithbrakes8value2>3747.86 lbs.</Permittedtrailerloadwithbrakes8value2>
	<Permittedtrailerloadwithbrakes12>Permitted trailer load with brakes (12%)</Permittedtrailerloadwithbrakes12>
	<Permittedtrailerloadwithbrakes12value>1500 kg</Permittedtrailerloadwithbrakes12value>
	<Permittedtrailerloadwithbrakes12value2>3306.93 lbs.</Permittedtrailerloadwithbrakes12value2>
	<Permittedtrailerloadwithoutbrakes>Permitted trailer load without brakes</Permittedtrailerloadwithoutbrakes>
	<Permittedtrailerloadwithoutbrakesvalue>750 kg</Permittedtrailerloadwithoutbrakesvalue>
	<Permittedtrailerloadwithoutbrakesvalue2>1653.47 lbs.</Permittedtrailerloadwithoutbrakesvalue2>
	<Permittedtowbardownload>Permitted towbar download</Permittedtowbardownload>
	<Permittedtowbardownloadvalue>80 kg</Permittedtowbardownloadvalue>
	<Permittedtowbardownloadvalue2>176.37 lbs.</Permittedtowbardownloadvalue2>
	<Length>Length</Length>
	<Lengthvalue>4762 mm</Lengthvalue>
	<Lengthvalue2>187.48 in.</Lengthvalue2>
	<Width>Width</Width>
	<Widthvalue>1847 mm</Widthvalue>
	<Widthvalue2>72.72 in.</Widthvalue2>
	<Widthincludingmirrors>Width including mirrors</Widthincludingmirrors>
	<Widthincludingmirrorsvalue>2022 mm</Widthincludingmirrorsvalue>
	<Widthincludingmirrorsvalue2>79.61 in.</Widthincludingmirrorsvalue2>
	<Height>Height</Height>
	<Heightvalue>1428 mm</Heightvalue>
	<Heightvalue2>56.22 in.</Heightvalue2>
	<Wheelbase>Wheelbase</Wheelbase>
	<Wheelbasevalue>2820 mm</Wheelbasevalue>
	<Wheelbasevalue2>111.02 in.</Wheelbasevalue2>
	<Fronttrack>Front track</Fronttrack>
	<Fronttrackvalue>1572 mm</Fronttrackvalue>
	<Fronttrackvalue2>61.89 in.</Fronttrackvalue2>
	<RearBacktrack>Rear (Back) track</RearBacktrack>
	<RearBacktrackvalue>1555 mm</RearBacktrackvalue>
	<RearBacktrackvalue2>61.22 in.</RearBacktrackvalue2>
	<Frontoverhang>Front overhang</Frontoverhang>
	<Frontoverhangvalue>899 mm</Frontoverhangvalue>
	<Frontoverhangvalue2>35.39 in.</Frontoverhangvalue2>
	<Rearoverhang>Rear overhang</Rearoverhang>
	<Rearoverhangvalue>1043 mm</Rearoverhangvalue>
	<Rearoverhangvalue2>41.06 in.</Rearoverhangvalue2>
	<Minimumturningcircleturningdiameter>Minimum turning circle (turning diameter)</Minimumturningcircleturningdiameter>
	<Minimumturningcircleturningdiametervalue>11.6 m</Minimumturningcircleturningdiametervalue>
	<Minimumturningcircleturningdiametervalue2>38.06 ft.</Minimumturningcircleturningdiametervalue2>
	<Drivewheel>Drive wheel</Drivewheel>
	<Drivewheelvalue>All wheel drive (4x4)</Drivewheelvalue>
	<NumberofGearsautomatictransmission>Number of Gears (automatic transmission)</NumberofGearsautomatictransmission>
	<NumberofGearsautomatictransmissionvalue>7 S tronic</NumberofGearsautomatictransmissionvalue>
	<Frontsuspension>Front suspension</Frontsuspension>
	<Frontsuspensionvalue>Multi-link suspension</Frontsuspensionvalue>
	<Rearsuspension>Rear suspension</Rearsuspension>
	<Rearsuspensionvalue>Multi-link independent</Rearsuspensionvalue>
	<Frontbrakes>Front brakes</Frontbrakes>
	<Frontbrakesvalue>Ventilated discs</Frontbrakesvalue>
	<Rearbrakes>Rear brakes</Rearbrakes>
	<Rearbrakesvalue>Disc</Rearbrakesvalue>
	<ABS>ABS</ABS>
	<ABSvalue>yes</ABSvalue>
	<Steeringtype>Steering type</Steeringtype>
	<Steeringtypevalue>Steering rack</Steeringtypevalue>
	<Powersteering>Power steering</Powersteering>
	<Powersteeringvalue>Electric Steering</Powersteeringvalue>
</car>
 

Sojourn

Active Member
Sep 28, 2019
JSON is better than XML nowadays.XML has been the standard for information interchange but JSON has picked up in the recent years as it is lightweight and the ease of conversion of JSON strings and javascirpt objects.

 
Last edited by a moderator:

mrki444

Well-Known Member
Sep 17, 2019
I hear that to but I like XML since I can easily import it all into database or make Wordpress posts. I will need to explore more JSON so I can see it's benefits and how I can use it.

 

ptrikha20

Active Member
Sep 28, 2019
XML usage is widespread in IT. Many coders have to configure files in xml. Xml tags can be used to configure Build and Deployment scripts in the tools like Ant, Maven or even with containers like Jenkins.

I have even used a xmltype in Oracle Database, through which we can define column values in xml format.

 

mrki444

Well-Known Member
Sep 17, 2019
Xml tags can be used to configure Build and Deployment scripts in the tools like Ant, Maven or even with containers like Jenkins.
What are those? I never hear for such tools. 

I have even used a xmltype in Oracle Database, through which we can define column values in xml format.
There is such type since it can be read wrong if you don't define it as XML. It is present into all other database Systems.