~parse-xml
[1/2] from: dvydra2::yahoo::com at: 22-Jan-2001 18:04
is there a function that reverses parse-xml; builds
xml from the block?
regards
david
example:
s: "<a>Hello</a>"
parse-xml s => [document none [["a" none ["Hello"]]]]
[2/2] from: al:bri:xtra at: 23-Jan-2001 20:52
David Vydra wrote:
> is there a function that reverses parse-xml; builds xml from the block?
Not quite, but there is:
>> unit %/c/Rebol/units/HTML.r
== true
>> print HTML [
[ Title "My title here."
[ body
[ H1 "A header"
[ IP "Initial paragraph"
[ P "Subsequent paragraph."
[ ]
<html>
<head>
<title>My title here.</title>
</head>
<body>
<h1>A header</h1>
<p class="Initial">Initial paragraph</p><p>Subsequent paragraph.</p></body>
</html>
>>
Or better is:
>> unit %/c/Rebol/Units/eText.r
== true
>> print HTML eText {My title here
{
{ A inital paragraph
{
{ Subsequent paragraph.
{ }
<html>
<head>
<title>My title here</title>
<link rel="stylesheet" href="eText.css" type="text/css">
</head>
<body>
<h1><a name="My_title_here">My title here</a></h1>
<p class="Initial">A inital paragraph
</p><p>Subsequent paragraph.
</p></body>
</html>
These scripts are available from my site:
http://members.nbci.com/AndrewMartin/Rebol/Rebol.zip
I hope that helps!
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/