473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

domxml->dump_file formats

Does anyone know how to specify the format for the domxml->dump_file method?

I am at a loss; my document is being dumped as one great big long line,
and I want to insert line breaks and spaces so that it is human readable.

--Yan
Dec 5 '06 #1
3 1912
Hi,

The third parameter specifies whether the output should be formatted
neatly:

$doc->dump_file('my.xml', false, true);
>From the doc page
(http://us3.php.net/manual/en/functio...ump-file.php):

string DomDocument->dump_file ( string filename [, bool compressionmode
[, bool format]] )

Creates an XML document from the dom representation. This function
usually is called after building a new dom document from scratch as in
the example below. The format specifies whether the output should be
neatly formatted, or not. The first parameter specifies the name of the
filename and the second parameter, whether it should be compressed or
not.

CptDondo wrote:
Does anyone know how to specify the format for the domxml->dump_file method?

I am at a loss; my document is being dumped as one great big long line,
and I want to insert line breaks and spaces so that it is human readable.

--Yan
Dec 5 '06 #2
CptDondo wrote:
Does anyone know how to specify the format for the domxml->dump_file
method?

I am at a loss; my document is being dumped as one great big long line,
and I want to insert line breaks and spaces so that it is human readable.
OK, more file xml file ops Q:

When I open the file, I use:

$dom = domxml_open_file("/tmp/test.conf",
DOMXML_LOAD_PARSING + //0
DOMXML_LOAD_COMPLETE_ATTRS + //8
DOMXML_LOAD_SUBSTITUTE_ENTITIES + //4
DOMXML_LOAD_DONT_KEEP_BLANKS //16
);

But that keeps leading and trailing blanks on the entries. Is there a
way to automagically trim leading and trailing whitespace?

I am using PHP4.

Thanks,

--Yan
Dec 5 '06 #3
petersprc wrote:
Hi,

The third parameter specifies whether the output should be formatted
neatly:

$doc->dump_file('my.xml', false, true);
OK, I guess I missed the 'bool' in the docs. I kept looking for a
bitmask that would go in there.

--Yan
Dec 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joel Witherspoon | last post by:
I'm generating an xml file using PHP DOMXML . I'm able to create and edit the file fine, however the formatting of my file is off. Instead of being the standard xml: <?xml version="1.0"> <root>...
0
by: Joel Witherspoon | last post by:
I'm using: Windows 2k Apache 2.0.47 PHP 4.3.5 I've used PHP for a while with no problems. I've upgraded from 4.3.2 to 4.3.5. Using Apache 2 (I know it's "experimental"), has not presented a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.