Awesome!
Opened this issue · 5 comments
Thanks a lot, awesome! :) The example on your github on how to use it is even more awesome! Why isn't everyone making their software manuals that easy!
How could I hardcode this to my xml?
What do you mean by hardcoding that to your XML?
You may clone/download that repo and use it from PHP, but there is nothing to hardcode in XML.
Thanks for a quick answer. Sorry, but github removed the xml from my post and I didn't notice :) The thing is I need to produce an xml with a root element with attribs:
?xml version="1.0" encoding="UTF-8"?
works xmlns="http://pbn.nauka.gov.pl/-/ns/bibliography" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" pbn-unit-id="125" xsi:schemaLocation="http://pbn.nauka.gov.pl/-/ns/bibliography PBN-report.xsd "
I don't think it is possible right now (at least not without some modifications to PHP codebase). I may add such feature, but to be true this is just a quickly created repo which needs some automated tests for any refactoring/improvements.
I thought that perhaps I could hardcode this line for my own use
somewhere in my copy of your module. I can live without it, you know -
can just always delete and insert the second line of the xml file. But
it looks like a feature of plenty xml files in the wild, so a good
thing to have in your module. Otherwise, the module is great, thanks
for sharing!
OK. I think you may fork/hardcode some changes around line 41 (https://github.com/jmarceli/array2xml/blob/master/ArrayToXML.php#L41) check the http://php.net/manual/en/function.xmlwriter-start-document.php docs for more info.