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

Re: doctype is confusing me...

Subject: Re: doctype is confusing me...
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 17 Feb 2003 15:50:10 -0700 (MST)
xsl doctype html
Ted Stresen-Reuter wrote:
> Hi,
> 
> I'm trying to transform XHTML files (extracting the form element). I'm  
> finding that with the xalan processor if I include the doctype  
> declaration at the top of the document (with or without the xml  
> processing instruction: <?xml version="1.0"?>)

There's no such thing as an XML processing instruction. That's an XML
declaration or text declaration, *not* a processing instruction. It just
happens to have a similar syntax.

>, that the following  
> style sheet fails to see elements below the root of the document.  
> However, if I move the doctype declaration, it works as expected. What  
> am I missing here?
> 
> Thanks in advance!
> 
> Ted Stresen-Reuter
> 
> Here's the doctype declaration I'm using: <!DOCTYPE html PUBLIC  
> "-//W3C//DTD XHTML 1.0 Transitional//EN"  
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

1. If you haven't got a proxy or a catalog set up to retrieve the DTD locally,
you're going out over the net to w3.org every time you parse that XML. Is that
kind of overhead really what you want?

2. The DTD in question sets a default xmlns attribute on the "html" element.
Once that happens, none of the elements are in the empty namespace. Bind the
XHTML namespace to a prefix like "xhtml" in your stylesheet, and then you can
do things like <xsl:template match="html|xhtml:html"> to make the template
match an 'html' element in both the empty and XHTML namespaces.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

 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.