RE: [xsl] Tags within tags

Subject: RE: [xsl] Tags within tags
From: "Nice, Kerry A. (LNG-SHEP)" <Kerry.Nice@xxxxxxxxxxxx>
Date: Tue, 19 Dec 2000 13:01:16 -0700
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.


Kerry Nice
Java Programmer
LEXIS Publishing, Shepard's
"Bring me the head of David Hasselhoff"

-----Original Message-----
From: Mike Brown [mailto:mike@xxxxxxxx]
Sent: Monday, December 18, 2000 5:54 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
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
> Washington, DC. Neil Karadbil, U.S. Atttorneys Office, Miami, FL. Marc
> Eagleson, Stephen Schlessinger, Anne R. Schultz, U.S. Attorney&apos;s
> Office, Miami, FL. 
> <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> 
> And so far, this xsl has not worked:
> <xsl:template match="COUNSEL">
> \par <xsl:text disable-output-escaping="yes">&lt;I&gt;</xsl:text>
> <xsl:value-of select="."/>
> </xsl:template>
> <xsl:template match="JUDGES">
> \par <xsl:text disable-output-escaping="yes">&lt;I&gt;</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:apply-templates select="@*|node()"/>

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: in Denver, Colorado, USA    

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread