The toStr is used for return just the start element to make it useful for debugging. If you want to write the whole document or XML element to a string:
Thank you very much, Brian. But in deep-discussion, is it natural? Why do you choose that xml.toStr contain only
"<?xml version='1.0'?>"
and not its whole contents as Str? If we espect that Object.toStr why a subobject (xml) does not behaves this way?
Thanks,
brianThu 8 Mar 2012
If we espect that Object.toStr why a subobject (xml) does not behaves this way?
Actually convention is that all objects work this way where toStr provides a single line of debugging information but doesn't necessarily dump the full object if has many lines. Fpr example Err.toStr shows the type and msg, but doesn't return entire stack trace.
Xan Wed 7 Mar 2012
Hi,
I use this example (citing in xml)
I want to modify it: replace doc.write(Env.cur.out) to doc.toStr But doc.toStr only writes:
Why? How to get the doc as string?
Any suggestions?
Thanks in advance, Xan.
brian Wed 7 Mar 2012
The toStr is used for return just the start element to make it useful for debugging. If you want to write the whole document or XML element to a string:
Xan Thu 8 Mar 2012
Thank you very much, Brian. But in deep-discussion, is it natural? Why do you choose that xml.toStr contain only
and not its whole contents as Str? If we espect that Object.toStr why a subobject (xml) does not behaves this way?
Thanks,
brian Thu 8 Mar 2012
Actually convention is that all objects work this way where
toStr
provides a single line of debugging information but doesn't necessarily dump the full object if has many lines. Fpr exampleErr.toStr
shows the type and msg, but doesn't return entire stack trace.