• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why XSL failed to transform the XML when root node has namespace defined?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an XML and XSL. The XML has a root node called <deployment>, the XSL will pick only <service> node (deep copy) and output. The strange thing is that if <deployment> have attributes 'xmlns' and
'xmlns:java' defined, the XSL doesn't output anything. If I change the the <deployment> node in XML from

to

.

The XSL works perfect. Does anybody know why the namespace affect the XSL transformation? Thanks a million.

 
sam joe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry the graemlins ruined the XML. try to repost the XMLs.

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this post is related to XML, I am moving this to our XML and related technologies forum.
Please continue your discussion there.
Regards
Balaji
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to read Ronald Bourret's XML namespaces FAQ.

<deployment> the element's name is "deployment"

<deployment
xmlns="http://xml.apache.org/axis/wsdd/";
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">;

the element's name is "{http://xml.apache.org/axis/wsdd/}:deployment"; the "xmlns" declares the default namespace that the enclosing element belongs to (and any unprefixed element that it contains).

Your XSL matches the <deployment> and <service> it does not match
<{http://xml.apache.org/axis/wsdd/}:deployment>
or
<{http://xml.apache.org/axis/wsdd/}:service>
[ March 15, 2006: Message edited by: Peer Reynders ]
 
sam joe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. After I changed the XSL to



It works. Thanks a lot.
 
Yes, my master! Here is the tiny ad you asked for:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic