[EMAIL PROTECTED] wrote:
>
> ANDREW,
>
> here's a quickly knocked up function to make XML from a block of REBOL values.
>
> Note the value block should contain 'tag 'value 'tag2 'value2 etc etc.
>
> anyway here's the func.
>
> xml-maker: func [ block [block!]] [
>
> if not even? (length? block) [ make error! "Imbalance Between Tags & Values"]
>
> block: reduce block
>
> output-block: []
>
> count: (length? block) / 2
>
> loop count [ tag: to-tag pick block 1 block: next block value: pick block 1 block:
>next block
>
> append output-block reduce [tag value tag]
>
> ]
>
> return output-block
>
> ]
>
> >> xml-maker [ 'red 255.0.0 'green 0.255.0 'blue 0.0.255 ]
> == [<red> 255.0.0 <red> <green> 0.255.0 <green> <blue> 0.0.255 <blue>]
> >> xml-maker [ 'red 255.0.0 'green 0.255.0 'blue ]
> ** User Error: Imbalance Between Tags & Values.
> ** Where: make error! "Imbalance Between Tags & Values"
Where are the closing tags? This would never pass a validation. :)
Deryk
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.