xsl:element problem
Having trouble installing Oxygen? Got a bug to report? Post it all here.
xsl:element problem
I have got the xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by MA (GE) -->
<!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)-->
<n:DepositoInsinuazioni xmlns:n="http://www.giustizia.it/Concorsuali/StatoPassivo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.giustizia.it/Concorsuali/StatoPassivo
D:\MINISTERO\Krakatoa\src\interop\xml\Insinuazioni\InsinuaETipi.xsd">
...
<n:Insinuazione>
<n:Identificativo n:CodiceFiscale="VRDMRA59A25E379B"/>
<n:Credito>
<n:NumeroCredito>1</n:NumeroCredito>
<n:Importo>556.00</n:Importo>
<n:Privilegio>010</n:Privilegio>
<n:Sorte>556.00</n:Sorte>
<n:DataDecorrenza>1998-12-01</n:DataDecorrenza>
<n:Descrizione>String</n:Descrizione>
</n:Credito>
</n:Insinuazione>
</n:DepositoInsinuazioni>
I'm trying to insert a new element <Numero> after the tag </n:Insinuazione>
I'm using xsl to insert this new tag, but nothig change after I have done the XSL transformation.
the xsl file is :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="DepositoInsinuazioni/Insinuazione">
<xsl:element name="Numero">
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
someone can say me what's going wrong?
thanks
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by MA (GE) -->
<!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)-->
<n:DepositoInsinuazioni xmlns:n="http://www.giustizia.it/Concorsuali/StatoPassivo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.giustizia.it/Concorsuali/StatoPassivo
D:\MINISTERO\Krakatoa\src\interop\xml\Insinuazioni\InsinuaETipi.xsd">
...
<n:Insinuazione>
<n:Identificativo n:CodiceFiscale="VRDMRA59A25E379B"/>
<n:Credito>
<n:NumeroCredito>1</n:NumeroCredito>
<n:Importo>556.00</n:Importo>
<n:Privilegio>010</n:Privilegio>
<n:Sorte>556.00</n:Sorte>
<n:DataDecorrenza>1998-12-01</n:DataDecorrenza>
<n:Descrizione>String</n:Descrizione>
</n:Credito>
</n:Insinuazione>
</n:DepositoInsinuazioni>
I'm trying to insert a new element <Numero> after the tag </n:Insinuazione>
I'm using xsl to insert this new tag, but nothig change after I have done the XSL transformation.
the xsl file is :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="DepositoInsinuazioni/Insinuazione">
<xsl:element name="Numero">
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
someone can say me what's going wrong?
thanks
Hi,
The following stylesheet will do it
Best Regards,
George
The following stylesheet will do it
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="n:Insinuazione" xmlns:n="http://www.giustizia.it/Concorsuali/StatoPassivo">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
<xsl:element name="Numero"/>
</xsl:template>
</xsl:stylesheet>
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service