franbm Posted April 18, 2009 Share Posted April 18, 2009 i have this code: $xml = new XMLWriter(); $xml->openUri('test.xml'); $xml->setIndent(true); $xml->setIndentString("\t"); $xml->startDocument(); $xml->startElement('inventory'); $xml->startElement('book'); $xml->writeAttribute('isbn13', '978-1-43021-011-5'); $xml->writeElement('title', 'c++'); $xml->writeElement('author', 'David deers'); $xml->endElement(); $xml->startElement('book'); $xml->writeAttribute('isbn13', '978-1-59059-819-1'); $xml->writeElement('title', 'asp.net'); $xml->writeElement('author', 'Kevin Mcder'); $xml->endElement(); $xml->endElement(); $xml->endDocument(); if ($xml->flush()) { echo 'XML created'; } else { echo 'Problem with XML'; } i have tested windows/linux i always get 'Problem with XML' text but the file test.xml is well created on the server with valid data, on both windows/linux, where's the problem, is it not a correct code, thanks a lot Link to comment https://forums.phpfreaks.com/topic/154676-xmlwriter-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.