[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] namespace frustration
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|