[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Templates aplied to namespaces


Subject: Templates aplied to namespaces
From: Elliotte Rusty Harold <elharo@xxxxxxxxxxxxxxx>
Date: Sun, 19 Dec 1999 14:34:07 -0800

I have an input document that looks like this:

<?xml version="1.0" encoding="UTF-8" ?> 
<ROOTELEMENT xmlns="http://www.somewhere.com/mynamespace">
 <ERRORCODE>0</ERRORCODE> 
 <BOOKLIST>
 <BOOK>
  <title>Three Men in a Boat: To Say Nothing of the Dog!</title> 
  <isbn>0140012133</isbn> 
 </BOOK>
 <BOOK>
  <title>Catch-22</title> 
  <isbn>0684833395</isbn> 
 </BOOK>
 </BOOKLIST>
</ROOTELEMENT>

The particular issue is that it uses the default namespace on its
elements but no prefix. I'm having a devil of a time getting a template
in the XSLT stylesheet to match up with anything by its name, either
with or without a prefix. Everything works fine if I remove the
namespace declaration from the input document. However declaring the
namespace in the stylesheet, with or without a prefix, doesn't seem to
help. 

I'm using xt. Does anyone have any suggestions; for instance a template
rule that would match a title element in the above document? Thanks.

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@xxxxxxxxxxxxxxx | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|               Java I/O (O'Reilly & Associates, 1999)               |
|            http://metalab.unc.edu/javafaq/books/javaio/            |
|   http://www.amazon.com/exec/obidos/ISBN=1565924851/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ | 
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+


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



Current Thread
Keywords