Answer the question
In order to leave comments, you need to log in
How to correctly access a specific element in an xml file?
There is an xml file https://pastebin.com/AYi12DDx
You
need to access the value value, which contains information about the database tables
Tablename
PK uniqueId
FK1 foreignKey
fieldname
$xml = simplexml_load_file('file.xml');
foreach($xml->root->mxCell as $item) {
echo "<pre>";
print_r($item->attributes()->value);
echo "</pre>";
}
main(): Cannot add element value number 1 when only 0 such elements exist in
SimpleXMLElement Object
(
[0] =>
Tablename
PK uniqueId
FK1 foreignKey
fieldname
)
SimpleXMLElement Object
(
[0] =>
Tablename
PK uniqueId
FK1 foreignKey
fieldname
fieldname
FK1
foreignKey
FK1
foreignKey
)
SimpleXMLElement Object
(
[0] =>
Tablename
PK uniqueId
FK1 foreignKey
fieldname
fieldname
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question