• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSLT:XML->XML:Auto-Add undesirable xmlns declaraction ..... please help

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to do an xml to xml transformation using xslt, my source xml is fully qualified while my desired result xml is not. The problem is as follows,

source xml


xslt



and result xml



what i really hate is the xmlns:a="http://some.namespace.com/" part in the result xml file... i don't want that....can anyone help???

Thank you very much.
[ November 07, 2006: Message edited by: Yi Meng ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't actually a problem, you know. The namespace declaration may be taking up space, but it doesn't change the meaning of the XML document in any way.
 
Yi Meng
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Clapham:
This isn't actually a problem, you know. The namespace declaration may be taking up space, but it doesn't change the meaning of the XML document in any way.



Thank you, I generally agree with you, but...

My client is using a dtd and it gives a complaint, sth like Attribute "xmlns:a" must be declared for element type "b"

I don't want to blame their dtd and instead i'd like to omit that xmlns declaraction if possible in xslt... otherwise, i will basically have to do a text edit...
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, working around other people's buggy software (and identifying a namespace declaration as an attribute is definitely a bug). I took a quick look in the XSLT FAQ and found this in the "Namespaces" section:

http://www.dpawson.co.uk/xsl/sect2/N5536.html#d6682e1543
 
Yi Meng
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Clapham:
Ah, working around other people's buggy software (and identifying a namespace declaration as an attribute is definitely a bug). I took a quick look in the XSLT FAQ and found this in the "Namespaces" section:

http://www.dpawson.co.uk/xsl/sect2/N5536.html#d6682e1543



Thank you very much, Paul. That is really useful...


The solution is to modify the xslt to....just for those concerned...

[ November 08, 2006: Message edited by: Yi Meng ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic