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

namespace frustration

Subject: namespace frustration
From: "Mark D. Anderson" <mda@xxxxxxxxxxxxxx>
Date: Sun, 21 Nov 1999 22:39:26 -0800
thing thing 2
suppose i would like the convenience of not specifying a prefix
for either my match expressions or my output literals, and
those namespaces are different. i can't, right?

see below for an example (note how the "thing" template does
not match). it appears i'm going to have to
pollute all my match and select expressions with prefixes,
just because my input and output namespaces aren't the same.

and what's up with the html output having those namespace
declarations? how do i declare an input namespace that i
do *not* want declared in my html output?

-mda

<!-- foobar.xsl -->
<?xml version="1.0" ?>

<xsl:stylesheet 
  version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="urn:discerning.com/something"
  xmlns:something="urn:discerning.com/something" 
>

  <xsl:output
     method="html"
     indent="yes"
     doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
  
  <xsl:template match="/">
    <html>
     <xsl:apply-templates select="thing"/>
    </html>
  </xsl:template>

  <xsl:template match="thing">
     template without namespace matched: <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="something:thing">
       template with namespace matched: <xsl:value-of select="."/>
  </xsl:template>
</xsl:stylesheet>

<!-- foobar.xml -->
<?xml version='1.0' encoding='UTF-8'?>
<things xmlns="urn:discerning.com/something">
  <thing>thing 1</thing>
  <thing>thing 2</thing>
</things>

<!-- xt-19991105 output -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:something="urn:discerning.com/something" xmlns="urn:discerning.com/something">
</html>

     


 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.