Jump to content

Read XML in PHP


samudaya

Recommended Posts

Hi,

I have two problems regarding the xml reading in the php.

 

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?

 

 

 

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?

 

Link to comment
https://forums.phpfreaks.com/topic/120672-read-xml-in-php/
Share on other sites

The colon specifies a namespace for that element. You can read about xml namespaces here and here. For parsing the xml, i've used simplexml but not that i'm an expert in the field. Found these two (one, two) introduction articles to simplexml which should give you an insight of what and how can be achieved.

Link to comment
https://forums.phpfreaks.com/topic/120672-read-xml-in-php/#findComment-621848
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.