REBOL Document

Build-tag - Function Summary


Summary:

Generates a tag from a composed block.

Usage:

build-tag values

Arguments:

values - Block of parens to evaluate and other data. (must be: block)

Description:

Constructs an HTML or XML tag from a block. Words within the block are used to construct the attribute words within the tag. If they are followed by a value, that value will be assigned to the attribute. Parenthesized elements are evaluated as expressions and their resulting value is used.


    print build-tag [font size 3]
    <font size="3">


    print build-tag [font size (10 / 2)]
    <font size="5">


    print build-tag [img src %image.jpg]
    <img src="image.jpg">


    site: http://www.rebol.com/
    main-index: %index.html
    print build-tag [A HREF (join site main-index)]
    <A HREF="http://www.rebol.com/index.html">


    root: %images/
    download: %download1.gif
    alt-download: "Download the Latest REBOL!"
    print build-tag [
        IMG SRC (rejoin [site root download])
        ALT (alt-download)
    ]
    <IMG SRC="http://www.rebol.com/images/download1.gif" ALT="Download 
the Latest REBOL!">

Related:

compose - Evaluates a block of expressions, only evaluating parens, and returns a block.
to-tag


<Back | Index | Next>

Copyright 2004 REBOL Technologies