This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Tags within tags
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Tags within tags
- From: "Nice, Kerry A. (LNG-SHEP)" <Kerry dot Nice at shepards dot com>
- Date: Tue, 19 Dec 2000 13:01:16 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
This was perfect. This fixed a whole bunch of problems that I didn't know
to deal with. I knew the value-of wouldn't work but I wasn't sure where to
go next.
Thanks,
Kerry.
--------
Kerry Nice
Java Programmer
LEXIS Publishing, Shepard's
"Bring me the head of David Hasselhoff"
-----Original Message-----
From: Mike Brown [mailto:mike@skew.org]
Sent: Monday, December 18, 2000 5:54 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] Tags within tags
Nice, Kerry A. (LNG-SHEP) wrote:
> Here is some of the xml:
> <COUNSEL n="105" lntype="seg">
> For Phyllis Richardson, Appellant: Bernardo Lopez, Federal Public
> Defender/Southern Dist. of FL, Fort Lauderdale, FL.
>
> <nl/>
>
> <nl/>For United States of America, Appellee: Sangita Rao, Dept of
Justice,
> Washington, DC. Neil Karadbil, U.S. Atttorneys Office, Miami, FL. Marc
> Eagleson, Stephen Schlessinger, Anne R. Schultz, U.S. Attorney's
> Office, Miami, FL.
> </COUNSEL>
>
> <JUDGES n="110" lntype="seg">
> Before BARKETT, WILSON and MAGILL *, Circuit Judges.
> <footnote headerend="no" headerbegin="no">
> <fn id="fnotestar1" fnridrefs="refstar1" labelicon="yes">
> <fnbody>
> <nl/>
> <nl/>
> * Honorable Frank J. Magill, U.S. Circuit Judge for the Eighth
> Circuit Court of Appeals, sitting by designation. WILSON, Circuit Judge,
> concurring.
> </fnbody>
> </fn>
> </footnote>
> </JUDGES>
>
> And so far, this xsl has not worked:
>
> <xsl:template match="COUNSEL">
> \par <xsl:text disable-output-escaping="yes"><I></xsl:text>
> <xsl:value-of select="."/>
> </xsl:template>
>
> <xsl:template match="JUDGES">
> \par <xsl:text disable-output-escaping="yes"><I></xsl:text>
> <xsl:value-of select="."/>
> \par\par } }
> </xsl:template>
>
> <xsl:template match="nl">
> \par
> </xsl:template>
xsl:value-of doesn't do what you think it does.
Replace both instances with <xsl:apply-templates/>, and add
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
and you will see something much closer to what you want.
This makes the default for any element be to copy the element, its
attributes, and its children (thus picking up footnote, fn, etc. intact).
This overrides the default template for elements, which is just
<xsl:apply-templates/>. This is overriden by the templates for COUNSEL,
JUDGES and nl elements.
- Mike
____________________________________________________________________
Mike J. Brown, software engineer at My XML/XSL resources:
webb.net in Denver, Colorado, USA http://skew.org/xml/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list