[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Generating a namespace declaration
> using <xsl:element>, is it possible to declare a namespace > prefix. I tried specifying "xmlns:myns" as an attribute ( > <xsl:attribute> ), but the processor complained. > > I d rather not use any extensions. > > Do I have to resort to LREs for this. > If the namespace you want to declare is actually used by the element name or by one of its attributes, then you can use the namespace attribute of <xsl:element> or <xsl:attribute> to create the node in the right namespace, and the namespace declarations will be added automatically by the serializer. If you want to add a namespace node that isn't used in any element or attribute name it's a bit trickier. XSLT 2.0 allows you to do it with an xsl:namespace instruction. In XSLT 1.0, the only way is to copy a namespace node (using <xsl:copy>) either from the source document or from a temporary tree. Michael Kay 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
|