I have this simplexml object and it looks fine, but when i convert a part of it... like: $xmlMeshHeading = $MeshHeading->asXML();
I suddenly get attributes which i can't find in the simple XML object...? Here are some parts of the two files:
SimpleXMLObject:
[MeshHeadingList] => SimpleXMLElement Object [DescriptorName] => Acoustic Stimulation
(
[MeshHeading] => Array
(
[0] => SimpleXMLElement Object
(
[QualifierName] => methods
)
[1] => SimpleXMLElement Object
(
[DescriptorName] => Adolescent
)
[2] => SimpleXMLElement Object
(
[DescriptorName] => Age Factors
)
[3] => SimpleXMLElement Object
(
[DescriptorName] => Child
)
[4] => SimpleXMLElement Object
(
[DescriptorName] => Electromyography
[QualifierName] => methods
)
[5] => SimpleXMLElement Object
(
[DescriptorName] => Female
)
[6] => SimpleXMLElement Object
(
[DescriptorName] => Galvanic Skin Response
[QualifierName] => physiology
)
[7] => SimpleXMLElement Object
(
[DescriptorName] => Humans
)
[8] => SimpleXMLElement Object
(
[DescriptorName] => Male
)
[9] => SimpleXMLElement Object
(
[DescriptorName] => Muscle, Skeletal
[QualifierName] => physiology
)
[10] => SimpleXMLElement Object
(
[DescriptorName] => Probability
)
[11] => SimpleXMLElement Object
(
[DescriptorName] => Reaction Time
[QualifierName] => physiology
)
[12] => SimpleXMLElement Object
(
[DescriptorName] => Sex Factors
)
[13] => SimpleXMLElement Object
(
[DescriptorName] => Startle Reaction
[QualifierName] => physiology
)
Ve burada asXML dosyası ... aynı kaynaktan geliyor:
<MeshHeadingList>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Acoustic Stimulation</DescriptorName>
<QualifierName MajorTopicYN="N">methods</QualifierName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Adolescent</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Age Factors</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Child</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Electromyography</DescriptorName>
<QualifierName MajorTopicYN="Y">methods</QualifierName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Female</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Galvanic Skin Response</DescriptorName>
<QualifierName MajorTopicYN="N">physiology</QualifierName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Humans</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Male</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Muscle, Skeletal</DescriptorName>
<QualifierName MajorTopicYN="Y">physiology</QualifierName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Probability</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Reaction Time</DescriptorName>
<QualifierName MajorTopicYN="N">physiology</QualifierName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Sex Factors</DescriptorName>
</MeshHeading>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Startle Reaction</DescriptorName>
<QualifierName MajorTopicYN="Y">physiology</QualifierName>
</MeshHeading>
</MeshHeadingList>
My question is... 1. Is there a function to "unhide" the attributes in SimpleXML? OR 2. How can i get stuff from an XML file, like attributes and the values...?
Best, Thijs