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

Re: Algorithm akin to namespace fixup for xslt?

Subject: Re: Algorithm akin to namespace fixup for xslt?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Feb 2015 10:11:11 -0000
Re:  Algorithm akin to namespace fixup for xslt?
> Given a deep tree of nodes, each element node within a namespace. A child
node inherits its parent namespace unless it specifically overrides it. Is
there an algorithm for choosing the "best" or perhaps "sparsest" set of
overriding namespace declarations, hence taking the most advantage of
inheritance.
>
> My application of this algorithm isn't for namespaces but seems very similar
in requirement.
>
>
That's a pretty sketchy description, not helped by the fact that you appended
text from another thread which I assume is to be ignored.

Let's try another formulation, which might or might not be what you intended:
Given a document with lots of xml:lang attributes, eliminate those that are
redundant.

That one's fairly easy, I think:

<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="@xml:lang[. eq ancestor::*[@xml:lang][1]/@xml:lang"/>

Michael Kay
Saxonica

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.