xml - XForms repeat - JavaScript error -


i using xforms build web application xml-db exist-db backend. exist transforms xforms code html , javascript.

first of got 2 instances:

<xf:instance xmlns="" id="results">   <result>     <servicedefinition>       <inventorylabel lastchange="2012-01-24">svc380712435</inventorylabel>       <systemname ipaddress="111.222.333.123">xxx</systemname>       <service servicecategory="internetservice">web-server</service>       <osclass operatingsystem="centos">unix</osclass>       <systemtype manufacturer="vmware">vm</systemtype>       <backup/>       <location systemcontact="max power" admingroup="power">n22</location>     </servicedefinition>     ....   </result> </xf:instance>  <xf:instance xmlns="" id="domain">   <system name="xxx">     <nic mac="00-50-56-ae-00-3c"           time="1329167846" missed="1323350247" state="inactive"           ip="111.222.333.123" lan="test"/>   </system>   ... </xf:instance> 

i want build table using xf:repeat iterate through <servicedefinition> elements in 'results' instance. every row contains 'status' column want put related 'state' information 'domain' instance.

this xforms code table:

    <div class="table">     <table border="0">        <thead>           <tr>              <th class="sysname">hostname</th>                   <th class="services">service</th>                   <th class="os">os class</th>                   <th class="location">location</th>                   <th class="link">details</th>                   <th>status</th>                 </tr>               </thead>               <tbody>               <xf:repeat nodeset="instance('results')/result/servicedefinition" id="link-repeat">                 <tr>                   <td class="sysname"><xf:output ref="systemname"  /></td>                   <td>                     <xf:repeat nodeset="service" class="row">                       <div>                         <xf:output ref="."/>                       </div>                     </xf:repeat>                   </td>                   <td class="os"><xf:output ref="osclass"/> </td>                   <td class="location"><xf:output ref="location" /></td>                   <td class="link">                     <xf:trigger submission="view-entry" appearance="minimal" class="url">                       <xf:label>view</xf:label>                       <xf:action ev:event="domactivate">                         <xf:setvalue ref="instance('url-container')"                                     value="concat('servicedetails.xql?svc=', instance('results')/result/servicedefinition[index('link-repeat')]/inventorylabel)"/>                         <xf:load ref="instance('url-container')" />                       </xf:action>                     </xf:trigger>                   </td>                   <td>                   <xf:output ref="instance('domain')/system[@name = instance('results')/result/servicedefinition[index('link-repeat')]/systemname]/nic/@state" />                   </td>                 </tr>                 </xf:repeat>                 </tbody>     </table>     </div> 

the problem seems part:

<td>   <xf:output ref="instance('domain')/system[@name = instance('results')/result/servicedefinition[index('link-repeat')]/systemname]/nic/@state" /> </td> 

is there wrong expression? want state attribute of system matches current node in repeat statement. when load page , 'results'-instance consist of many items javascript error:

a script on page may busy, or may have stopped responding. can stop script now, or can continue see if script complete. script: http://test:8080/exist/xforms/xsltforms/xsltforms.js:771* 

the line (in case 771) differs.

when result instance small (up 20 elements) works expected.

any or suggestion appreciated, new this, please patient.

because xsltforms has own xpath engine written in javascript, browsers might slow evaluate expressions requiring navigate through lot of nodes, old versions of internet explorer.

performance has been improved , should try latest build in svn repository of xsltforms @ sourceforge.net.

using id() function possibility heavily reduce evaluation time.

there xsltforms specific extension indicate whether instance contains readonly data.

did try profiler (press f1 first) have time measures?


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -