SimpleXML Reading node with a hyphenated name

Your assumption is correct. Use $officeXML->{‘document-meta’} to make it work. Please note that the above applies to Element nodes. Attribute nodes (those within the @attributes property when dumping the SimpleXmlElement) do not require any special syntax to be accessed when hyphenated. They are regularly accessible via array notation, e.g. $xml = <<< XML <root> <hyphenated-element … Read more