PRB Convert XML FILE
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 147
- Joined: Sat Oct 19, 2013 8:21 am
PRB Convert XML FILE
Hi,
I have an XML file :
I want to get (I want to make a table)
thank you for help
I have an XML file :
Code: Select all
<personnes>
<personne>
<name>XXXX</name>
<adress>YYYYY<nl/>ZZZZZZ<nl/>AAAAA</adress>
</personne>
</personnes>
My XSLT code :...
<row>
<entry rowsep="0" align="left"><para><p>XXXX</p></para></entry>
<entry>
<para><p>YYYYY</p></para>
<para><p>ZZZZZZ</p></para>
<para><p>AAAAA</p></para>
</entry>
</row>
...
Code: Select all
<xsl:template match="personne">
<row><xsl:apply-templates /></row>
</xsl:template>
<xsl:template match="name">
<entry rowsep="0" align="left">
<para><p><xsl:value-of select="."/></p></para>
</entry>
</xsl:template>
<xsl:template match="adress">
<entry>
<para><p><xsl:value-of select="."/></p></para>
<xsl:apply-templates />
</entry>
</xsl:template>
<xsl:template match="nl">
<xsl:text></p></para><para><p></xsl:text>
</xsl:template>
-
- Posts: 147
- Joined: Sat Oct 19, 2013 8:21 am
Re: PRB Convert XML FILE
My result is not OK i obtains
Code: Select all
...
<row>
<entry rowsep="0" align="left"><para><p>XXXX</p></para></entry>
<entry>
<para><p>YYYYY ZZZZZZ AAAAA</p></para>
</entry>
</row>
...
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: PRB Convert XML FILE
Hi,
I've changed the address template to use each individual text node and just ignored the separating element (nl).
Regards,
Adrian
I've changed the address template to use each individual text node and just ignored the separating element (nl).
Code: Select all
<xsl:template match="adress">
<entry>
<xsl:for-each select="text()">
<para><p><xsl:value-of select="."/></p></para>
</xsl:for-each>
</entry>
</xsl:template>
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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