Quiq
view release on metacpan or search on metacpan
lib/Quiq/Html/Tag.pm view on Meta::CPAN
my %DefaultAttributesXhtml = (
html => [xmlns=>'http://www.w3.org/1999/xhtml'],
);
# Liste aller Attribute und ihrer Domänen.
# FIXME: anhand DTD überprüfen
my %Attribute = (
'accept-charset' => 'charsets', # form
'http-equiv' => 'cdata', # meta
'xml:lang' => 'languageCode', # I18N (XHTML)
'xml:space' => 'space', # ENUM pre,script,style(XHTML)
abbr => 'text', # Cell
accept => 'contentTypes', # form,input
accesskey => 'character', # Focus,legend
action => 'uri', # form
align => 'cellAlign', # ENUM CellAlign
alt => 'cdata', # input(cdata);area,img(text)
archive => 'uriList', # object
axis => 'cdata', # Cell
border => 'pixels', # table
cellpadding => 'length', # table
cellspacing => 'length', # table
char => 'character', # CellAlign
charoff => 'length', # CellAlign
charset => 'charset', # a,link,script
checked => 'bool', # input
cite => 'uri', # blockquote,del,ins,q
class => 'class', # Core
classid => 'uri', # object
codebase => 'uri', # object
codetype => 'contentType', # object
cols => 'multiLengths', # frameset(multiLengths),textarea(number)
colspan => 'number', # Cell
content => 'cdata', # meta
coords => 'coords', # a, area
data => 'uri', # object
datetime => 'datetime', # del, ins
declare => 'bool', # object
defer => 'bool', # script
dir => 'dir', # ENUM I18N
disabled => 'bool', # button,input,optgroup,option,select,
# textarea
download => 'filename', # a
enctype => 'contentType', # form
lib/Quiq/Html/Tag.pm view on Meta::CPAN
onselect => 'script', # input,textarea
onsubmit => 'script', # form
onunload => 'script', # body,frameset
profile => 'uri', # head
readonly => 'bool', # input,textarea
rel => 'linkTypes', # ENUM a,link
rev => 'linkTypes', # ENUM a,link
rows => 'multiLengths', # frameset(multiLengths);textarea(number)
rowspan => 'number', # Cell
rules => 'trules', # ENUM table
scheme => 'cdata', # meta
scope => 'scope', # ENUM Cell
scoped => 'bool', # style
scrolling => 'scrolling', # ENUM frame,iframe
selected => 'bool', # option
shape => 'shape', # ENUM a,area
size => 'number', # input,select
span => 'number', # col,colgroup
src => 'uri', # frame,iframe,img,input,script
standby => 'text', # object
style => 'styleSheet', # Core
summary => 'text', # table
tabindex => 'number', # Focus,object,select
target => 'frameTarget', # a,area,base,form,link
title => 'text', # Core,style
type => 'ContentType', # button(ENUM);a,link,object,param,script,
# style;input(ENUM)
usemap => 'uri', # img,input,object
valign => 'cellValign', # ENUM CellAlign
value => 'cdata', # button,input,option,param
valuetype => 'valueType', # ENUM param
width => 'length', # iframe,img,object,table(length);
# col,colgroup(multiLength)
xmlns => 'uri', # html (XHTML)
);
# Attribut-Domänen (werden aktuell nicht geprüft)
my %Domain = (
bool => 1,
buttonType => [qw/button reset submit/],
cdata => 1,
cellAlign => [qw/center char justify left right/],
cellValign => [qw/baseline bottom middle top/],
character => 1,
charset => 1,
charsets => 1,
class => 1,
contentType => 1,
contentTypes => 1,
coords => 1,
datetime => 1,
lib/Quiq/Html/Tag.pm view on Meta::CPAN
<TAG ...></TAG>
=item 'M' (multiline, ohne Einrückung)
Wie 'm', nur ohne Einrückung (html, ...)
<TAG ...>
CONTENT
</TAG>\n
=item 'c' (cdata)
Wie 'm', nur dass der Content in CDATA eingefasst wird:
<TAG ...>
// <![CDATA[
CONTENT
// ]]>
</TAG>
Der W3 HTML Validator bemängelt die Zeichen & und > dann nicht
lib/Quiq/Tag.pm view on Meta::CPAN
Der Hash muss nicht jedes Element definieren. Nicht-vorkommende
Elemente gemäà Default-Formatierung formatiert (siehe -fmt)
besitzen keine Default-Attribute.
=item -fmt => 'c'|'e'|'E'|'i'|'m'|'p'|'P'|'v' (Default: gemäà $elem)
Art der Content-Formatierung.
=over 4
=item 'c' (cdata):
Wie 'm', nur dass der Content in CDATA eingefasst wird
(in HTML: script):
<TAG ...>
// <![CDATA[
CONTENT
// ]]>
</TAG>\n
( run in 0.626 second using v1.01-cache-2.11-cpan-454fe037f31 )