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

Adding namespaces to output

Subject: Adding namespaces to output
From: hauser felix <felix_hauser@xxxxxxxx>
Date: Mon, 23 Dec 2002 16:09:21 +0100 (CET)
dummy for xmlns
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


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.