[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Setting Namespace on Generated xsl:stylesheet Elem
At 2010-01-25 10:11 -0600, Roger L. Cauvin wrote:
I'm using a stylesheet (A.xsl) to generate another stylesheet (B.xsl). B.xsl will process Atom feeds and thus needs to reference the atom namespace. Consequently, B.xsl needs a namespace declaration in the xsl:stylesheet element: You don't need to be that elaborate, just use namespace alias: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslo="dummy"> <xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/> <xsl:template .... <xslo:stylesheet version="1.0" xmlns:atom="http://www.w3.org/2005/Atom"> ..... </xslo:stylesheet> </xsl:template> This uses a non-XSLT namespace in the template rule but the XSLT namespace in the result tree. My understanding is that the xsl:namespace element in this excerpt is only valid in XSLT 2.0. I tried: Correct ... because xmlns is reserved for namespaces, you cannot create a non-namespace node (i.e. an attribute node) with it. Using XSLT 1.0, is there a way of generating the xsl:stylesheet element that needs to be in B.xsl? That is the use case for namespace aliasing. I hope this helps. . . . . . . . . . . Ken -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|