[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xalan error with plain text

Subject: Re: xalan error with plain text
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Sat, 12 Jan 2002 15:40:45 +0000
xalan matches regular expression
Hi Christian,

> I don't know about the exception, but I think you do not have a
> template for the document root. So, you should at least add
>
> <xsl:template match="/">
>     <xsl:apply-templates />
> </xsl:template>
>
> This is what cost me some time to figure out: <document /> is not
> the document root, but the one and only child of the document root.
> And it's the document root where the processor starts to work.

It's true that the processor starts from the document node. But it's
almost never a problem if you don't specify a template that matches
this node - the built-in template for the root node is exactly the
same as that above, so you only *have* to specify it if you've got
some other template, somewhere else in your stylesheet, that matches
the document node and does something different.

[Also note that the document node can have more than one child - there
might be comments and processing instructions before or after the
top-level (document) element, and these are also children of the
document node. Indeed, there's actually nothing stopping XSLT from
working on documents with more than one top-level element, but you
have to pass them to the processor through code rather than as
serialized XML documents.]

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.