Subject: | No method to create XML::LibXML::Element's directly. |
It's impossible to create XML::LibXML::Element objects, not attached to
document.
E.g. this code does not work:
perl -MXML::Declare -E '$el = element "hello" => "world"; say $el-
Show quoted text
>toString(1);'
Undefined subroutine &XML::Declare::element called at -e line 1.
And this works:
perl -MXML::Declare -E '$el = doc { element "hello" => "world"; }; say
$el->toString(1);'
<?xml version="1.0" encoding="utf-8"?>
<hello>world</hello>
But if i only want a 'hello' element, there is no way to create it
directly.