[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Adding namespaces to output
Hello out there I'm having some xslt-problems, on which I hope you could give me an advice: I want to produce the following output using an xslt-stylesheet: ... <a xmlns:p="URI"> ... </a> ... whereas 'URI' is NOT KNOWN IN ADVANCE and has to be generated using information from in the input document. So I tried the following code in my stylesheet: <xsl:template match="myInputElement"> <a> <xsl:variable name="p">p</xsl:variable> <xsl:attribute name="{concat($p,':dummy-for-xmlns')}" namespace="{@inputInfo}"/> </a> </xsl:template> This produces the following output: <a xmlns:p="URI" p:dummy-for-xmlns=""> ... </a> This is almost what I want. But I don't like the 'p:dummy-for-xmlns'-Attribute at all. So, here is my Question: Do you know how to add a prefixed namespace ('xmlns:p="URI"', where URI is not known in advance) to an output element ('<a>...</a>') WITHOUT producing an additional dummy-Attribute ('p:dummy-for-xmlns=""')? One Solution would be to transform the output document again and just remove the dummy-Attribute, but this doesn't seem to be very ellegant. Thank you very much and merry X-mas. Felix __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Weihnachts-Einkäufe ohne Stress! http://shopping.yahoo.de 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
|