![]() |
![]() ![]() |
![]() |
-Guest- |
![]()
Post
#1
|
Goście ![]() |
chce przetwozyc plik XML a dkoladnie generowany przez Excel wiec wczytuje go przez simplexml i che sie dobrac do atrybutow ale maja one taka postac:
Kod <Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="4" x:FullColumns="1" x:FullRows="1"> <Row> <Cell><Data ss:Type="String">kolumna1</Data></Cell> <Cell ss:MergeAcross="1"><Data ss:Type="String">kolumna2_zlacz</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">aaa</Data></Cell> <Cell><Data ss:Type="String">bbbb</Data></Cell> <Cell><Data ss:Type="String">ccc</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">SSS</Data></Cell> <Cell><Data ss:Type="String">SWE</Data></Cell> <Cell><Data ss:Type="String">TEST</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">asas</Data></Cell> <Cell><Data ss:Type="String">adad</Data></Cell> <Cell><Data ss:Type="String">afaf</Data></Cell> </Row> </Table> nie wiem jak sie dobrac do ss:ExpandedColumnCount to cos takiego nie dziala (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) jak dam $xml->Table['ss:ExpandedColumnCount']; to tez nie (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) wiec jak mam sie do tego dobrac?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) |
|
|
![]()
Post
#2
|
|
Grupa: Przyjaciele php.pl Postów: 1 789 Pomógł: 41 Dołączył: 30.10.2003 Skąd: Wrocław Ostrzeżenie: (0%) ![]() ![]() |
Z tego co widzę po Twoim kodzie php to $xml->Table jest tablicą. Może poprostu potraktuj ją print_r($xml->Table); ?
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 2 262 Pomógł: 21 Dołączył: 3.05.2004 Skąd: Sopot, Krakow, W-wa Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#4
|
|
Grupa: Przyjaciele php.pl Postów: 742 Pomógł: 0 Dołączył: 14.12.2003 Skąd: Gdańsk, Trójmiasto Ostrzeżenie: (0%) ![]() ![]() |
najwyższy tag jest jako najwyższy obiekt SimpleXML. czytaj: tag table jest obiektem zapisanym w zmiennej $xml czyli:
zamiast $xml->Table['ExpandedColumnCount'] bedzie $xml['ExpandedColumnCount']; |
|
|
-Guest- |
![]()
Post
#5
|
Goście ![]() |
hmm tag wyglada tak:
Kod <Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="4" x:FullColumns="1" ja che sie dostac do ss:ExpandedColumnCount czyli otrzymac wartosc 3 (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
x:FullRows="1"> |
|
|
![]()
Post
#6
|
|
Grupa: Przyjaciele php.pl Postów: 742 Pomógł: 0 Dołączył: 14.12.2003 Skąd: Gdańsk, Trójmiasto Ostrzeżenie: (0%) ![]() ![]() |
$xml['ss:ExpandedColumnCount'] (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
|
|
|
![]()
Post
#7
|
|
Grupa: Przyjaciele php.pl Postów: 5 724 Pomógł: 259 Dołączył: 13.04.2004 Skąd: N/A Ostrzeżenie: (0%) ![]() ![]() |
Kod aleksandra powinien dzialac, ale nie dziala. Nawet DOMem nie moglem odczytac tego atrybutu -- nie ma takiej opcji.
|
|
|
-Guest- |
![]()
Post
#8
|
Goście ![]() |
niebardzo (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
caly plik XML wyglada tak:
jest to prosty plik excel zapisany jako xml (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) chce wyciagnac z niego miedzy innymi to ss:ExpandedColumnCount="3" a dokladnie wartosc 3 (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) to nie dziala (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) ani $xml->DocumentProperties->Worksheet->Table['ExpandedColumnCount']; |
|
|
![]()
Post
#9
|
|
Grupa: Przyjaciele php.pl Postów: 5 724 Pomógł: 259 Dołączył: 13.04.2004 Skąd: N/A Ostrzeżenie: (0%) ![]() ![]() |
Teraz to co innego (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) .
Gotcha (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) A wszystko to bylo tutaj (w manualu tez (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) ): http://www.sitepoint.com/blogs/2005/10/20/...and-namespaces/ |
|
|
-Guest- |
![]()
Post
#10
|
Goście ![]() |
dzieki dr_bonzo dziala (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
zapewne sie domyslacie po co to robie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) bo chce w latwy sposob prezentowac arkusze zrobione w Excelu lub OpenOffice Calc na strocnie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) narazie mam bardzo prototypowy skrypt ale potrafi paczyc komorki oraz wiersze oraz formatowac komorki (tlo, czcionka, polozenie textu) moze juz sa jakies gotowe komponenty do tego jakas klasa albo cos (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) jesli nie moge zaprezentowac to co mam (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 19:41 |