给为大神们求指教,这是什么输出方式啊??或者这是指什么?帮忙解释一下,谢谢
<XML id="gridConfig">
<Config>
<BasicData>test.xml</BasicData>
<Condition />
<!-- 
 o.status,o.groupflag,o.orderno,
f.totalcost,f.fileno,
o.contact,o.adultnum adultnum,o.childnum,o.infantnum,ac.name as seatstatus,o.bookagentname
 -->
<ColumnName>订单编号,状态,团队,总结算价,批文号,联系人,成人,儿童,婴儿,销售单位</ColumnName>
<RowHeight>21</RowHeight>
<Page>
<pageMode>NoPaging</pageMode>
<Server><CountPerPage>16</CountPerPage></Server>
</Page>
<Event><Selection>doselectionchanged</Selection><Enter>doOpen</Enter><Delete></Delete>
<valueIndex>0</valueIndex></Event>
<Modify>
<Column>
<No>1</No>
<Rule>
<![CDATA[
var v = @value.toString().toUpperCase().replace(/\s/g,"");
if(v == 'N') return '未提交';
else if(v == 'S') return '已提交未确认'; 
else if(v == 'L') return '里程支付中'; 
else if(v == 'M') return '里程支付成功'; 
else if(v == 'C') return '已确认未支付'; 
else if(v == 'P') return '已确认正在支付'; 
else if(v == 'B') return '已支付未出票'; 
else if(v == 'T') return '已支付未出票'; 
else if(v == 'O') return '已支付未出票';  
else if(v == 'R') return '已支付未出票'; 
else if(v == 'E') return '已支付已出票'; 
else if(v == 'D') return '已取消';
else return "$value";
]]>
</Rule>
</Column>
<Column>
<No>2</No>
<Rule>
<![CDATA[
if(@value == '1' ) return '团队'
else if(@value == '0' || @value=='' ) return '散客'
]]>
</Rule>
</Column>
<Column>
<No>0</No>
<Rule>
<![CDATA[ 
var v = @value.toString().toUpperCase().replace(/\s/g,"");
return "<a href=\"javascript:doOpen()\">"+v+"</a>";
]]>
</Rule>
</Column>
</Modify>
</Config></XML>

解决方案 »

  1.   

    <![CDATA[ ....]]>就这个标记看不明白吧。
    这是定义XML中不作转义处理的文本块,解析时,直接把这部份内容作为XML的解析内容。比如
    <![CDATA[ 
    var v = @value.toString().toUpperCase().replace(/\s/g,"");
    return "<a href=\"javascript:doOpen()\">"+v+"</a>";
    ]]>
    在这里嵌套了一段JavaScript的代码。我想你的WEB服务器上应该有XSLT转换工具之类的东东,最终会把这个XML文档翻译成前端的响应。想这种东东应该指某个记录字段的某条记录的值。
      

  2.   

    曾经XML页面想要把HTML干掉
    靠的就是XML+XSL的结构,XML负责提供数据,XSL负责解析数据构成页面
    其实就是个MODEL-VIEW结构然后...就没有然后了...
    XML依然只是作为数据传递使用,XSL连熬出头的希望都看不到
      

  3.   

    现在我是通过xsql查询传递参数的,我实在是看不懂,他们是从那里获取到的数据,然后怎么输出的。再给我看看,谢谢了.
    <BODY style="MARGIN-TOP: 5px; MARGIN-LEFT: 5px;MARGIN-BOTTOM:5px">
    <TABLE cellSpacing="0" cellPadding="0" width="100%" ID="queryform">
    <TR>
    <TD align="center">
    <table style="BORDER-COLLAPSE: collapse;width:98%" borderColor="#6595d6" cellSpacing="0"
    cellPadding="3" border="1">
    <tr align="middle">
    <td class="tr1" colSpan="6">客票订单查询</td>
    </tr>
    <tr nowrap="true">
    <td class="tr3" width="11%">订单日期</td>
    <td width="28%">
    <input class="dateTimePicker common_textarea" style="cursor:hand;" name="createStartDate"
    id="createStartDate" size="14"><img src="/ECS/common/images/calendar.gif" height="21" width="25" align="absMiddle" style="cursor:hand" onclick="previousSibling.click()"/>

    <input class="dateTimePicker common_textarea" name="createEndDate" id="createEndDate" style="cursor:hand;" size="14"><img src="/ECS/common/images/calendar.gif" height="21" width="25" align="absMiddle" style="cursor:hand" onclick="previousSibling.click()"/>
    </td>
    <td class="tr3" width="11%">订单编号</td>
    <td width="17%">
    <input class="common_textarea" reg="" check upper size="15" style="width:100px" name="orderno" id="orderno">
    </td>
    <td class="tr3" width="11%">PNR</td>
    <td width="16%">
    <input class="common_textarea" style="width:100px" name="pnrno" check upper reg="EnName"
    maxLength="6" size="8" id="pnrno">
    </td>
    </tr>
    <tr id="advancedQuery" style="display:none">
    <td class="tr3" width="11%">航班日期</td>
    <td>
    <input class="dateTimePicker common_textarea" style="cursor:hand;" name="depStartTime"
    id="depStartTime" size="14"><img src="/ECS/common/images/calendar.gif" height="21" width="25" align="absMiddle" style="cursor:hand" onclick="previousSibling.click()"/>
    至 <input style="cursor:hand;" class="dateTimePicker common_textarea" id="depEndTime"
    name="depEndTime" size="14" /><img src="/ECS/common/images/calendar.gif" height="21" width="25" align="absMiddle" style="cursor:hand" onclick="previousSibling.click()"/>
    </td>
    <td class="tr3" width="11%">航班号</td>
    <td width="17%"><input class="common_textarea" style="width:100px" name="flightno" id="flightno"></td>
    <td class="tr3" width="11%">订单状态</td>
    <td width="16%"><select class="common_textarea" name="status" style="width:100px" id="status">
    <option value="" selected>所有状态</option>
    <!--  -->
    <option value="1">未提交</option>
    <option value="2">已提交未确认</option>
    <option value="8">里程支付中</option>
    <option value="9">里程支付成功</option>
    <option value="3">已确认未支付</option>
    <option value="4">已确认正在支付</option>
    <option value="5">已支付未出票</option>
    <option value="6">已支付已出票</option>
    <option value="7">已取消订单</option>
    </select>
    </td>
    </tr>
    <tr>
    <td id="advancedQuery" style="display:none" width="11%" class="tr3">订单类型</td>
    <td id="advancedQuery" style="display:none" width="17%">
    <select class="common_textarea" name="orderFlag" style="width:85px" id="orderFlag">
    <option value="" selected>所有</option>
    <option value="B">B2B</option>
    <option value="C">B2C</option>
    </select>
    </td>
                                <td id="advancedQuery" style="display:none"  width="10%" class="tr3">代理点范围</td>
                       <td id="advancedQuery" style="display:none">
                       <select class="common_textarea" name="containjunior" id="containjunior" style="width:100px">
                                  <option value="Y" selected>本部及所有下属</option>
                       <option value="N">本部</option>
                               </select>
                       </td>
                   <td id="advancedQuery" style="display:none" width="10%" class="tr3" >销售单位</td>
                   <td id="advancedQuery" style="display:none">
                         <input type="text" id="agentname" name="agentname" size="37" onclick = "findOrgOrder(agentname,agentid)" readOnly style="cursor:hand;width:100px" value="<%=departName%>">
                         <input type="hidden" id="agentid" name="agentid" value="<%=departID%>">
                      </td>
    <td id="baseQuery"  colspan="6" align="center">
      <input type="button" name="票价确认" value="票价确认" onclick="quickQuery('2')" class="button"> 
      <input type="button" name="支付" value="支付" onclick="quickQuery('3')" class="button">
    </td>

    </tr>
                            <tr>
                                 <td align="center" colspan="6" >
    <table height="23" border="0" align="center" cellpadding="0" cellspacing="0" id="Table5">
    <tr>
          <td width="300">
          <label for="QueryType1" style="cursor:hand"><input type="radio" id="QueryType1" name="QueryModel" value="N" onclick="changeQueryMode(this)" checked>简单查询</label>
       <label for="QueryType2" style="cursor:hand"><input type="radio" id="QueryType2"  name="QueryModel" value="Y" onclick="changeQueryMode(this)">高级查询</label>
        查询记录数:
       <select name="orderRowNum" id="orderRowNum">
         <option value="100"selected>100</option>
         <option value="200">200</option>
         <option value="300">300</option>
         <option value="500">500</option>
      
        </select></td>
    <td vAlign="bottom" noWrap="true">
    <table height="23" border="0" cellPadding="0" cellSpacing="0" id="Table6">
    <tr nowrap="true">
    <td class="openWin_toolbar_1"></td>
    <td class="openWin_toolbar_2"><a class="openWin_toolbar_LINK"
    onclick="doQuery(); return false;" href="#">查询</a></td>
    <td class="openWin_toolbar_3"></td>
    </tr>
      </table>
    </td>
    <td>&nbsp;&nbsp; </td>
    <td vAlign="bottom" noWrap="true">
    <table height="23" border="0" cellPadding="0" cellSpacing="0" id="Table7">
    <tr nowrap="true">
    <td class="openWin_toolbar_1"></td>
    <td class="openWin_toolbar_2"><a class="openWin_toolbar_LINK"
    onclick="myReset(); return false;" href="#">清空</a>
    </td>
    <td class="openWin_toolbar_3"></td>
    </tr>
      </table>
    </td>
    <td>&nbsp;&nbsp; &nbsp;&nbsp;</td>
    </tr>
      </table>
    </td>
                            </tr>
    </table>
      </TD>
    </TR>
    <TR>
    <TD>
    &nbsp;&nbsp;&nbsp;&nbsp;<span id="tooMany" style="display:none;"></span>
    </TD>
    </TR>
    <TR>
    <TD>
    <jsp:include page="../../common/jsp/loading.jsp"></jsp:include>
    <div align="center" width="100%">
    <BS:Navigation configName="gridConfig" ID="userGrid" style="width:98%"></BS:Navigation>
    </div>
                      
    </TD>
    </TR>
    </TABLE>
    <!-- 
    End for result list section
     -->
    <XML id="gridConfig">
    <Config>
    <BasicData>test.xml</BasicData>
    <Condition />
    <!-- 
     o.status,o.groupflag,o.orderno,
    f.totalcost,f.fileno,
    o.contact,o.adultnum adultnum,o.childnum,o.infantnum,ac.name as seatstatus,o.bookagentname
     -->
    <ColumnName>订单编号,状态,团队,总结算价,批文号,联系人,成人,儿童,婴儿,销售单位</ColumnName>
    <RowHeight>21</RowHeight>
    <Page>
    <pageMode>NoPaging</pageMode>
    <Server><CountPerPage>16</CountPerPage></Server>
    </Page>
    <Event><Selection>doselectionchanged</Selection><Enter>doOpen</Enter><Delete></Delete>
    <valueIndex>0</valueIndex></Event>
    <Modify>
    <Column>
    <No>1</No>
    <Rule>
    <![CDATA[
    var v = @value.toString().toUpperCase().replace(/\s/g,"");
    if(v == 'N') return '未提交';
    else if(v == 'S') return '已提交未确认'; 
    else if(v == 'L') return '里程支付中'; 
    else if(v == 'M') return '里程支付成功'; 
    else if(v == 'C') return '已确认未支付'; 
    else if(v == 'P') return '已确认正在支付'; 
    else if(v == 'B') return '已支付未出票'; 
    else if(v == 'T') return '已支付未出票'; 
    else if(v == 'O') return '已支付未出票';  
    else if(v == 'R') return '已支付未出票'; 
    else if(v == 'E') return '已支付已出票'; 
    else if(v == 'D') return '已取消';
    else return "$value";
    ]]>
    </Rule>
    </Column>
    <Column>
    <No>2</No>
    <Rule>
    <![CDATA[
    if(@value == '1' ) return '团队'
    else if(@value == '0' || @value=='' ) return '散客'
    ]]>
    </Rule>
    </Column>
    <Column>
    <No>0</No>
    <Rule>
    <![CDATA[ 
    var v = @value.toString().toUpperCase().replace(/\s/g,"");
    return "<a href=\"javascript:doOpen()\">"+v+"</a>";
    ]]>
    </Rule>
    </Column>
    </Modify>
    </Config></XML>

    <script src="./js/orderSearch.js"></script>
    <script>
    var dt = new Date();
    var today = dt.getFullYear() + "-" + xxNumber(dt.getMonth() + 1) + "-" + xxNumber(dt.getDate());
    createStartDate.value = today;
    </script>
    <A HREF="#" TARGET="_blank" style="display:none" id="payLink">test</A>
    <script src="../../common/js/validate.js"></script>
    </BODY>
    </HTML>
      

  4.   


    xsql的代码
    <?xml version ='1.0' encoding="gb2312"?>
    <page connection="ecs" xmlns:xsql="urn:oracle-xsql"> <xsql:if-param name="isInternational" in-list="N,Y"> <xsql:if-param name="isInternational" equals="Y">
    <xsql:security-rule ref-action = "INTERNATIONAL" rule-param = "check"/>
    <xsql:set-page-param name="domestic" value="0"/>
    </xsql:if-param>
    <xsql:if-param name="isInternational" equals="N">
    <xsql:security-rule ref-action = "DOMESTIC" rule-param = "check"/>
    <xsql:set-page-param name="domestic" value="1"/>
    </xsql:if-param>


    <xsql:queryhelper class="ecs.queryhelpers.OrderQueryHelper"
    where-param="whereClause" />

    <xsql:queryhelper class="ecs.queryhelpers.OrderQuerySubHelperForSegment"
    where-param="SegmentSubClause" />

    <xsql:queryhelper class="ecs.queryhelpers.OrderQuerySubHelperForPNRList"
    where-param="PNRSubClause" />
    <xsql:if-param name="orderRowNum" equals="-1">
    <xsql:set-page-param name="orderRowNum" value="10000"/>
    </xsql:if-param>


    <xsql:security-rule ref-action = "LISTORDER" rule-param = "rule" />
    <xsql:set-page-param name="agentScope" value="orders.bookagent = '{@agentid}'"/>
    <xsql:if-param name="containjunior" equals="Y">
        <xsql:retrieve-rule ref-action="SENIOR2DEALORDERS"/>
        <xsql:if-param name="SENIOR2DEALORDERS" exists="no">
            <xsql:retrieve-rule ref-action="SEARCHB2CORDERS"/>
    <xsql:if-param name="SEARCHB2CORDERS" exists="no">
        <xsql:set-page-param name="agentScope" 
    value="orders.bookagent in (select orgunitguid from organizationunitprofile start with orgunitguid = '{@agentid}' connect by parentguid = prior orgunitguid)"/>
        </xsql:if-param>
    <xsql:if-param name="SEARCHB2CORDERS" exists="yes">
        <xsql:set-page-param name="agentScope" 
    value="orders.bookagent in (select orgunitguid from organizationunitprofile start with orgunitguid = '{@agentid}' connect by parentguid = prior orgunitguid  union select orgunitguid from organizationunitprofile start with orgunitguid = 'B2COU' connect by parentguid = prior orgunitguid)"/>
        </xsql:if-param>
    </xsql:if-param>
    <xsql:if-param name="SENIOR2DEALORDERS" exists="yes">
    <xsql:set-page-param name="agentScope" value=" 1=1 "/>
    </xsql:if-param>
    </xsql:if-param>
        <xsql:include-param name="agentScope"/>
        
    <!-- 
    订单状态,是否团队,订单号,结算价,文件编号,
    联系人,成人数,儿童数,婴儿数,销售单位
     -->
    <xsql:query  max-rows="500" null-indicator="yes" row-element="ROW"
    rowset-element="ROWSET" bind-params="orderRowNum">
    select *
      from (
            select /*+USE_NL(orders,f)*/ orders.orderno,
                    orders.status,
                    orders.groupflag,
                    f.totalcost,
                    f.fileno,
                    orders.contact,
                    orders.adultnum as adultnum,
                    orders.childnum,
                    orders.infantnum,
                    orders.bookagentname
             from orders, flightpricedomestic f 
             where orders.orderno = f.orderno and
             orders.domesticindicate = '{@domestic}' and {@whereClause} and
             {@PNRSubClause} and {@SegmentSubClause} and {@agentScope}
             order by orders.orderno desc) tem
     where rownum &lt;= ?
    </xsql:query>
    </xsql:if-param>
    </page>js的代码。
    var _orderNo  =null;
    function doselectionchanged(values){
    var params = new String(values).split(","); 
    if(params.length != 1){
    processException("获取参数错误", "获取参数时发生错误");
    return;
    }
    _orderNo = params[0];}
    function sendRequest(url) {  try {
    var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP");
    xmlhttp.open("POST",url,false);
    xmlhttp.send();
    if(!validateXMLHTTP(xmlhttp))return;
    } catch(exp) {
    throw exp;
    }}
    var _tmpXmlhttp   = null;
    var _oldCondition = null;function callback() {
    if(_tmpXmlhttp==null) return;
    if(_tmpXmlhttp.readyState != 4)return;
    if(document.all("loading__"))loadingHide();
    if(!validateXMLHTTP(_tmpXmlhttp)) {
    _tmpXmlhttp = null;
    return;
    }try {
    if(typeof(userGrid)!="undefined"){ 
    // display result;
    userGrid.showQuery(_tmpXmlhttp.responseText);
    // reset selection
    _userGuid = "";

    try {
    var currentRowNum = document.all("queryRowNum").value;
    if(currentRowNum != '-1'){
    var length = _tmpXmlhttp.responseXML.selectNodes("page/ROWSET/ROW").length;
    if(length >= currentRowNum) {
    document.all.tooMany.innerHTML="查询结果大于"+currentRowNum+"条记录,只显示前"+currentRowNum+"条记录,请缩小查询条件,重新查询。";
    document.all.tooMany.style.display="";
    }
    }
    } catch(e) {
    }

    }
    } catch(exp) {
    processException("function callback() error: ",exp.description);
    }
    _tmpXmlhttp = null;
    }
    function findOrgOrder(dispobj, valobj){
       var ret;
       ret = searchOrgByName(dispobj.value, "refaction=LISTORDER");
       if(ret){
      dispobj.value = ret.name;
          valobj.value = ret.id;
       }
    }
    function getData(url) {try 
    {
    _tmpXmlhttp = new ActiveXObject ("Microsoft.XMLHTTP");
    _tmpXmlhttp.onreadystatechange = callback;
    if(document.all("queryform")){
    _oldCondition = getKeyValues(document.all("queryform"));
    }
    if(_oldCondition == null || _oldCondition == "")
    url +=  "?isInternational="+ isInternational;
    else 
    url +=  "?isInternational="+ isInternational + "&"+_oldCondition;
    _tmpXmlhttp.open("POST",url,true);
    _tmpXmlhttp.setRequestHeader("Content-Type","text/xml;charset=GB2312");
    _tmpXmlhttp.send();
    } catch(exp) {
    throw( exp );
    }
    }function doQuery(){if(document.all("createEndDate").value.length<1) {
    document.all("createEndDate").value = getToday();
    }
    var startDate = document.all("createStartDate").value;//订单开始日期
    var endDate = document.all("createEndDate").value; //订单截止日期// 如果定单号和pnr都为空,则需要限制日期范围
    if(document.getElementById("orderno").value.length < 1 && document.getElementById("pnrno").value.length < 1) {
    if(startDate.length < 1){
    document.all("createStartDate").value = getToday();
    alert("订单开始日期不能为空!"); 
    return false;
    }
    var i = dateSub(startDate,endDate);
    if(i>31){
    alert("查询范围不能大于31天");return false;
    }else if(i<0) {
    alert("开始日期不能大于截止日期");return false;
    }
    } var depStartTime = document.all("depStartTime").value;//航班日期开始日期
    var depEndTime = document.all("depEndTime").value; //航班日期截止日期

    if(depStartTime.length > 1) {

    var i = dateSub(depStartTime,depEndTime);
    if(i<0) {
    alert("航班日期开始日期不能大于截止日期");return false;
    }
    }
    try {
    loadingShow();
    tooMany.style.display="none";
    getData("../../data/order/searchOrder.xsql");

    } catch(exp) {
    processException("function doQuery() error: ",exp.description);
    }}
    function doOpen()
    {
    //var win = window.oooopeeen ("orderManagement.jsp?orderno=" + _orderNo,_orderNo);
    try
    {
    // win.focus ();
    var link = payLink;
    link.href = "orderManagement.jsp?orderno=" + _orderNo;
    window.open(link.href,link.target);
    }
    catch(ex){}
    }// 重置查询条件
    function myReset() {
    try {
        document.all.agentname.value = _ouname;
        document.all.agentid.value = _ouid;
    document.all.createStartDate.value = "";
    document.all.createEndDate.value = "";
    document.all.orderno.value = "";
    document.all.pnrno.value = "";
      
    document.all.depStartTime.value = "";
    document.all.depEndTime.value = "";
    document.all.flightno.value = "";
    document.all.status.value = "";
    document.all.orderFlag.value = "";
    document.all.queryRowNum.value = "100";


       
    } catch(exp) {

    }
    }function xxNumber(n){
    n = "00" + n;
    return n.substr(n.length -2 , 2)
    }function changeQueryMode(obj){
    if(obj.value == 'Y'){
    initQueryMode("baseQuery","none");
    initQueryMode("advancedQuery","block");
    }
    if(obj.value == 'N'){ 
    initQueryMode("advancedQuery","none");
    initQueryMode("baseQuery","block");
    }
    }
    function initQueryMode(obj,param){
      var objs= document.all(obj);
      if(objs.length != undefined){
      for(var i=0;i< objs.length;i++){
      objs[i].style.display=param;
      clearInputValues(objs[i]);
      }
     
        document.all.agentname.value = _ouname;
        document.all.agentid.value = _ouid;
     
      }else{
      objs.style.display=param;
      }
    }
    function quickQuery(status){
    var startTime = document.all.createStartDate.value;
    var endTime = document.all.createEndDate.value;
    myReset();
    document.all.createStartDate.value = startTime;
    document.all.createEndDate.value = endTime;
    document.all.status.value = status;

    doQuery();
    document.all.status.value = "";
    }