Friday, September 17, 2010

Cleaning up namespace declarations

Ever been bothered by redundant namespace declarations? Some tools generate tons and tons of these, and they really clutter up your XML, making it hard to read and maintain, as well as increasing file size for no reason.

Here's a handy XSLT to move all declarations to the top element of your document, removing duplicates. (It even moves seemingly unused declarations. This is intended behavior, as the declarations may still be referenced in the text, e.g. in the XPath expressions of a BPEL file.)


<!-- Copyright J.W. v/d Broek 2010. Do with this code as you will. -->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="#all">

<xsl:template match="/*">
<xsl:copy copy-namespaces="no">
<xsl:for-each-group select="for $x in //* return for $y in in-scope-prefixes($x)[.!='' and .!='xml'] return concat($y, ':',namespace-uri-for-prefix($y, $x))" group-by=".">
<xsl:namespace name="{substring-before(., ':')}" select="substring-after(., ':')"/>
</xsl:for-each-group>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

<xsl:template match="node()|@*">
<xsl:copy copy-namespaces="no">
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

108 comments:

Anonymous said...

generic xanax what is a generic xanax - buy xanax uk no prescription

Anonymous said...

generic xanax xanax pills images - xanax side effects anger

Anonymous said...

buy tramadol online can take 3 50 mg tramadol - tramadol hcl 50 mg tab dosage

Anonymous said...

discount xanax xanax withdrawal symptoms timeline - xanax bars 15

Anonymous said...

xanax online how long does generic xanax last - xanax side effects in dogs

Anonymous said...

xanax online buy xanax ireland - order real xanax online

Anonymous said...

generic xanax signs of xanax overdose - xanax effects high

Anonymous said...

buy carisoprodol carisoprodol 350 mg tablet what - order vicodin online no prescription needed

Anonymous said...

buy tramadol no prescription is tramadol for dogs an nsaid - tramadol addictive properties

Anonymous said...

xanax online xanax overdose children - buy xanax diazepam

Anonymous said...

xanax online xanax dosage recommended - xanax drug test detection time

Anonymous said...

generic xanax xanax 1mg side effects - xanax bars green monsters

Anonymous said...

buy tramadol online tramadol 100 mg street value - can i order tramadol online legally

Anonymous said...

where can i order xanax online xanax for anxiety in children - how many xanax pills

Anonymous said...

buy carisoprodol carisoprodol 350 mg high - carisoprodol erowid experience

Anonymous said...

xanax online pharmacy buy xanax uk no prescription - xanax bars doses

Anonymous said...

Wow, wοndегful blog format!
Ηow long havе you ever beеn running a blog for?
you made blogging glancе еasy. The whole glance
of your ѕite іs excellent, as smartly as the content!


my site: SEOPressor V5 Review

Anonymous said...

xanax online many 1mg xanax overdose - generic xanax just good

Anonymous said...

Wοw that ωas ѕtrange. I just wrote an very lоng сοmment
but aftеr I clicκed submіt mу
comment didn't show up. Grrrr... well I'm nοt writing all that oveг аgaіn.

Anyhow, just wаnted tο say excеllent blog!


Chеck out mу web-ѕіte; SEOPressor V5 review

Anonymous said...

buy carisoprodol cod difference between soma carisoprodol - carisoprodol 350 erowid

Anonymous said...

buy tramadol online buy tramadol hydrochloride online usa - buy tramadol usa

Anonymous said...

buy tramadol cod tramadol 50mg recommended dosage - buy tramadol c.o.d saturday delivery

Anonymous said...

buy tramadol online tramadol 50 mg max dosage - buy tramadol legally

Anonymous said...

xanax online generic xanax pictures of pills - xanax side effects menstrual cycle

Anonymous said...

