我需要生成该XML的所有事情,命名空间上的每个节点等
<bdo_fosfec:RegistrosPagosElement xsi:type="bdo_fosfec:RegistrosPagos"
xmlns:bdo_fosfec="http://asocajas.app.com/example"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<registro54 xsi:type="bdo_fosfec:Registro54">
<registro82 xsi:type="bdo_fosfec:Registro82">
<C512>39756656</C512>
<C614>YAXMINNI</C614>
</registro82>
</registro54>
<registro54 xsi:type="bdo_fosfec:Registro54">
<registro82 xsi:type="bdo_fosfec:Registro82">
<C512>79374740</C512>
<C614>VICTOR</C614>
</registro82>
</registro54>
</bdo_fosfec:RegistrosPagosElement>
我建立这个XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<bdo_fosfec:RegistrosPagosElement xsi:type="bdo_fosfec:RegistrosPagos" xmlns:bdo_fosfec="http://asocajas.app.com/example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:apply-templates select="registro54"/>
</bdo_fosfec:RegistrosPagosElement>
</xsl:template>
<!--TEMPLATE REGISTRO 54-->
<xsl:template match="registro54">
<registro54 xsi:type="bdo_fosfec:Registro54">
<registro82 xsi:type="bdo_fosfec:Registro82">
<C512><xsl:value-of select="C512"/></C512>
<C614><xsl:value-of select="C614"/></C614>
</registro82>
</registro54>
</xsl:template>
</xsl:stylesheet>
但是当我变换myxml与XSLT并不如预期的结果XML
结果 :
<?xml version="1.0" encoding="utf-8"?>
<bdo_fosfec:RegistrosPagosElement xsi:type="bdo_fosfec:RegistrosPagos" xmlns:bdo_fosfec="http://asocajas.app.com/example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
myxml
<?xml version="1.0" encoding="utf-8"?>
<bdo_fosfec_x003A_RegistrosPagosElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<registro54>
<registro82>
<C512>123456789</C512>
<C614>Miguel</C614>
</registro82>
</registro54>
<registro54>
<registro82>
<C512>1234567890</C512>
<C614>Jerónimo</C614>
</registro82>
</registro54>
</bdo_fosfec_x003A_RegistrosPagosElement>
我不知道我做错了,我已经试过删除命名空间的xmlns:XSI =“ http://www.w3.org/2001/XMLSchema-instance ”的xsi:type =“bdo_fosfec:RegistersPages”的xmlns: bdo_fosfec =“HTTP://asocajas.hp.com/bdo_fosfec‘的样式表,但它产生的错误,我也尽量不使用’模板”,结果达到所希望的一个,但它是不一样的,我希望
Thnks