error message

Monday, 28 May 2012 · 2 messages
CG
Christian Grünin reply to Brown, David (SSC-A), 28 May 2012, 23:0828 May 2012 21:25 #
Dear David, do you have a reproducible example, or at least a full stack trace? Otherwise, it may get tough for us to track down the problem. Christian
Quoted text · David (SSC-A) · 172 lines
On Mon, May 28, 2012 at 9:08 PM, Brown, David (SSC-A) <david.k.brown1 at navy.mil> wrote: > The first 8 characters of the root is a folder name. I want to group by > folder name. I simplified the xquery to eliminate the collateral > interactions, but still receive this error. > > > > p.s. I was able to get bindings working using quotes: > > open C4;set QUERYPATH c:\dev\xq;set bindings "$date=20120507, > $envir=PRD_Win" > > > > Source scheme: > > <20120507/PRD_Win.nessus> > > <NessusClientData_v2> > > <Policy> > > <Report> > > <ReportHost> > > < ReportItem> > > > > ------------------- > > Query: declare variable $date external; > > <results> > > { > > for $x in //Report/ReportHost/ReportItem > > let $src := fn:root($x) > > return > > <summary> > > <source>substring(fn:name({$src}),1,8)</source> > > </summary> > > }</results> > > Query plan: > > <QueryPlan> > > <VarStack> > > <Var name="$date" id="0"> > > <Atm value="20120507" type="xs:untypedAtomic"/> > > </Var> > > <Var name="$envir" id="1"> > > <Atm value="PRD_Win" type="xs:untypedAtomic"/> > > </Var> > > </VarStack> > > <CElem> > > <QNm value="results" type="xs:QName"/> > > <FLWR> > > <For var="$x"> > > <AxisPath> > > <DBNodeSeq size="28"> > > <DBNode name="C4" pre="0"/> > > <DBNode name="C4" pre="21934"/> > > <DBNode name="C4" pre="74441"/> > > <DBNode name="C4" pre="121967"/> > > <DBNode name="C4" pre="145433"/> > > </DBNodeSeq> > > <IterStep axis="descendant" test="Report"/> > > <IterStep axis="child" test="ReportHost"/> > > <IterStep axis="child" test="ReportItem"/> > > </AxisPath> > > </For> > > <Let var="$src"> > > <FNNode name="root([node])"> > > <VarRef> > > <Var name="$x" id="3"/> > > </VarRef> > > </FNNode> > > </Let> > > <Return> > > <CElem> > > <QNm value="summary" type="xs:QName"/> > > <CElem> > > <QNm value="source" type="xs:QName"/> > > <Str value="substring(fn:name(" type="xs:string"/> > > <VarRef> > > <Var name="$src" id="4"/> > > </VarRef> > > <Str value="),1,8)" type="xs:string"/> > > </CElem> > > </CElem> > > </Return> > > </FLWR> > > </CElem> > > </QueryPlan> > > Error: Improper use? Potential bug? Your feedback is welcome: > > Contact: basex-talk at mailman.uni-konstanz.de > > Version: BaseX 7.2.2 beta > > Java: Oracle Corporation, 1.7.0 > > OS: Windows 7, amd64 > > Stack Trace: > > java.lang.ArrayIndexOutOfBoundsException > > > > v/r, > > David Brown
BS
Brown, David (SSC-A)28 May 2012 23:08 #
The first 8 characters of the root is a folder name. I want to group by folder name. I simplified the xquery to eliminate the collateral interactions, but still receive this error. p.s. I was able to get bindings working using quotes:
open C4;set  QUERYPATH c:\dev\xq;set bindings "$date=20120507,
$envir=PRD_Win"
Source scheme:
<20120507/PRD_Win.nessus>

       <NessusClientData_v2>

  <Policy>

  <Report>

       <ReportHost>
< ReportItem> ------------------- Query: declare variable $date external;
<results>

{

for $x in //Report/ReportHost/ReportItem

  let $src := fn:root($x)
return
                                             <summary>

      <source>substring(fn:name({$src}),1,8)</source>

                                             </summary>
}</results> Query plan:
<QueryPlan>

  <VarStack>

    <Var name="$date" id="0">

      <Atm value="20120507" type="xs:untypedAtomic"/>

    </Var>

    <Var name="$envir" id="1">

      <Atm value="PRD_Win" type="xs:untypedAtomic"/>

    </Var>

  </VarStack>

  <CElem>

    <QNm value="results" type="xs:QName"/>

    <FLWR>

      <For var="$x">

        <AxisPath>

          <DBNodeSeq size="28">

            <DBNode name="C4" pre="0"/>

            <DBNode name="C4" pre="21934"/>

            <DBNode name="C4" pre="74441"/>

            <DBNode name="C4" pre="121967"/>

            <DBNode name="C4" pre="145433"/>

          </DBNodeSeq>

          <IterStep axis="descendant" test="Report"/>

          <IterStep axis="child" test="ReportHost"/>

          <IterStep axis="child" test="ReportItem"/>

        </AxisPath>

      </For>

      <Let var="$src">

        <FNNode name="root([node])">

          <VarRef>

            <Var name="$x" id="3"/>

          </VarRef>

        </FNNode>

      </Let>

      <Return>

        <CElem>

          <QNm value="summary" type="xs:QName"/>

          <CElem>

            <QNm value="source" type="xs:QName"/>

            <Str value="substring(fn:name(" type="xs:string"/>

            <VarRef>

              <Var name="$src" id="4"/>

            </VarRef>

            <Str value="),1,8)" type="xs:string"/>

          </CElem>

        </CElem>

      </Return>

    </FLWR>

  </CElem>

</QueryPlan>
Error: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.2.2 beta Java: Oracle Corporation, 1.7.0 OS: Windows 7, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException v/r, David Brown Fully Qualified Navy Certification Agent LSS Certified Blackbelt, CISSP, NSA-IAM/IEM, MSCIS SPAWARSYSCEN ATLANTIC ISS LOB SSC Lead Email: <mailto:david.k.brown1 at navy.mil> david.k.brown1 at navy.mil Phone: 843.218.6227 DSN: 588.6227 Fax: 843.218.5461 "Let us not look back in anger or forward in fear, but around in awareness." James Thurber

⚡Generated with XQuery