Subject: Pattern matching From: Bovone Stefano <Stefano.Bovone@xxxxxxxx> Date: Fri, 15 Jan 1999 12:17:21 +0100 |
Hello. My name is Stefano Bovone. I'm an italian engineer and I work for the Elsag S.p.a. Elsag is an industry that produces hybrid mail systems, machines for postal sorting, client assistance, electronic commerce, ecc. ecc.
I'm studying XML/XSL and my principal goal is to render ducument in printing.
Actually I have a problem: I have the following XML document:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<common>
<text>First Line</text>
<insert pl="1"/>
<text>Second Line</text>
<insert pl="2"/>
</common>
<particular>
<insert_text num="1">First Insert</insert_text>
<insert_text num="2">Second Insert</insert_text>
</particular>
<particular>
<insert_text num="1">First Insert 2</insert_text>
<insert_text num="2">Second Insert 2</insert_text>
</particular>
.....
<particular>
<insert_text num="1">First Insert 1000</insert_text>
<insert_text num="2">Second Insert 1000</insert_text>
</particular>
</document>
and the following XSL stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<BODY>
<xsl:for-each select="/document/particular">
<xsl:apply-templates select="/document/common/*"/>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="text">
<P>
<xsl:apply-templates/>
</P>
</xsl:template>
<xsl:template match="insert">
<P>
<xsl:value-of select=" --- ???? ---- "/>
</P>
</xsl:template>
</xsl:stylesheet>
I want the following HTML output:
<HTML>
<BODY>
<P>First Line</P>
<P>First Insert</P>
<P>Second Line</P>
<P>Second Insert<P/>
<P>First Line</P>
<First insert 1<P/>
<P>Second Line</P>
<p>Second Insert 1<P/>
.....
<P>First Line</P>
<First insert 1000<P/>
<P>Second Line</P>
<p>Second Insert 1000<P/>
</BODY>
</HTML>
What pattern matching may I use in place of " --- ???? ---- " ?
Thanks.
Best regards.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: last of type problem, Jarle Stabell | Thread | Still a Newbie, Carlton Noles |
Re: GOTCHA!, James Clark | Date | Re: cdata was: XSL and HTML, David Carlisle |
Month |