note 70110 added to ref.xml
| From: | markstrawsonatshaw dot ca at osu1 dot php dot net | Date: | Tue, 03 Oct 2006 18:46:41 +0000 |
| Subject: | note 70110 added to ref.xml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117997@lists.php.net to get a copy of this message | ||
I cannot seem to pull tag and attribute info from further nested levels, be it the same name or not.
(using php 4.3.2)
How would I pull and display the ROF value for buildingattack
from the below unit in http://70.72.65.10/eso2/proto.xml for example?
All of the samples I find on internet for xml parsing
only go one level deep.
- <Unit id="264" name="NatMantlet">
<DBID>98</DBID>
<DisplayNameID>23692</DisplayNameID>
<EditorNameID>25020</EditorNameID>
<PopulationCount>0</PopulationCount>
<SubCiv>Iroquois</SubCiv>
<ObstructionRadiusX>0.7900</ObstructionRadiusX>
<ObstructionRadiusZ>0.7900</ObstructionRadiusZ>
<FormationCategory>Protected</FormationCategory>
<MaxVelocity>3.5000</MaxVelocity>
<MaxRunVelocity>5.5000</MaxRunVelocity>
<MovementType>land</MovementType>
<TurnRate>3.0000</TurnRate>
<AnimFile>units\natives\mantlet.xml</AnimFile>
<ImpactType>Flesh</ImpactType>
<Icon>units\natives\mantlet_icon</Icon>
<PortraitIcon>units\natives\mantlet_portrait</PortraitIcon>
<RolloverTextID>23691</RolloverTextID>
<ShortRolloverTextID>25687</ShortRolloverTextID>
<InitialHitpoints>250.0000</InitialHitpoints>
<MaxHitpoints>250.0000</MaxHitpoints>
<LOS>12.0000</LOS>
<ProjectileProtoUnit>Arrow</ProjectileProtoUnit>
<UnitAIType>RangedCombative</UnitAIType>
<TrainPoints>30.0000</TrainPoints>
<BuildLimit>5</BuildLimit>
<Bounty>15.0000</Bounty>
<BuildBounty>15.0000</BuildBounty>
<Cost resourcetype="Wood">50.0000</Cost>
<Cost resourcetype="Gold">100.0000</Cost>
<AllowedAge>1</AllowedAge>
<Armor type="Ranged" value="0.4000" />
<UnitType>LogicalTypeHealed</UnitType>
<UnitType>LogicalTypeValidSharpshoot</UnitType>
<UnitType>LogicalTypeNeededForVictory</UnitType>
<UnitType>LogicalTypeHandUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeLandMilitary</UnitType>
<UnitType>LogicalTypeScout</UnitType>
<UnitType>LogicalTypeValidSPCUnitsDeadCondition</UnitType>
<UnitType>LogicalTypeGarrisonInShips</UnitType>
<UnitType>LogicalTypeRangedUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeVillagersAttack</UnitType>
<UnitType>LogicalTypeHandUnitsAttack</UnitType>
<UnitType>LogicalTypeRangedUnitsAttack</UnitType>
<UnitType>LogicalTypeMinimapFilterMilitary</UnitType>
<UnitType>Unit</UnitType>
<UnitType>Military</UnitType>
<UnitType>UnitClass</UnitType>
<UnitType>Ranged</UnitType>
<UnitType>HasBountyValue</UnitType>
<UnitType>AbstractSiegeTrooper</UnitType>
<UnitType>AbstractNativeWarrior</UnitType>
<UnitType>CountsTowardMilitaryScore</UnitType>
<UnitType>ConvertsHerds</UnitType>
<UnitType>AbstractInfantry</UnitType>
<UnitType>AbstractArcher</UnitType>
<UnitType>AbstractLightInfantry</UnitType>
<UnitType>AbstractRangedInfantry</UnitType>
<UnitType>AbstractCavalryInfantry</UnitType>
<Flag>CollidesWithProjectiles</Flag>
<Flag>ApplyHandicapTraining</Flag>
<Flag>CorpseDecays</Flag>
<Flag>ShowGarrisonButton</Flag>
<Flag>DontRotateObstruction</Flag>
<Flag>ObscuredByUnits</Flag>
<Flag>VisibleUnderFogIfGaia</Flag>
<Flag>Tracked</Flag>
<Command page="10" column="2">Delete</Command>
<Command page="10" column="1">Stop</Command>
<Command page="10" column="0">Garrison</Command>
<Tactics>nativeRanged.tactics</Tactics>
- <ProtoAction>
<Name>BuildingAttack</Name>
<Damage>45.000000</Damage>
<DamageType>Siege</DamageType>
<ROF>3.000000</ROF>
</ProtoAction>
- <ProtoAction>
<Name>HandAttack</Name>
<Damage>10.000000</Damage>
<DamageType>Hand</DamageType>
<ROF>1.500000</ROF>
</ProtoAction>
- <ProtoAction>
<Name>VolleyAttack</Name>
<Damage>25.000000</Damage>
<DamageType>Ranged</DamageType>
<MaxRange>10.000000</MaxRange>
<ROF>3.000000</ROF>
<Projectile>Tomahawk</Projectile>
</ProtoAction>
</Unit>
----
Server IP: 66.207.199.35
Probable Submitter: 139.142.139.89 (proxied: 192.168.150.21)
----
Manual Page -- http://www.php.net/manual/en/ref.xml.php
Edit -- https://master.php.net/note/edit/70110
Del: integrated -- https://master.php.net/note/delete/70110/integrated
Del: useless -- https://master.php.net/note/delete/70110/useless
Del: bad code -- https://master.php.net/note/delete/70110/bad+code
Del: spam -- https://master.php.net/note/delete/70110/spam
Del: non-english -- https://master.php.net/note/delete/70110/non-english
Del: in docs -- https://master.php.net/note/delete/70110/in+docs
Del: other reasons-- https://master.php.net/note/delete/70110
Reject -- https://master.php.net/note/reject/70110
Search -- https://master.php.net/manage/user-notes.php