Created
May 2, 2012 19:56
-
-
Save danielpcox/2579795 to your computer and use it in GitHub Desktop.
Failing Transformation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
version="1.0"> | |
<!-- If I replace the above with the following and use an XSLT 2.0 parser, it works: | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:wits="http://wits.nctc.gov" | |
xmlns:schemaLocation="http://wits.nctc.gov WITS.XSD" | |
xpath-default-namespace="http://wits.nctc.gov" | |
version="2.0"> | |
--> | |
<xsl:template match="/"> | |
<html> | |
<body> | |
<h2>Incidents</h2> | |
<table border="1"> | |
<tr bgcolor="#9acd32"> | |
<th>ICN</th> | |
<th>Subject</th> | |
</tr> | |
<xsl:for-each select="IncidentList/Incident"> | |
<tr> | |
<td><xsl:value-of select="ICN"/></td> | |
<td><xsl:value-of select="Subject"/></td> | |
</tr> | |
</xsl:for-each> | |
</table> | |
</body> | |
</html> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<?xml-stylesheet type="text/xsl" href="events.xsl"?> | |
<!-- Or if I remove the namespace attributes on IncidentList, it works. --> | |
<IncidentList xmlns="http://wits.nctc.gov" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wits.nctc.gov WITS.XSD"> | |
<Incident> | |
<ICN>200458431</ICN> | |
<Subject>10 civilians killed, at least 45 wounded by suspected GAM in Peureulak, Indonesia</Subject> | |
<Summary>On 1 January 2004, in Peureulak, Aceh Province, Indonesia, a bomb exploded at a concert, killing ten civilians, wounding 45 others, and causing major damage to the stage area. Many of the victims were Indonesian teenagers. Police blamed the Free Aceh Movement (GAM), although the GAM denied responsibility. No other group claimed responsibility.</Summary> | |
<IncidentDate>01/01/2004</IncidentDate> | |
<ApproximateDate>No</ApproximateDate> | |
<MultipleDays>No</MultipleDays> | |
<EventTypeList> | |
<EventType>Bombing</EventType> | |
</EventTypeList> | |
<Assassination>No</Assassination> | |
<Suicide>No</Suicide> | |
<WeaponTypeList> | |
<WeaponType>Explosive</WeaponType> | |
</WeaponTypeList> | |
<IED>No</IED> | |
<Location> | |
<Region>East Asia-Pacific</Region> | |
<Country>Indonesia</Country> | |
<CityStateProvinceList><CityStateProvince> | |
<City>Peureulak</City> | |
<StateProvince>Aceh</StateProvince> | |
</CityStateProvince> | |
</CityStateProvinceList> | |
</Location> | |
<VictimList> | |
<Victim> | |
<VictimType>Civilian</VictimType> | |
<Combatant>No</Combatant> | |
<Nationality>Indonesia</Nationality> | |
<DefiningCharacteristicList> | |
<DefiningCharacteristic>None</DefiningCharacteristic> | |
</DefiningCharacteristicList> | |
<TargetedCharacteristicList> | |
<TargetedCharacteristic>Unknown</TargetedCharacteristic> | |
</TargetedCharacteristicList> | |
<Indicator>Targeted</Indicator> | |
<Child>No</Child> | |
<DeadCount>10</DeadCount> | |
<WoundedCount>45</WoundedCount> | |
<HostageCount>0</HostageCount> | |
</Victim> | |
</VictimList> | |
<FacilityList> | |
<Facility> | |
<FacilityType>Public Place/Retail</FacilityType | |
><Combatant>No</Combatant> | |
<Nationality>Indonesia</Nationality> | |
<DefiningCharacteristicList> | |
<DefiningCharacteristic>None</DefiningCharacteristic> | |
</DefiningCharacteristicList> | |
<TargetedCharacteristicList> | |
<TargetedCharacteristic>Unknown</TargetedCharacteristic> | |
</TargetedCharacteristicList> | |
<Indicator>Targeted</Indicator> | |
<Damage>Light</Damage> | |
<Quantity>1</Quantity> | |
</Facility> | |
</FacilityList> | |
<PerpetratorList> | |
<Perpetrator> | |
<Nationality>Indonesia</Nationality> | |
<Characteristic>Secular/Political/Anarchist</Characteristic> | |
</Perpetrator> | |
</PerpetratorList> | |
</Incident> | |
<Incident> | |
<ICN>200458452</ICN> | |
<Subject>6 civilians wounded by bombing in Srinagar, Jammu and Kashmir, India</Subject> | |
<Summary>On 1 January 2004, in Srinagar, Jammu and Kashmir, India, an assailant on a bicycle was carrying a bomb, which prematurely exploded, injuring six civilians. No group claimed responsibility.</Summary> | |
<IncidentDate>01/01/2004</IncidentDate> | |
<ApproximateDate>No</ApproximateDate> | |
<MultipleDays>No</MultipleDays> | |
<EventTypeList> | |
<EventType>Bombing</EventType> | |
</EventTypeList> | |
<Assassination>No</Assassination> | |
<Suicide>No</Suicide> | |
<WeaponTypeList> | |
<WeaponType>Explosive</WeaponType> | |
</WeaponTypeList> | |
<IED>No</IED> | |
<Location> | |
<Region>South Asia</Region> | |
<Country>India</Country> | |
<CityStateProvinceList><CityStateProvince> | |
<City>Srinagar</City> | |
<StateProvince>Jammu and Kashmir</StateProvince> | |
</CityStateProvince> | |
</CityStateProvinceList> | |
</Location> | |
<VictimList> | |
<Victim> | |
<VictimType>Civilian</VictimType> | |
<Combatant>No</Combatant> | |
<Nationality>India</Nationality> | |
<DefiningCharacteristicList> | |
<DefiningCharacteristic>None</DefiningCharacteristic> | |
</DefiningCharacteristicList> | |
<TargetedCharacteristicList> | |
<TargetedCharacteristic>None</TargetedCharacteristic> | |
</TargetedCharacteristicList> | |
<Indicator>Indiscriminate/Incidental</Indicator> | |
<Child>No</Child> | |
<DeadCount>0</DeadCount> | |
<WoundedCount>6</WoundedCount> | |
<HostageCount>0</HostageCount> | |
</Victim> | |
</VictimList> | |
<FacilityList/> | |
<PerpetratorList> | |
<Perpetrator> | |
<Nationality>Unknown</Nationality> | |
<Characteristic>Unknown</Characteristic> | |
</Perpetrator> | |
</PerpetratorList> | |
</Incident> | |
</IncidentList> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment