2011-09-15 5 views
0

xslt 파일에 테이블을 만들었습니다. 스크린 샷을 확인하십시오. 화면의 두 번째 테이블에서 u는 동일한 행에 ID 2가 나타나지 않음을 알 수 있습니다. 어떤 이유로 든 2 명만 enter image description here이 다운됩니다. ID 2가 ID 1과 같은 줄에 나타나기를 원합니다.xslt를 사용하는 테이블 정렬

여기 내 xslt 코드도 업로드했습니다. 누군가 친절하게도이 문제에 대한 해결책을 말해 줄 수 있습니까?

<?xml version="1.0" encoding="iso-8859-1"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:template match="/"> 

    <html> 
     <head> 
     <title>VPGate Media Mixer</title> 

     <meta http-equiv="expires" content="0"/> 
     <meta http-equiv="pragma" content="no-cache"/> 
     <meta http-equiv="cache-control" content="no-cache, must-revalidate"/> 
     <meta http-equiv="refresh" content="15"></meta> 
     <script src="/Common/common.js\" type="text/javascript"></script> 
     <link rel="stylesheet" type="text/css" href="style001.css" /> 
     <link rel="stylesheet" type="text/css" href="Grid.Default.css" /> 


     </head> 

     <body class="WorkArea"> 
     <div class="divSummaryHeader" id="SummaryHeader"> 
      <h1>Media Mixer - VPGate</h1> 

      <xsl:for-each select="MMDiagnostics/Conference"> 
      <h1> 
       Media Mixer - <xsl:value-of select="name"/> 
      </h1> 
      </xsl:for-each> 
     </div> 

     &#160; 



     <div class="RadGrid RadGrid_Default" id="SummaryData" style="position:absolute;width:790px;overflow:auto"> 

      <table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" > 
      <tr> 
       <input type="button" class="formEditBtn" id="SubBtn" value="Refresh" onclick="window.location=window.location;"/> 

      </tr> 
      <tr> 
       <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;" colspan="2">Conference Summary</td> 
      </tr> 

      <tr> 
       <td> 
       <table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" > 
        <tr> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference Name</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Conference ID</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Address</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Port</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Composite Ssrc</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">No Of Participants</td> 
        </tr> 

        <xsl:for-each select="MediaMixer/Conference"> 
        <!--<xsl:sort select="Name"/>--> 
        <xsl:if test="(position() mod 2 = 0)"> 

         <tr class="rgAltRow SummaryTableDataRow"> 
         <td valign = "top"> 
          <xsl:value-of select="Name"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="ConfId"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="CompositeAddress"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="CompositePort"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="CompositeSsrc"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="NoOfParticipants"/> 
         </td> 
         </tr> 
        </xsl:if> 

        <xsl:if test="(position() mod 2 = 1)"> 
         <td> 
         <tr class="rgRow SummaryTableDataRow"> 
          <td valign = "top"> 
          <xsl:value-of select="Name"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="ConfId"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="CompositeAddress"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="CompositePort"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="CompositeSsrc"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="NoOfParticipants"/> 
          </td> 
         </tr> 
         </td> 
        </xsl:if> 

        </xsl:for-each> 

       </table> 
       </td> 
      </tr> 
      </table> 

      &#160; 

      <table border="0" class="rgMasterTable rgClipCells" cellspacing="1" cellpadding="1" > 
      <tr> 
       <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;" colspan="2">Conference Details</td> 
      </tr> 

      <tr> 
       <td> 

       <table border="0" class="rgMasterTable rgClipCells" cellspacing="0" cellpadding="0" > 
        <tr> 

        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">ID 1</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">ID 2</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant Address</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">Participant Listening Port</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">MM Listening Port</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">SSRC From Participant</td> 
        <td class="rgHeader SummaryTableHdrRow" style="font-weight:bold;">SSRC From MM</td> 
        </tr> 

        <xsl:for-each select="MediaMixer/Conference/Participant"> 

        <xsl:if test="(position() mod 2 = 0)"> 

         <tr class="rgAltRow SummaryTableDataRow"> 

         <td valign = "top"> 
          <xsl:value-of select="ID1"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="ID2"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="ParticipantAddress"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="ParticipantListeningPort"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="MMListeningPort"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="SSRCFromParticipant"/> 
         </td> 
         <td valign = "top"> 
          <xsl:value-of select="SSRCFromMM"/> 
         </td> 
         </tr> 
        </xsl:if> 

        <xsl:if test="(position() mod 2 = 1)"> 
         <td> 
         <tr class="rgRow SummaryTableDataRow"> 
          <td valign = "top"> 
          <xsl:value-of select="ID1"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="ID2"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="ParticipantAddress"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="ParticipantListeningPort"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="MMListeningPort"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="SSRCFromParticipant"/> 
          </td> 
          <td valign = "top"> 
          <xsl:value-of select="SSRCFromMM"/> 
          </td> 

         </tr> 
         </td> 
        </xsl:if> 
        </xsl:for-each> 

       </table> 
       </td> 
      </tr> 
      </table> 


      &#160; 


      <div style="display:none"> 
      <iframe id="frameUpdate" name="frameUpdate" width="100%"></iframe> 
      </div> 


     </div> 

     </body> 
    </html> 
    </xsl:template> 
</xsl:stylesheet> 
+1

이 질문은 XSLT와 아무 관련이 없습니다. HTML이 표시되는 방식은 HTML 및 CSS에만 의존합니다. HTML이 어떻게 생성되었는지는 무의미합니다. –

답변

1

포장을 방지하는 올바른 방법은 white-space

http://www.w3.org/TR/CSS2/text.html#propdef-white-space

일예 CSS 스타일을 사용하는 것입니다

<td style="white-space: nowrap">ID 2</td> 

물론 white-space 스타일을 CSS 클래스로 옮길 수도 있습니다. 나는 당신이 테이블 주위에 그것을 바로 얻기 위해 조금 놀아야 할 것 같아요.