Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: removing spurious namespace declarations on XSLT output

From: Joe Kesselman <keshlam-nospam@-------.--->
To: NULL
Date: 5/4/2007 8:18:00 AM

Andy Fish wrote:
> the issue is that I don't know what namespace prefix might have been used in 
> the source document. in the output document I want to use the same namespace 
> I'm using in the stylesheet

If you copy a node from the stylesheet to the output, it will have the 
same namespace, and namespace bindings, as in the stylesheet.

If you copy a node from a source document to the output, it will have 
the same namespace, and namespace bindings, as in the source document.

Appropriate declarations will be generated to make it so, if the 
relevant binding from prefix to namespace URI isn't already in scope at 
that point in the output. They aren't "spurious"; they're required to 
achieve the above semantic results.


If you're having trouble, it's because you either aren't trusting 
xsl:copy to do the right thing, or because you're trying to override 
those semantics, or because you're not using namespaces properly... or 
because you're worried about validating against a DTD which doesn't 
allow the relevant namespace declarations at that point in the document. 
If it's the last, the best advice I can give you is to abandon DTDs; the 
namespace spec deliberately chose not to worry about "playing nice" with 
DTDs, and its authors advised everyone to switch to XML Schema -- which, 
unlike DTDs, is fully namespace-aware.



It might help if you gave us a more explicit example of what you're 
trying to do. You've given us a request out of context, and a fragment 
of code that attempts to meet that request... but both presuppose a 
particular solution, and it may not be the right solution. Consider 
posting a minimal example that demonstrates what you think is a problem, 
and explaining exactly why you consider it a problem. You'll get better 
answers if you ask the real question rather than asking about a detail.



-- 
() ASCII Ribbon Campaign  | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent