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

RE: namespaces

Subject: RE: namespaces
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 25 Jun 2001 21:33:29 +0100
RE:  namespaces
The simplest approach is to declare this namespace so that it is in scope
for a literal result element in the stylesheet; when the literal result
element is copied to the result document, the namespace will be copied too.

If you can't do that, e.g. because none of the names of result elements are
known at compile time, then you've got a problem! You may be able to use
<xsl:copy> to copy a namespace node from some other document - but this
isn't guaranteed to work on all processors, because the behavior wasn't
defined until the XSLT 1.0 errata came out.

Another approach is to output a dummy attribute  in the target namespace
using <xsl:attribute>, this will force a namespace declaration to be output.

Mike Kay
Software AG

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of William Lam
> Sent: 25 June 2001 20:12
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  namespaces
>
>
> I am creating a XSLT stylesheet to create a XSLT
> stylesheet.
>
> So in my result document I must declare a namespace
> with the URI of "http://unknown"
>
> and I want to stick the prefix string into a variable
> so I can output it later.
>
> --- Michael Kay <mhkay@xxxxxxxxxxxx> wrote:
> > > While in the middle of processing a XSLT tempalte,
> > I
> > > have a declared namespace URI, but I do not have
> > the
> > > shorthand.  Is there anyway to get the shorthand
> > back
> > > and stick it into a variable?
> >
> > I don't think I understand. You say the namespace is
> > declared, does that
> > mean it is declared using a namespace declaration in
> > the stylesheet? But if
> > that was the case, you would know its prefix (which
> > is what I assume you
> > mean by "shorthand").
> >
> > If the namespace is not declared in either the
> > source document or the
> > stylesheet, there is at present no way of getting it
> > declared in the result
> > document.
> >
> > Mike Kay
> > >
> > > The reason I need to do this is to stick it in the
> > > text of an attribute
> > >
> > > <x y="unknown:i.execute()" />
> > >
> > > where unknown is the unknown shorthand, but we
> > have
> > > the URI http://www.known.com
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get personalized email addresses from Yahoo! Mail
> > > http://personal.mail.yahoo.com/
> > >
> > >  XSL-List info and archive:
> > http://www.mulberrytech.com/xsl/xsl-list
> > >
> >
> >
> >  XSL-List info and archive:
> > http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.