Hi Mark, This should be reported as an error. xmlns:aaa::bbb="http://www.test.org" is not a valid namespace declaration, as "aaa:bbb" is not a valid NCName. The prefix in a namespace declaration is required to be an NCName. Also, you seem confused as to what a namespace declaration does:
<Workbook xmlns="aaa:bbb"/> defines an element with a local name of "Workbook" and a namespace URI of "aaa:bbb". I'm not sure where the namespace URI "http://www.test.org" comes from, but it won't help you match an element with a namespace URI of "aaa:bbb". To match such an element a stylesheet, you would do the following: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:foo="aaa:bbb" <xsl:template match="foo:Workbook"> <ws> <xsl:apply-templates/> </ws> </xsl:template> </xsl:stylesheet> I'm not sure whether or not the namespace URI "aaa:bbb" is relative or not. I suspect that it is, but I'm not familiar with URN-style URIs. You should really avoid relative namespace URIs as they are currently illegal, although many XML parsers and XSLT processors allow them. You're not likely to find much in Xalan's documentation about this, since it's a generic XML/XSLT question, and not Xalan-specific. You might want to read the XML Namespaces recommendation for more info: http://www.w3.org/TR/REC-xml-names/ Hope that helps... Dave "Mark Harburg" <[EMAIL PROTECTED] To: [EMAIL PROTECTED] om> cc: (bcc: David N Bertoni/CAM/Lotus) Subject: How to match namespaces in template? 12/03/2001 07:20 PM I'm trying to match an element in an XML that has a namespace, but with no luck. Here's what I tried: -------- source xml -------- <?xml version="1.0"?> <Workbook xmlns="aaa:bbb"> hi </Workbook> --------- my xsl ----------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:aaa="http://www.test.org" xmlns:aaa:bbb="http://www.test.org"> <xsl:template match="aaa:bbb:Workbook"> <ws> <xsl:apply-templates/> </ws> </xsl:template> </xsl:stylesheet> ------------------------------- I can't seem to find an answer to this in any documentation. Thanks. -- _______________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup 1 cent a minute calls anywhere in the U.S.! http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com
