• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Yi Meng
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • 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 ]
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic