EPrints Technical Mailing List Archive

Message: #07903


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Insert an html to dom (HIERARCHY_REQUEST_ERR) in eprint_render


There is but we're back to deep memory for me so I gotta check the source code!

All DOM elements belong to a document and if you parse a string, that's a new document.

To get around this there's

$node = $repository->xml->clone( $source_node )

and

$fragment = $repository->xml->contents_of( $source_node )

these make copies of the whole node, or the contents of the node and these copies are owned by the DOM EPrints uses (if I recall it uses one big DOM document internally, and only converts to new documents on output.


On 26/06/2019 14:22, Yuri via Eprints-tech wrote:
Any idea? I'm starting the tediuos process of "->make_element
->appendChild"...

Il 26/06/19 11:42, Yuri via Eprints-tech ha scritto:
Hi!

   eprint_render here.

   I'm really bored of doing ->make_element ->appendChild to create an
html, so long and takes ages for a programmer (impossible for a
user/integrator). Is there another way? I've tried with

   my $citehtml = "<html here>";
   my $citexml = EPrints::XML::parse_string( undef, $citehtml );
   $citfrag->appendChild($citexml);

but it returns

appendChild: HIERARCHY_REQUEST_ERR

is there a way, for example to render something (xpage like) and insert
it in the dom?


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url="">
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url="">
*** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url="">
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url="">
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url="">
*** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url="">
-- 
Christopher Gutteridge <totl@soton.ac.uk> 
You should read our team blog at http://blog.soton.ac.uk/webteam/