PDA

View Full Version : Filtering and pretty-print to XML code / For the forums


taboca
09-10-2003, 01:04 AM
When someone copy and paste a piece of XML, you could parse it to look nice! pretty print!;)

antun
09-10-2003, 08:14 AM
Inside the forums? You could use the special code tag to preserve whitespace. See here:

http://www.laszlosystems.com/developers/community/forums/misc.php?action=bbcode#buttons

-Antun

compunuke
05-23-2005, 11:48 AM
What about "pretty print" in a multiline text component?

If a text component is bound to an XML at the root or a fragment consisting of a hierarchy of nodes, is there some way to, at least, have carriage returns and indentation, if not colored tags?

I have been experimenting with adding \n explicitly in the returned string. This produces "bad XML" in that the \n is both interpreted to cause carriage returns and also left in the string that appears in the text element.

Also, use of a <pre> wrapper around the XML doesn't seem to have any effect. The <pre> and </pre> tags appear in the text but do not function.

ilanToren
06-17-2005, 06:13 AM
Actually this is something of deficit. You'd like a component to display html so that if you specify something like

<text datapath="content/text()" resize="yes" />

Even if content has the text in a CDATA you won't see the <a href=""></a> as a tag you can actually use. So you need a embedded parser to pre-format your content then have the parser embed the markup into the text component. I think this is possible and that there is a javascript yacc like parser in opensource. Maybe next week