I'm working with SimpleXMLElement to generate an xml file, but I'm having a problem, because all my tag names (odt xml files) have colons and dashes on it, for example: office:automatic-styles or style:style. the problem is because I use the following 'convention' to create child tags:
$vendor = $xml-> mobil -> addChild('vendor', 'Johnny');
where mobil is the first tag named mobil on the root tag.
so If I want to add a new tag that has the name: office:automatic-styles, how could I scape the colon and the dash? if I write this:
$style = $xml-> office:automatic-styles -> addChild('style:style', '');
I get a bunch of errors.
I tried to scape them using a \ before each of these characters, but this didn't help.
Does anyone know what should I do?
I tryed putting the name of the tag in a string, but this does nothing, doesn't create the tag y the xml, nor throws any error message.
Help would be very appreciated.