2016-07-11 12 views
0

私は をwildfly10するには、Java 5からjava8へとjboss5からアプリケーションを変換しようとしています。この私の知る限りでは前に私達に問題を与えていないXSL:名前空間のTNSを定義する方法

<xsl:if test="name()='xsd:schema'"> 
    <xsl:attribute name="targetNamespace">http://ws.mycomp.com/obfustream/</xsl:attribute> 
    <xsl:attribute name="xmlns:tns">http://ws.mycomp.com/obfustream/</xsl:attribute> 
    </xsl:if> 

最初にラインは、罰金行くが、二行目がエラーで失敗します。

ERROR: 'line 13: You cannot call an attribute 'xmlns:tns''

+0

<xsl:attribute name="tns:type">http://ws.gbst.com/clearview/</xsl:attribute> 

を追加しましたが見えます。 xsl:attributeを使用して名前空間を作成することはできません。また、ここでの 'name()'のテストは、名前空間の接頭辞の選択に依存しているので、疑問があります。 'test =" self :: xsd:schema "'のほうがはるかに優れています。 –

答えて

0

回答: 私が追加: のxmlns:TNS = "http://www.w3.org/2001/XMLSchema-instanceを"

にあなたはXSLTプロセッサのバグに頼っていたバグが修正されたかのよう
<xsl:stylesheet version="1.0" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:tns="http://www.w3.org/2001/XMLSchema-instance" > 

<xsl:if test="name()='xsd:schema'"> 
    <xsl:attribute name="targetNamespace">http://ws.mycomp.com/obfustream/</xsl:attribute> 
     <xsl:attribute name="tns:type">http://ws.mycomp.com/obfustream/</xsl:attribute> 
    </xsl:if> 
関連する問題