Re: [xsl] nesting xml

Subject: Re: [xsl] nesting xml
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 03 May 2001 17:36:01 +0100
Hi Tom,

Ah, well, in Mark's example, a template matching "text" would and should pick up everything, regardless of whether any explicit templates were given for the root (/) or document element (ROOT) ... since the built-in templates take care of them.

I was hearing you to say he'd have trouble if he didn't match them, which I guess isn't what you meant. In fact, if he did explicitly give templates for / or ROOT, they'd better say just what the defaults do, or his output won't come the way he expects. (Narrow bandwidth in here ain't it?)

Cheers,
Wendell

Mark's given source example:
<?xml version="1.0"?>
<ROOT>
 <text>
  <definition>
   <color>
    content
   </color>
   <size>
    content
   </size>
   <font>
    content
   </font>
  </definition>
  <data>
   content
  </data>
 </text>
</ROOT>

At 10:15 PM 5/3/01, you wrote:
Yes, Wendell, I know, but then your output will be unrelated to your
template (which may not ever get called, depending), so you get some kind of
output but not what you thought you were designing.

One example was Larry Mason's post from a little earlier.  When you run it,
you get the same output no matter what's in the template (I tried it to be
sure).

Cheers,

Tom P

[Wendell Piez]

> Tom--
>
> Not so. There is a built-in template
>
> <xsl:template match="/">
>    <xsl:apply-templates/>
> </xsl:template>
>
> which will pick up the root unless some other template beats it
> in  precedence/priority (not hard to do).

====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread