<tag></tag> vs <tag/>

Friday, 1 February 2013 · 4 messages
MF
marco fregonese1 Feb 2013 14:28 #
Hi there, I have to return from a query tags like this:
<script></script>
not self closing tags like this:
<script/>
Is there any way to do that in BaseX? Thanks.
AW
Andreas Weiler1 Feb 2013 14:35 #
This workaround produces the output:
copy $c := <script>{" "}</script>
modify (
replace value of node $c with ""
)
return $c
-- Andreas
Quoted text · marco fregonese · 18 lines
Am 01.02.2013 um 14:28 schrieb marco fregonese: > Hi there, > > I have to return from a query tags like this: > > <script></script> > > not self closing tags like this: > > <script/> > > Is there any way to do that in BaseX? > > Thanks. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
AB
Andy Bunce1 Feb 2013 14:54 #
If this is for output you might consider using the xhtml or html serialization options [1] E.g.
declare option output:method "xhtml";
<script/>
Will output <script></script> /Andy [1] http://docs.basex.org/wiki/Serialization
Quoted text · Andreas Weiler · 37 lines
On Fri, Feb 1, 2013 at 1:35 PM, Andreas Weiler < andreas.weiler at uni-konstanz.de> wrote: > This workaround produces the output: > > copy $c := <script>{" "}</script> > modify ( > replace value of node $c with "" > ) > return $c > > -- Andreas > > Am 01.02.2013 um 14:28 schrieb marco fregonese: > > > Hi there, > > > > I have to return from a query tags like this: > > > > <script></script> > > > > not self closing tags like this: > > > > <script/> > > > > Is there any way to do that in BaseX? > > > > Thanks. > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
MF
marco fregonesein reply to Andreas Weiler, 1 Feb 2013, 14:351 Feb 2013 14:56 #
Hi Andreas, thank you for answering. I'm using BaseXGUI 7.5. Probrably I misunderstood your suggestion, but if I try:
let $c := <script>{""}</script>
return $c
It still returns <script/> and not <script></script>. I need to point an external script file from my html file but I can't use a self closing script tag (e.g. <script type="text/javascript" src="script/myjsfile.js"/>) otherwise the bowser can't parse the html file properly. Thanks anyway. 2013/2/1 Andreas Weiler <andreas.weiler at uni-konstanz.de>
Quoted text · Andreas Weiler · 31 lines
> This workaround produces the output: > > copy $c := <script>{" "}</script> > modify ( > replace value of node $c with "" > ) > return $c > > -- Andreas > > Am 01.02.2013 um 14:28 schrieb marco fregonese: > > > Hi there, > > > > I have to return from a query tags like this: > > > > <script></script> > > > > not self closing tags like this: > > > > <script/> > > > > Is there any way to do that in BaseX? > > > > Thanks. > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >

⚡Generated with XQuery