PHP Classes

empty tags

Recommend this page to a friend!

      SimpleXML for PHP4  >  All threads  >  empty tags  >  (Un) Subscribe thread alerts  
Subject:empty tags
Summary:I am losing empty tags
Messages:2
Author:Tyson Vanover
Date:2010-01-25 20:58:22
Update:2010-01-25 21:11:31
 

  1. empty tags   Reply   Report abuse  
Picture of Tyson Vanover Tyson Vanover - 2010-01-25 20:58:22
I am trying to read an XML file that contains empty tags <tag /> and they seem to be getting dropped. Is this an oversight, bug, or a limit of the tool?

  2. Re: empty tags   Reply   Report abuse  
Picture of Tyson Vanover Tyson Vanover - 2010-01-25 21:11:31 - In reply to message 1 from Tyson Vanover
Even basic xml

<test>
<label>a label</label>
<empty />
</test>

only gives me

SimpleXMLObject Object
(
[label] => a label
)

instead of

SimpleXMLElement Object
(
[label] => a label
[empty] => SimpleXMLElement Object
(
)

)