I assumed you were generating HTML, in which case the newlines are not
important.
You appear to want to remove the newline that follows the text
"This is a first test message"
in your source document.
To write a transformation that does that, we need to know exactly what
rules you want your transformation to follow: when should newlines be
retained, and when should they be dropped?
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: Mani Malarvannan [mailto:mani@xxxxxxxxxxxx]
> Sent: 07 October 2002 21:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc: michael.h.kay@xxxxxxxxxxxx
> Subject: Re: XSL nested tag help
>
>
>
> Hi,
> For my XSL nested tag question some of you responded with a solution
> of using text(), but that solution is not working. When I tried with
> the solution, the text under "Target" tag is printing at the end
> of text under "Main" ie,
>
> <h1>This is a first test message it is important<h1>
> <h2> and <h2>
>
> But I need the output to be
> <h1>This is a first test message <h2> and </h2> it is important</h1>
>
>
> Thanks for all the help
>
> -Mani
>
>
>
>
>
> From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Subject: RE: XSL nested tag help
> Date: Saturday, October 05, 2002 5:29 PM
>
> > I've following XML file.
> > <Main>
> > This is a first test message
> > <Target> and </Target>
> > it is important
> > </Main>
> >
> >
> > From the above XML file I'd like to write and XSL so that I'll get
> > following output
> > <h1>This is a first test message<h1> <h2> and </h2> <h1>it is
> > important
> > </h1>
> >
>
> <xsl:template match="Main/text()">
> <h1><xsl:value-of select="."/></h1>
> </xsl:template>
>
> <xsl:template match="Target">
> <h2><xsl:value-of select="."/></h2>
> </xsl:template>
>
> But before you do that, try to choose a better design for your XML.
> Using mixed content (text and elements as siblings of each other)
> probably isn't the best approach here.
>
> Michael Kay
> Software AG
> home: Michael.H.Kay@xxxxxxxxxxxx
> work: Michael.Kay@xxxxxxxxxxxxxx
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
>
>
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: XSL nested tag help, (continued)
- Joerg Heinicke - Fri, 4 Oct 2002 15:30:56 -0400 (EDT)
- Michael Kay - Sat, 5 Oct 2002 12:20:38 -0400 (EDT)
- Mani Malarvannan - Mon, 7 Oct 2002 17:07:13 -0400 (EDT)
- Joerg Heinicke - Mon, 7 Oct 2002 17:38:17 -0400 (EDT)
- Michael Kay - Tue, 8 Oct 2002 04:21:36 -0400 (EDT) <=
- Passin, Tom - Mon, 7 Oct 2002 17:42:42 -0400 (EDT)
- Mani Malarvannan - Mon, 7 Oct 2002 18:28:53 -0400 (EDT)
- Passin, Tom - Tue, 8 Oct 2002 10:45:00 -0400 (EDT)
|
|