I basically have to query the database in order to capture all the active properties, and then grab the content under each property for sections such as placement / experience and based on this generate basically a sitemap.
I am wondering if I should use only DOM methods (can I make a hundred or so createElements, inside loops, appendChildetc.) or just do a giant string concatenation and confirm that then render it as xml?
createElement
appendChild
DOM XML. , .
$xmlBlock = '<foo>'; $xmlBlock .= '<bar>'.htmlspecialchars('baz', ENT_NOQUOTES, 'utf-8', false).'</bar>'; $xmlBlock .= '</foo>';
:
$node = $dom->createElement('foo'); $node->appendChild($dom->createElement('bar', 'baz'));
, ...
, .
$myXml = "<?xml ...... "; $myXml .= "<rootNode>"; $myXml .= "<child>";
..
, , , . XML DOM- .
, XML. , , , XML .., . , , DTD.
I don't know anything about PHP, but Android XmlSerializer is a good minimum API model that you need to provide guaranteed -built XML without creating a DOM in memory as part of the process. The code used is not complicated and can be built and tested separately from any applications that use it.
Source: https://habr.com/ru/post/1759381/More articles:How to set QDockWidget to use only the bottom corner of QMainWindow - qtAssociating TwoWay with UserControl - c #С членством в ASP.Net, может ли несколько поставщиков членства использоваться для входа на тот же сайт? - asp.net-membershipHow to extend DataMapper :: Resource with a custom method - ruby | fooobar.comLinq to Nhibernate - Compare 2 Lists - c #how can I read the version from the application descriptor file - flexhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1759383/shell-script-takes-a-list-of-commands-as-input-tries-to-execute-them-and-fails&usg=ALkJrhhCdmjMSPPJMIp1eDIMPIXq3TK1-wException not checked with phpUnit? - phpSetWindowsHookEx WH_MOUSE freezes at breakpoint in Win7 - winapiprevent YouTube from automatically playing videos - flashAll Articles