[url=http://buycialispremiumpharmacy.com/#hedbv]buy cialis online[/url] - buy cialis , http://buycialispremiumpharmacy.com/#gdtdd buy cialis

Anonymous said...

[url=http://buyviagrapremiumpharmacy.com/#msxer]buy viagra online[/url] - viagra online , http://buyviagrapremiumpharmacy.com/#coxkt buy viagra

Anonymous said...

buy cialis cialis online order - generic cialis 20mg

Anonymous said...

[url=http://buyviagrapremiumpharmacy.com/#uwjum]buy cheap viagra[/url] - buy viagra online , http://buyviagrapremiumpharmacy.com/#vzait buy cheap viagra

Anonymous said...

[url=http://buycialispremiumpharmacy.com/#jjenh]buy cheap cialis[/url] - buy cialis online , http://buycialispremiumpharmacy.com/#xndhf buy cialis online

Anonymous said...

buy cialis online with prescription cialis reviews - cialis online legitimate

Anonymous said...

buy cialis daily can you buy cialis in thailand - best buy cialis online

Anonymous said...

xanax online xanax xr overdose symptoms - xanax effects on personality

Anonymous said...

cialis online buy cheap cialis from us - cialis online no prescription overnight

Anonymous said...

learn how to buy tramdadol tramadol hcl 50 mg high - tramadol jittery

Anonymous said...

buy tramadol tramadol 50mg tablets side effects - tramadol hcl online

Anonymous said...

[url=http://viagraboutiqueone.com/#xjehf]viagra without prescription[/url] - buy viagra online , http://viagraboutiqueone.com/#ojngm viagra 100 mg

Anonymous said...

http://landvoicelearning.com/#97734 tramadol hcl tab 50mg dosage - tramadol back pain

Anonymous said...

buy tramadol 100mg online tramadol hcl injection - tramadol generic ultram 50 mg 180 pills

Anonymous said...

learn how to buy tramdadol tramadol stada 100mg nebenwirkungen - tramadol medication addiction

Anonymous said...

http://landvoicelearning.com/#97734 buy tramadol online no prescription cod - tramadol 100 mg wiki

Anonymous said...

buy tramadol high dose of tramadol - cheap tramadol online no prescription

Anonymous said...

buy tramadol tramadol hcl obat - buy tramadol online cod overnight

Anonymous said...

[url=http://viagraboutiqueone.com/#wvxhd]viagra without prescription[/url] - viagra 150 mg , http://viagraboutiqueone.com/#wxfcl viagra 200 mg

Anonymous said...

tramadol without prescription tramadol hcl online pharmacy - xymel 50mg tramadol

Anonymous said...

buy tramadol tramadol for dogs drug interactions - tramadol 50 mg vs vicodin

Anonymous said...

tramadol online tramadol 50mg dosage for adults - tramadol 50 mg with alcohol

Anonymous said...

buy tramadol best site order tramadol - tramadol seizures

Anonymous said...

http://buytramadolonlinecool.com/#91646 tramadol online no prescription usa - tramadol 50mg dosage

Anonymous said...

buy tramadol duration of tramadol withdrawal symptoms - tramadol 50 mg white pill

Anonymous said...

http://landvoicelearning.com/#97734 order tramadol cod overnight - buy tramadol online us pharmacy

Anonymous said...

buy tramadol cheap no prescription tramadol withdrawal thomas recipe - tramadol dosage for small dogs

Anonymous said...

buy tramadol online buy cheap tramadol online cod - tramadol 50mg generic

Anonymous said...

tramadol online cod tramadol hcl 50mg tab amne - buy tramadol hydrochloride

Anonymous said...

buy ativan online ativan no prescription overnight delivery - lorazepam 1 mg during pregnancy

Anonymous said...

tramadol online tramadol dosage guidelines - generic tramadol hcl

Anonymous said...

http://reidmoody.com/#92465 how to buy lorazepam - side effects to ativan

Anonymous said...

ways to buy ativan online ativan wyeth online - ativan vicodin overdose

Anonymous said...

ways to buy ativan online ativan overdose dog - ativan side effects for children

Anonymous said...

buy tramadol online tramadol 150mg - tramadol long term effects

Anonymous said...

http://ranchodelastortugas.com/#82165 does 1mg xanax feel like - does 1mg xanax feel like

Anonymous said...

buy tramadol online illegal buy tramadol online - tramadol hcl usage

Anonymous said...

http://staam.org/#90873 tramadol 50 mg sleep - tramadol withdrawal medication

Anonymous said...

buy tramadol online tramadol dosage recommendations - tramadol hcl 200mg side effects

Anonymous said...

xanax for anxiety xanax drug food interactions - xanax withdrawal flu

Anonymous said...

buy tramadol online tramadol for dogs constipation - where to buy tramadol in usa

Anonymous said...

http://ranchodelastortugas.com/#71453 buy xanax online 2mg - xanax side effects sleep

Anonymous said...

buy xanax online buy alprazolam mexico - best generic brands xanax

Anonymous said...

order alprazolam no prescription xanax withdrawal last - xanax no prescription delivered overnight

Anonymous said...

buy xanax online where to buy xanax without rx - illegal to order xanax online

Anonymous said...

[url=http://buyonlineaccutaneone.com/#vcinh]accutane 5 mg[/url] - accutane 20 mg , http://buyonlineaccutaneone.com/#biaqy buy accutane online

Anonymous said...

[url=http://buynolvadexonlineone.com/#wmmaw]nolvadex online[/url] - buy nolvadex , http://buynolvadexonlineone.com/#gpoqz buy tamoxifen

Anonymous said...

Greetings I am so thrilled I found your blog, I really found
you by accident, while I was looking on Aol for something else, Anyways I am here now and would just like to say cheers for a
marvelous post and a all round exciting blog (I also love the theme/design), I don’t have time
to look over it all at the moment but I have bookmarked it and also included your RSS feeds, so
when I have time I will be back to read a great deal more,
Please do keep up the great jo.

Visit my blog post; bravesites.com

Anonymous said...

The complainant had informed the Bribery Commission and,
utilizing a decoy, the suspect was arrested while accepting the bribe fast payday loans no faxing 1 hour payday loans- immediate cash support without credit check.

Anonymous said...

cialis acquisto viagra senza ricetta viagra acheter cialis

Anonymous said...

cialis cialis 20mg cialis cialis 100mg barato cialis prices

Anonymous said...

cialis sales cheap generic cialis comprar cialis online

Anonymous said...

If they came back which has a lower interest rate that will are actually different, but it really
didn't figure out this way personal loan in india thanks towards the economy, many owners find themselves stuck in a mortgage that does not fit their current financial predicament.

Here is my web-site: personal loan in india

Anonymous said...

The qualifying requirements for these plans are very easy
that a lot of from the applicants get approval simultaneously faxless payday loan
the medicare landscape may probably also change moving forward as congress looks to
it being a approach to lessen the deficit regardless of
the items they say publicly.

Review my website: faxless payday loan

Anonymous said...

It is extremely crucial that you know where your
traffic comes from so that you simply can continue emphasizing that and bring in more leads payday loans in uk if you are pre-approved, a more
thorough examination of the income, job, and expenses is completed being sure you can manage the loan
without overextending yourself.

a ji o ji suno ji said...

More technical details and released open-source code for this project has been announced at:
English Bulldog Puppies

Anonymous said...

smokeless cigarettes, electronic cigarettes, best electronic cigarettes, electronic cigarettes, e cigarette reviews, e cigarette

dong dong said...

2015626dongdong
mont blanc pens
louis vuitton
nfl jerseys
abercrombie
jordan 6
michael kors handbags
louis vuitton
louis vuitton
coach outlet
nfl jerseys
pandara jewelry
louis vuitton handbags
michael kors outlet
michael kors
coach factory outlet online
coach outlet store online
hollister
true religion
ray ban sunglasses
replica watches
gucci handbags
jordan 4
oakley sunglasses
mont blanc pens
oakley sunglasses
abercrombie
louis vuitton handbags
chi flat iron
michael kors outlet
polo ralph lauren
ralph lauren
coco chanel
michael kors outlet
mulberry uk
pandora charms
kate spade outlet
jordan 11s
christian louboutin

Richard C. Lambert said...

Ugh. I need to do this beyond desperately, but I can pretty much guarantee that I won't. Allergens and burning dust be damned!electric pressure washer

Qing Cai said...

abercrombie and fitch, http://www.abercrombie-fitch.us.com/
oakley sunglasses, http://www.oakleysunglassesdiscount.us.com/
rolex watches uk, http://www.rolexwatches-uk.co.uk/
louis vuitton handbags, http://www.louisvuittonhandbag.us/
kobe shoes, http://www.kobeshoes.us/
prada handbags, http://www.pradahandbagsoutlet.co.uk/
nike huarache, http://www.nike-airhuarache.co.uk/
ralph lauren uk, http://www.ralphlaurenoutletuk.org.uk/
kobe bryant shoes, http://www.kobebryantshoes.in.net/
michael kors outlet, http://www.michaelkorsoutletusa.net/
air max 2014, http://www.airmax2014.net/
cheap oakley sunglasses, http://www.cheapoakleysunglassess.us.com/
calvin klein underwear, http://www.calvinklein.in.net/
ugg boots, http://www.uggbootscheap.eu.com/
ray ban sunglasses, http://www.raybansunglassesonline.us.com/
nike trainers, http://www.niketrainers.me.uk/
nike free 5, http://www.nikefree5.us/
hollister, http://www.hollistercanada.com/
tiffany jewellery, http://www.tiffanyjewelleryoutlets.co.uk/
nfl jerseys wholesale, http://www.nfljerseys-wholesale.us.com/
louis vuitton handbags, http://www.louisvuittonhandbags.org.uk/
ray ban, http://www.occhiali-rayban.it/
hollister uk, http://www.hollistershirts.co.uk/
air jordan 11, http://www.airjordan11.net/
tory burch outlet, http://www.toryburch.in.net/
cai2015924

Richard C. Lambert said...

I am notorious for walking in the kitchen and just throwing stuff together. 99% of the time, it is bomb. But I can never replicate it because I was just following my instincts. I tried to pay attention this time. best pressure washers

Minko Chen said...

hermes outlet
nike trainers
mlb jerseys
michael kors outlet
canada goose outelt
swarovski crystal
air jordan 4
lacoste pas cher
kobe bryants shoes
cheap football shirts
swarovski crystal
parajumpers outlet
canada goose outlet
ralph lauren outlet
air jordan 11
phone cases
michael kors canada
longchamp handbags
louis vuitton bags
1119minko

xumeiqing said...

151212meiqing
canada goose jackets
louis vuitton outlet
christian louboutin outlet
ugg boots
north face jackets
uggs on sale
uggs for sale
hollister uk
michael kors uk
timberland boots
ugg outlet
louis vuitton handbags
burberry outlet
oakley sunglasses
nike air max
michael kors outlet
polo ralph lauren
ugg outlet
true religion jeans
cheap jordans
marc jacobs
ugg australia
hollister kids
louis vuitton
christian louboutin outlet
nike air max
louis vuitton handbags
gucci handbags
coach outlet store online
oakley sunglasses
hollister clothing
ray ban outlet
michael kors outlet online
canada goose jackets
prada outlet
ray ban sunglasses outlet
jordan retro
ray-ban sunglasses
prada uk
louis vuitton outlet stores

mitchel lee said...


Game of Thrones Season 6
Game of Thrones Season 6 Streaming
Watch Game of Thrones Season 6 Online
Watch Game of Thrones Season 6 Streaming
Watch Game of Thrones Season 6 Full Episode
Game of Thrones Season
Game of Thrones Season 6 Streaming
Watch Game of Thrones Season 6 Online
Watch Game of Thrones Season 6 Streaming
Watch Game of Thrones Season 6 Full Episode


Watch Movies Online
Download Movies Free
Watch Elvis & Nixon Online
Watch Ice Age: Collision Course Online
Watch Pete’s Dragon Online
Watch Hardcore Henry Online
Watch The Boss Online
Watch Fan Online
Watch Louder Than Bombs Online
Watch The Jungle Book Online
Watch Barbershop: The Next Cut Online
Watch Criminal Online
Watch Deadpool Online
Watch Zootopia Online
Watch Whiskey Tango Foxtrot Online
Watch Gods of Egypt Online
Watch Kung Fu Panda 3 Online
Watch The Divergent Series: Allegiant Online
Watch Batman v Superman: Dawn of Justice Online
Watch My Big Fat Greek Wedding 2 Online
Watch God’s Not Dead 2 Online
Watch My Golden Days Online

Qing Cai said...

lacoste polo shirts
swarovski outlet
michael kors uk
kobe bryants shoes
mcm outlet
toms outlet
rolex watches
mulberry outlet
louis vuitton neverfull
michael kors canada
michael kors outlet online
longchamp handbags
nike air huarache
longchamp outlet
polo ralph lauren
snapbacks wholesale
oakley sunglasses
soccer jerseys
polo shirts
swarovski crystal
ralph lauren outlet
hermes birkin bag
true religion jeans
hermes outlet
ray ban sunglasses
herve leger dresses
juicy couture outlet
toms shoes
swarovski jewelry
lebron james shoes
cai20160422

Yuanyuan Lin said...

7.12lllllyuan"oakley sunglasses wholesale"
"louis vuitton handbags outlet"
"ray-ban sunglasses"
"michael kors wallet"
"ray ban sunglasses"
"oakley sunglasses wholesale"
"longchamp handbags"
"juicy couture tracksuit"
"prada sunglasses for women"
"swarovski outlet"
"ralph lauren polo"
"longchamp outlet online"
"links of london"
"cartier watches"
"nike roshe run"
"asics"
"ferragamo outlet"
"cheap ray ban sunglasses"
"polo ralph lauren"
"michael kors outlet"
"nike tn pas cher"
"ray ban sunglasses"
"tiffany and co"
"tory burch outlet online"
"michael kors outlet"
"mulberry outlet"
"tiffany jewellery"
"tory burch outlet"
"babyliss pro"
"police sunglasses for men"
"prada outlet online"
"soccer jerseys"
"michael kors clearance"
"mcm outlet"
"true religion jeans outlet"
7.12

John said...

kobe bryant shoes
coach factory outlet online
oakley sunglasses wholesale
michael kors outlet store
cheap ray bans
yeezy boost
louboutin shoes
cheap jerseys wholesale
ralph lauren uk
christian louboutin outlet
2016105yuanyuan

Unknown said...

seahawks jersey this
yeezy boost 350 black would
baltimore ravens jerseys website
new england patriots jerseys almost
valentino shoes at
under armour shoes back
carolina jerseys This
yeezy boost 350 have
hugo boss sale for
dolce and gabbana shoes easy

chenmeinv0 said...

christian louboutin
ray ban sunglasses
christian louboutin paris
air jordans
cheap rolex watches
pandora jewelry
adidas originals uk
chanel bags
coach outlet
ray ban wayfarer
hzx20170225

Unknown said...

michael kors handbags
coach outlet
cheap jordans
cheap michael kors handbags
hugo boss sale
giants jersey
buffalo bills jerseys
jets jersey
raiders jerseys
ecco shoes

John said...

longchamp bags
christian louboutin shoes
discount oakley sunglasses
louboutin outlet
cheap air max
ralph lauren
true religion outlet online
michael kors outlet canada
longchamp handbags
yeezy boost
20170703yuanyuan

John said...

longchamp bags
christian louboutin shoes
discount oakley sunglasses
louboutin outlet
cheap air max
ralph lauren
true religion outlet online
michael kors outlet canada
longchamp handbags
yeezy boost
20170703yuanyuan

قمة الدقة said...

شركة المثالية للتنظيف بالدمام
شركة المثالية للتنظيف بالخبر
شركة المثالية للتنظيف بالجبيل
شركة المثالية للتنظيف بالقطيف
شركة المثالية للتنظيف بالاحساء
شركة كشف تسربات المياه براس تنورة

dong dong23 said...

christian louboutin outlet
ugg outlet
nba jerseys
ugg boots
polo ralph lauren outlet
ugg boots
nhl jerseys
michael kors outlet
salvatore ferragamo outlet
kate spade outlet
20179.25wengdongdong

林磊 said...

2017106 leilei3915

ugg boots
cheap jerseys
kate spade handbags
michael kors outlet online
michael kors handbags clearance
ralph lauren shirts
coach outlet online
prada outlet
coach outlet online
fred perry polo

林磊 said...

2017106 leilei3915

ugg boots
cheap jerseys
kate spade handbags
michael kors outlet online
michael kors handbags clearance
ralph lauren shirts
coach outlet online
prada outlet
coach outlet online
fred perry polo

Cara Mengobati Usus Buntu said...

This information is very useful. thank you for sharing. and I will also share information about health through the website

Cara Mengobati Sinusitis
Penyebab Mual dan BAB Berdarah
Perawatan kesehatan mata
Bahaya Tenggorokan Nyeri
Cara Mengatasi asam Lambung

Obat Keputihan Alami said...

Thank you for joining us. his article is very helpful

Obat Maag Alami
Cara Mengobati Hematuria
Obat Penambah Berat Badan
Cara Mengobati Penyakit Kista
Cara Mengobati Sesak Napas Alami
Cara Mengobati Penyakit Gagal Jantung

haiyan wu said...

yeezy 700
michael kors handbags
true religion jeans
cheap nfl jerseys
golden goose francy
adidas yeezy
yeezy shoes
yeezy boost 350
kayno
fitflops sale clearance

love said...

zzzzz2018.7.24
canada goose jackets
nike factory store
dsquared
nhl jerseys
christian louboutin shoes
ralph lauren outlet
pandora
ray ban sunglasses
nike blazer pas cher
louboutin shoes

xjd7410@gmail.com said...

20180727 junda
adidas ultra boost
grizzlies jerseys
michael kors outlet
nets jerseys
michael kors outlet
air jordan 4
ralph lauren polo
ray ban outlet
coach outlet
air jordan 4

jeje said...

Vous pouvez voir sur cette Nike Air Max 97 soldes publication beaucoup de souffrances du style de détresse obtenir une aide précieuse dans l'activité de la marche. Moins nous avons de graisses supplémentaires, plus nous découvrons des caractéristiques spécifiques. Lorsque chaussure nike roshe run prix vous déguisez les vêtements que vous voulez porter à l'intérieur de la course et que vous commencez à courir, attendez une minute, ce n'est pas le nike baskets basses à lacets air max siren moment de courir. Les petits cailloux qui se clipsent dans la semelle doivent être éliminés, cela influencera la forme et la nike internationalist noir pas cher fonction de freinage. Créé par l'Union Cutlery Company en 1941, cet outil de survie polyvalent était exclusivement commandé par le gouvernement et conçu pour être efficace New Balance 533 Chaussures comme arme défensive, marteau, ouvre-boîte, outil d'excavation et outil de coupe. Plusieurs des stars les plus chères des cow-boys américains ont porté le Stetson, y compris John air jordan flight pas cher femme Wayne et Gene Autry.

zzyytt said...

yeezy boost 350 v2
basketball shoes
michael kors factory outlet
adidas nmd r1
balenciaga
baseball jerseys
jordans
adidas stan smith
michael kors outlet online
zx flux

zzyytt said...

yeezy boost 350 v2
basketball shoes
michael kors factory outlet
adidas nmd r1
balenciaga
baseball jerseys
jordans
adidas stan smith
michael kors outlet online
zx flux