[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: doctype is confusing me...
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|