Question - Xquery with Basex

Monday, 24 February 2014 · 2 messages
EE
eitan elmalam24 Feb 2014 08:06 #
Hi, I execute the follow query
for $x in doc('input.xml')//App//package//comment() return $x
on the follow XML file
<?xml version="1.0" encoding="UTF-8"?>
<App name="BasexTest_1">
 <package name="main/resources/xml">
    <!-- dd -->
    <!-- ff -->
  <file name="input.xml"></file>
 </package>
  <!-- ff -->
 <package name="org/basex/examples/local">
  <file name="RunCommands.java"></file>
    <!-- dd -->
    <!-- ff -->
 <folder>lib</folder></package>
</App>
And I expect to get the comment but the resault is empty , why ? Thanks Eitan Elmalam
AH
Alexander Holupirek24 Feb 2014 09:00 #
Quoted text · eitan elmalam · 28 lines
On 24.02.2014, at 08:06, eitan elmalam <eitan.elmalam at gmail.com> wrote: > Hi, > > I execute the follow query > > for $x in doc('input.xml')//App//package//comment() return $x > > on the follow XML file > > <?xml version="1.0" encoding="UTF-8"?> > <App name="BasexTest_1"> > <package name="main/resources/xml"> > <!-- dd --> > <!-- ff --> > <file name="input.xml"></file> > </package> > <!-- ff --> > <package name="org/basex/examples/local"> > <file name="RunCommands.java"></file> > <!-- dd --> > <!-- ff --> > <folder>lib</folder></package> > </App> > > And I expect to get the comment but the resault is empty , why ? > > Thanks > Eitan Elmalam
let $doc :=
<App name="BasexTest_1">
 <package name="main/resources/xml">
    <!-- dd -->
    <!-- ff -->
  <file name="input.xml"></file>
 </package>
  <!-- ff -->
 <package name="org/basex/examples/local">
  <file name="RunCommands.java"></file>
    <!-- dd -->
    <!-- ff -->
 <folder>lib</folder></package>
</App>
for $x in $doc//package//comment()
return $x

⚡Generated with XQuery