小编Sil*_*viu的帖子

XSLT允许不匹配的标签?

<xsl:template match="location">
        <xsl:if test="not(preceding::location)">
            <table>
                <tr>
                    <th>Name</th>
                    <th>City</th>
                    <th>State</th>
                    <th>Zip Code</th>
                    <th>Country</th>
                </tr>
        </xsl:if>
        <tr>
            <td><xsl:value-of select=".//name"/></td>
            <td><xsl:value-of select=".//city"/></td>
            <td><xsl:value-of select=".//state"/></td>
            <td><xsl:value-of select=".//zip"/></td>
            <td><xsl:value-of select=".//countdy"/></td>
        </tr>
        <xsl:if test="not(following::location)">
            </table>
        </xsl:if>
    </xsl:template>
Run Code Online (Sandbox Code Playgroud)

是否允许在XSLT中使用不匹配的标签...或者是否有其他方法可以实现相同的预期效果?

html xml xslt

3
推荐指数
1
解决办法
2063
查看次数

Java:哪个对象更合适?

我正在编写类似于聊天服务器 - 客户端对的应用程序.

我计划有一个中心对象,它将保存从客户端收到的新消息,直到主线程处理它们为止.

我的应用程序是多线程的.每个客户端都在自己的线程上,因此多个线程将向此中心对象添加消息.

主线程将检查此对象的消息,删除"最旧的"并适当地处理它.我希望消息的处理顺序与它们相同(FIFO).

什么类型的Object最适合保存新消息?我查看了Vectors和ArrayLists,但我对同步方面感到困惑.我以前从未使用同步或线程.

谢谢

java multithreading synchronization vector arraylist

2
推荐指数
1
解决办法
173
查看次数

标签 统计

arraylist ×1

html ×1

java ×1

multithreading ×1

synchronization ×1

vector ×1

xml ×1

xslt ×1