##############################################
# $Id$
package main;
use strict;
use warnings;
use POSIX;
sub CommandXmlList($$);
sub XmlEscape($);
#####################################
sub
XmlList_Initialize($$)
{
my %lhash = ( Fn=>"CommandXmlList",
Hlp=>",list definitions and status info as xml" );
$cmds{xmllist} = \%lhash;
}
#####################################
sub
XmlEscape($)
{
my $a = shift;
return "" if(!defined($a));
$a =~ s/\\\n/
/g; # Multi-line
$a =~ s/&/&/g;
$a =~ s/"/"/g;
$a =~ s/</g;
$a =~ s/>/>/g;
# Not needed since we've gone UTF-8
# $a =~ s/([^ -~])/sprintf("%02x;", ord($1))/ge;
# Esacape characters 0-31, as they are not part of UTF-8
$a =~ s/(\x00-\x19)//g;
return $a;
}
#####################################
sub
CommandXmlList($$)
{
my ($cl, $param) = @_;
my $str = "
xmllist [devspec]
fhem> xmllist
<FHZINFO>
<internal_LIST>
<internal name="global" state="internal" sets=""
attrs="room configfile logfile ...">
<INT key="DEF" value="<no definition>"/>
<INT key="NR" value="0"/>
<INT key="STATE" value="internal"/>
[...]
=end html
=cut