[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=Hbgj6wqxoxz4s3Vw4aA3NnJBpbBE6kdkeB5v3%2Bo3Mjg%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=U6n2IE3YGMJEt5Lz1wM4Db2m7NoXr5Uy5buUYaPYGPs%3D&reserved=0>
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=HefXTLMAyK0aubXj8WHD1equTdFS5mga8krd2sBuZDQ%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=AsmlUkpPLmT%2Bb6K6UPI1C2EfIMHjWEBjzfYIlj1oyZo%3D&reserved=0>
*** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=jRUdxHxx3O5e%2FyWhqWyUvnduuLNE6H8HOtAkPtgP8hU%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=mn9jtlxzVzKuKGpO%2Bbll2jqV2Q0zR5%2FtoJlCKseMrQA%3D&reserved=0>



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=Hbgj6wqxoxz4s3Vw4aA3NnJBpbBE6kdkeB5v3%2Bo3Mjg%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=U6n2IE3YGMJEt5Lz1wM4Db2m7NoXr5Uy5buUYaPYGPs%3D&reserved=0>
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=HefXTLMAyK0aubXj8WHD1equTdFS5mga8krd2sBuZDQ%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=AsmlUkpPLmT%2Bb6K6UPI1C2EfIMHjWEBjzfYIlj1oyZo%3D&reserved=0>
*** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ctotl%40soton.ac.uk%7C614ba766948d4fce74c308d6fa396d55%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=jRUdxHxx3O5e%2FyWhqWyUvnduuLNE6H8HOtAkPtgP8hU%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7C%7C0065e9f109134c9c6ca008d6fa3b80c6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=mn9jtlxzVzKuKGpO%2Bbll2jqV2Q0zR5%2FtoJlCKseMrQA%3D&reserved=0>


--
Christopher Gutteridge <totl at soton.ac.uk><mailto:totl at soton.ac.uk>
You should read our team blog at http://blog.soton.ac.uk/webteam/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20190626/eb8e5a88/attachment-0001.html