fork download
  1. <?php
  2.  
  3. $xml = simplexml_load_file('php://stdin');
  4.  
  5. foreach ($xml->xpath('Owner') as $owner)
  6. {
  7. foreach($owner->LicAccounts->xpath('LicAccount') as $licaccount)
  8. {
  9. echo $licaccount->attributes()->name."\r\n";
  10. }
  11. }
Success #stdin #stdout 0.01s 20568KB
stdin
<?xml version="1.0" encoding="UTF-8"?>
<Owners>
	<!--Информация по владельцам лицевых счетов-->
	<Owner id="0000001081" name="???" email="">
		<LicAccounts>
			<LicAccount name="1301001"/>
			<LicAccount name="1301002"/>
			<LicAccount name="1301003"/>
			<LicAccount name="1301009">
				<Address>Какой-то адресс</Address>
				<Periods>
					<Period year="2014" month="04">
						<DebtOnStartMonth>0</DebtOnStartMonth>
						<Withheld>0</Withheld>
						<Payment>0</Payment>
						<DebtOnEndMonth>0</DebtOnEndMonth>
						<Services>
							<Service>
								<Name>Коллективная антенна</Name>
								<Withheld>0</Withheld>
								<Payment>0</Payment>
							</Service>
							<Service>
								<Name>Радиоточка и оповещение</Name>
								<Withheld>0</Withheld>
								<Payment>0</Payment>
							</Service>
						</Services>
					</Period>
				</Periods>
			</LicAccount>
			<LicAccount name="1301065"/>
			<LicAccount name="1301073"/>
			<LicAccount name="1301097"/>
			<LicAccount name="1301098"/>
			<LicAccount name="1301104"/>
			<LicAccount name="1301138"/>
			<LicAccount name="1301145"/>
		</LicAccounts>
	</Owner>
	<Owner id="0000000962" name="Pan-American Real Estate Investment LLC" email="">
		<LicAccounts>
			<LicAccount name="060301179">
				<Address>Какой-то адресс</Address>
				<Periods>
					<Period year="2014" month="04">
						<DebtOnStartMonth>0</DebtOnStartMonth>
						<Withheld>0</Withheld>
						<Payment>99 021,17</Payment>
						<DebtOnEndMonth>0</DebtOnEndMonth>
						<Services>
							<Service>
								<Name>Техническое обслуживание</Name>
								<Withheld>0</Withheld>
								<Payment>24 014,21</Payment>
							</Service>
							<Service>
								<Name>Отопление</Name>
								<Withheld>0</Withheld>
								<Payment>10 527,2</Payment>
							</Service>
							<Service>
								<Name>Охрана объекта</Name>
								<Withheld>0</Withheld>
								<Payment>628,17</Payment>
							</Service>
							<Service>
								<Name>Электроэнергия офисы</Name>
								<Withheld>0</Withheld>
								<Payment>56 420,13</Payment>
							</Service>
							<Service>
								<Name>Холодное водоснабжение</Name>
								<Withheld>0</Withheld>
								<Payment>745,45</Payment>
							</Service>
							<Service>
								<Name>Горячее водоснабжение</Name>
								<Withheld>0</Withheld>
								<Payment>1 311,46</Payment>
							</Service>
							<Service>
								<Name>Водоотведение</Name>
								<Withheld>0</Withheld>
								<Payment>751,8</Payment>
							</Service>
							<Service>
								<Name>Электроэнергия офисы МОП</Name>
								<Withheld>0</Withheld>
								<Payment>1 016,76</Payment>
							</Service>
							<Service>
								<Name>ТО перерасчет янв-фев 14</Name>
								<Withheld>0</Withheld>
								<Payment>2 326,71</Payment>
							</Service>
							<Service>
								<Name>Охр.объек перер янв-фев'14</Name>
								<Withheld>0</Withheld>
								<Payment>1 256,33</Payment>
							</Service>
						</Services>
					</Period>
				</Periods>
			</LicAccount>
		</LicAccounts>
	</Owner>
       <Owner>
         ...
      </Owner>
</Owners>
stdout
1301001
1301002
1301003
1301009
1301065
1301073
1301097
1301098
1301104
1301138
1301145
060301179