![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Apr 2012
Адрес: ifinterface.com
Сообщений: 158
|
Вроде простой вопрос.
Как можно обратиться по имени к элементу [dimension] и взять значение атрибута [ref] ? Только просьба перед ответом протестировать свою версию. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <worksheet mc:Ignorable="x14ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"> <dimension ref="A1:C9"/> <sheetViews> <sheetView tabSelected="1" workbookViewId="0"> <selection activeCell="D13" sqref="D13"/> </sheetView> </sheetViews> <sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/> <sheetData> <row r="1" spans="1:3" x14ac:dyDescent="0.25"> <c r="A1" t="s"> <v>0</v> </c> </row> <row r="2" spans="1:3" x14ac:dyDescent="0.25"> <c r="B2" t="s"> <v>1</v> </c> </row> <row r="3" spans="1:3" x14ac:dyDescent="0.25"> <c r="C3" t="s"> <v>2</v> </c> </row> <row r="4" spans="1:3" x14ac:dyDescent="0.25"> <c r="A4"> <v>1</v> </c> <c r="C4" t="s"> <v>3</v> </c> </row> <row r="5" spans="1:3" x14ac:dyDescent="0.25"> <c r="A5"> <v>0</v> </c> <c r="C5" t="s"> <v>4</v> </c> </row> <row r="6" spans="1:3" x14ac:dyDescent="0.25"> <c r="A6"> <v>45</v> </c> </row> <row r="7" spans="1:3" x14ac:dyDescent="0.25"> <c r="A7"> <v>1022</v> </c> </row> <row r="8" spans="1:3" x14ac:dyDescent="0.25"> <c r="A8"> <v>0.25</v> </c> </row> <row r="9" spans="1:3" x14ac:dyDescent="0.25"> <c r="A9"> <v>56.185000000000002</v> </c> </row> </sheetData> <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/> </worksheet>
__________________
Небольшая часть реализации моего внутреннего мира |
|
|||||
|
Регистрация: Apr 2012
Адрес: ifinterface.com
Сообщений: 158
|
Это я в курсе, что по идее так должно работать.
Но у меня не работает. Инициализирую вот так: var sh1:XML=new XML('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><dimension ref="A1:C9"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"><selection activeCell="D13" sqref="D13"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/><sheetData><row r="1" spans="1:3" x14ac:dyDescent="0.25"><c r="A1" t="s"><v>0</v></c></row><row r="2" spans="1:3" x14ac:dyDescent="0.25"><c r="B2" t="s"><v>1</v></c></row><row r="3" spans="1:3" x14ac:dyDescent="0.25"><c r="C3" t="s"><v>2</v></c></row><row r="4" spans="1:3" x14ac:dyDescent="0.25"><c r="A4"><v>1</v></c><c r="C4" t="s"><v>3</v></c></row><row r="5" spans="1:3" x14ac:dyDescent="0.25"><c r="A5"><v>0</v></c><c r="C5" t="s"><v>4</v></c></row><row r="6" spans="1:3" x14ac:dyDescent="0.25"><c r="A6"><v>45</v></c></row><row r="7" spans="1:3" x14ac:dyDescent="0.25"><c r="A7"><v>1022</v></c></row><row r="8" spans="1:3" x14ac:dyDescent="0.25"><c r="A8"><v>0.25</v></c></row><row r="9" spans="1:3" x14ac:dyDescent="0.25"><c r="A9"><v>56.185000000000002</v></c></row></sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>');
__________________
Небольшая часть реализации моего внутреннего мира |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Неймспейсы же.
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Apr 2012
Адрес: ifinterface.com
Сообщений: 158
|
__________________
Небольшая часть реализации моего внутреннего мира |
|
|||||
|
Регистрация: Sep 2006
Сообщений: 453
|
|
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Да почему ж нельзя то. Ещё как можно.
package { import flash.display.Sprite; import flash.events.Event; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.TEXT; loader.addEventListener(Event.COMPLETE, onCompleteXML); loader.load(new URLRequest("file.xml")); } private function onCompleteXML(event:Event):void { var xml:XML = XML((event.currentTarget as URLLoader).data); //// var ns:Namespace = new Namespace("ns", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); trace(xml.ns::sheetFormatPr.@defaultRowHeight); var ns2:Namespace = new Namespace("ns2", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"); trace(xml.ns::sheetFormatPr.@ns2::dyDescent); } } }
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Apr 2012
Адрес: ifinterface.com
Сообщений: 158
|
Вот спасибо!
Разжевали, что называется. Теперь неделю гулять буду! ![]()
__________________
Небольшая часть реализации моего внутреннего мира |
![]() |
![]() |
Часовой пояс GMT +4, время: 01:02. |
|
|
« Предыдущая тема | Следующая тема » |
|
|