DOMIT! v 0.1 Tutorial
<<    index    >>
1    2    3    4    5    6    7    8    9    10    11    12    13    14    15   
16    17    18    19    20    21    22    23    24    25    26   
toString and toNormalizedString

If you wish to generate a text representation of a DOMIT_Document or DOMIT_Node -- and all nodes in the hierarchy below -- two methods are available:

toString prints out an unformatted string representation. No whitepace or newlines are added to enhance readability:

echo $cdCollection->toString();

returns:

<cdlibrary><cd id="0001">
<name>Robbie Fulks</name>
<title>Couples in Trouble</title></cd>
<cd id="0002"><name>Richard Thompson</name>
<title>Mock Tudor</title></cd><cd id="0003">
<name>Keller Williams</name>
<title>Laugh</title></cd></cdlibrary>

toNormalizedString prints out a formatted string representation, with whitepace and newlines added to enhance readability:

echo $cdCollection->toNormalizedString();

returns:

<cdlibrary>
	<cd id="0001">
		<name>Robbie Fulks</name>
		<title>Couples in Trouble</title>
	</cd>
	<cd id="0002">
		<name>Richard Thompson</name>
		<title>Mock Tudor</title>
	</cd>
	<cd id="0003">
		<name>Keller Williams</name>
		<title>Laugh</title>
	</cd>
</cdlibrary>

Note that toNormalizedString requires the file xml_domit_utilities.php to be present in the same directory as xml_domit_parser.php.


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.