[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: XSLT with a source with namespaces

Subject: [list4xt] Re: XSLT with a source with namespaces

User: Website

From: Mike Brown (mike@skew.org)
Date: 30/06/2000 - 22:23


> exclude-result-prefixes="n1, n2, n3"

Do not put commas in there. It's just a whitespace separated list of
prefixes.

> Whenever I see examples of XSLT in use, 99% of them use literal
> result elements vs. using xsl:element. The same applies to
> xsl:attribute and others like it. Is there a "best practice"
> detail here that I should know about or is it whatever you feel
> like typing (or odd circumstances like mine)?

Odd circumstances like yours :)
Having extra namespace declarations shouldn't hurt anything, anyway.

> I've also noticed a couple differences in declaring namespaces.
> One is this (specifically naming the namespace, not a default):
> <n1.document xmlns:n1="x-schema:schema/schema-n1.xml">
> The other is this:
> <n1.document xmlns="x-schema:schema/schema-n1.xml">
> Which is correct? Do they do the same thing?

They have different purposes.

xmlns="foo" declares the default namespace to be URI foo, effectively
                 declaring that all elements and attributes without a
                 prefix belong to namespace foo. Unprefixed elements do
                 not belong to a namespace unless they or an ancestor
                 contain an xmlns="foo".

xmlns:bar="foo" binds the prefix bar to URI foo, effectively declaring
                 that elements and attributes with prefix bar: belong to
                 namespace foo.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at My XML/XSL resources:
webb.net in Denver, Colorado, USA http://www.skew.org/xml/

--
Mailing list for the XT users community.     (http://lunenburgchamber.org)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org