NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_tagelement(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_tagelement - Find the value of an attribute in an HTML element.

Table Of Contents

Synopsis

Description

This command takes a string containing an HTML element, tag, and searches it for the specified attribute. If the attribute is found, its value is returned. If the attribute is not found, an empty string is returned. If the attribute's value is surrounded by double quotes, they will be removed.

COMMANDS

ns_tagelement tag attribute

EXAMPLES

 % set tag {<img height=150 border=0 class="c1 c2" src='me.jpg'>}
 <img height=150 border=0 class="c1 c2" src='me.jpg'>
 
 % ns_tagelement $tag id
 
 % ns_tagelement $tag border
 150
 
 % ns_tagelement $tag class 
 c1 c2
 
 % ns_tagelement $tag src
 'me.jpg'

NOTES

Is not removing single quotes surrounding the value a bug?

See Also

nsd

Keywords

ns_tagelementset