Read XML in PHP
Posted: Thu Aug 21, 2008 3:33 am
Hi,
I have two problems regarding the xml reading in the php.
1.How to read attribute values in tags
<c r="A1" s="5" t="s">
<v>0</v>
</c>
I want to identify the values assigned to “t” in tag <c> as the string ‘s’. How to do this in php?
2.What are the meaning of “:” separation inside the tag
<table:table table:name="Sheet1" table:style-name="ta1" table:print="false">
<table:table-column table:style-name="co1" table:number-columns-repeated="4" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1">
<table:table-cell office:value-type="string">
<text:p>A</text:p>
</table:table-cell>
</table:table-row>
</table:table>
I can’t understand the tag names. When I used the whole name it gives a error regarding the “:”. Is that whole name, or what are the tag names?
I have two problems regarding the xml reading in the php.
1.How to read attribute values in tags
<c r="A1" s="5" t="s">
<v>0</v>
</c>
I want to identify the values assigned to “t” in tag <c> as the string ‘s’. How to do this in php?
2.What are the meaning of “:” separation inside the tag
<table:table table:name="Sheet1" table:style-name="ta1" table:print="false">
<table:table-column table:style-name="co1" table:number-columns-repeated="4" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1">
<table:table-cell office:value-type="string">
<text:p>A</text:p>
</table:table-cell>
</table:table-row>
</table:table>
I can’t understand the tag names. When I used the whole name it gives a error regarding the “:”. Is that whole name, or what are the tag names?