Note that XQuery was designed to *always* generate well-formed XML fragments - which is why it's hardly possible to create arbitrary copy-and-pasted results, as one is used to from other scripting languages. If you still want to do so, you will have to resort to the "text" output method, and compose your results via serialize() and numerous string operations. This is of course possible, but it's somewhat contrary to the original paradigm of XML languages, and XQuery may not be the best language for such a use case. ___________________________
On Wed, May 9, 2012 at 8:24 PM, jidanni@jidanni.org wrote:
"CG" == Christian Grün christian.gruen@gmail.com writes:
The first ruins all brackets it encounters, escaping them.
CG> That's what XML serialization is about; everything else would be CG> invalid. Once again, you may want to switch to "text" as output method CG> to avoid escaping:
CG> http://docs.basex.org/wiki/Serialization
It is a mixed document.
I just need to import my english.html that is created by txt2html.
I need a way to turn of the mangling.
declare namespace atom='http://www.w3.org/2005/Atom'; declare option db:parser "html"; declare option db:htmlopt "method=html,nons=true"; declare option output:method "html"; declare option output:version "4.01"; declare option output:doctype-public "-//W3C//DTD HTML 4.01//EN"; declare option output:doctype-system "http://www.w3.org/TR/html4/strict.dtd"; declare option output:include-content-type "yes";
<html lang="zh-tw"> <head> <title>jidanni2 YouTube™ 播放清單 playlists</title> </head> <body> {file:read-text("english.html")} <h1> <a href="http://www.youtube.com/user/jidanni2">jidanni2 YouTube™</a> 播放清單 playlists</h1> <ol> <li> <a href="http://www.youtube.com/playlist?list=LLu1NBeZA_KwhPyXJKLAfDsQ">[喜歡的影片 Liked videos]</a> </li> { for $e in doc("playlists.xml")/atom:feed/atom:entry, $t in $e/atom:title/text() where $t ne "testing" order by $t return <li> <a href="{$e/atom:link[@rel="alternate"][@type="text/html"]/@href}">{$t}</a> </li> } </ol> <hr/> <address> <a href="../index.html">積丹尼</a>(<a href= "../index_en.html">Dan Jacobson</a>) </address> <p>Updated {adjust-date-to-timezone(current-date(), ())} 製</p> </body> </html>