XForms를 사용하여 XML-DB eXist-db를 백엔드로 사용하여 웹 응용 프로그램을 작성하고 있습니다. eXist는 XForms 코드를 HTML 및 JavaScript로 변환합니다. 나는 '결과'인스턴스의 모든 <ServiceDefinition>
요소를 통해 반복하는 xf:repeat
을 사용하여 테이블을 구축하고자XForms repeat - JavaScript 오류
<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>
: 모든
우선 두 개의 인스턴스를 얻었다. 모든 행에는 '도메인'인스턴스에서 관련된 '상태'정보를 넣으려는 '상태'열이 있습니다. 이 표현에 문제가
<td>
<xf:output ref="instance('domain')/system[@name = instance('results')/result/ServiceDefinition[index('link-repeat')]/SystemName]/NIC/@state" />
</td>
있습니까 :
<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>
문제는이 부분 것 같다 :
이 테이블에 대한 XForms를 코드는? repeat 문에서 현재 노드와 일치하는 시스템의 상태 속성을 가져 오려고합니다. 항상 다르다 (이 경우 771에서)
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: http://test:8080/exist/xforms/xsltforms/xsltforms.js:771*
라인 : 나는 페이지와 'results' 인스턴스가 많은 항목으로 구성로드 할 때 그러나 나는 자바 스크립트 오류가 발생합니다.
결과 인스턴스가 매우 작 으면 (약 20 개까지) 예상대로 작동합니다.
도움이나 제안이 감사합니다.