This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

null and default namespace


I am still a bit confused about namespaces in combination
with the default or null namespace. Hopefully someone
can give me an enlightenment...

Let's assume I have the following XML document:

1)
<?xml version="1.0" ?>
<bla:root bla:xmlns="http://bla.org";>
   <bla:title/>
   <title/>
</bla:root>

I assume <title> is in the null namespace because no
default namespace is defined.
(Will this result in a SAX event like this:
  startElement(null,"","title",null); or
  startElement("","","title",null); or
 ??)


2)
<?xml version="1.0" ?>
<bla:root bla:xmlns="http://bla.org"; xmlns="http://bla.org";>
   <bla:title/>
   <title/>
</bla:root>

Now the default namespace is the same as for prefix bla.
I assume <title> is the same as <bla:title> now. So the
following xsl template should match both:
  ...
  <xsl:match pattern="bla:title">
  ...
  <xsl:match>
  ...
as long as the namespace is defined as bla:xmlns="http://bla.org";.
Is this correct?

Now I am wondering how the SAX event differ for the two
tags. Do they look like this?

  startElement("http://bla.org","bla","bla:title",null);
  startElement("http://bla.org","","title",null);

Thanks
--
Torsten

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]