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

Re: strange <br/> tag

Subject: Re: strange <br/> tag
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 28 Mar 2003 15:07:02 -0700 (MST)
xml br tag
Karl J. Stubsjoen wrote:
> Hello,
> I have a stylesheet that has <br/> command(s) in it (of course).  I
> transform an xml document persisted from an ado recordset with this
> stylesheet.  When I view the source, the <br/> tag looks like this:
> 
> <br xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
> xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
> xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
> 
> Weird!  What is going on?
> Karl
> 
> XSL SOURCE:
> <!DOCTYPE xsl:stylesheet [
> <!ENTITY nbsp "&#160;">
> ]>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>       xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
>       xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
>       xmlns:rs="urn:schemas-microsoft-com:rowset"
>       xmlns:z="#RowsetSchema">

The stylesheet is treated as a node tree just like the XML source doc. So
every element in the stylesheet has a namespace node for each of the bindings
for prefixes xml, xsl, s, dt, rs, and z. When you put <br/> in your
stylesheet, that element has all those namespace nodes associated with it.
When you the element is copied into the result tree, as all literal result
elements are, all the namespace nodes go along with it. When it's time to
serialize the result tree, the processor is going to ignore the xml and xsl
bindings but will be keeping track of the rest, and outputting xmlns attrs
as needed.

Use exclude-result-prefixes="s dt rs z" in your xsl:stylesheet to suppress the
serialization behavior. Or use xsl:element instead of a literal result
element, to avoid the namespace nodes being copied over. Most processors don't
actually implement namespace nodes as such, though, so the first option is
probably better all around.

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.