You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Jerry Carter <je...@speechworks.com> on 2002/06/22 03:21:40 UTC

Removing unwanted xmlns attributes

I checked that archives but couldn't find answer to this simple namespace
question.  I have the document

  <?xml version="1.0"?>
  <foo:root xmlns:foo="http://www.example.com/foo">
  <data> Hello </data>
  </foo:root>

which I'd like to transform to

  <?xml version="1.0" encoding="UTF-8"?>
  <greeting> Hello </greeting>

Using Xalan 1.3, I am getting

  <?xml version="1.0" encoding="UTF-8"?>
  <greeting xmlns:foo="http://www.example.com/foo"> Hello </greeting>

with an extra xmlns attribute.  I'd like to remove this but using
exclude-result-prefixes="foo" does not help.  What am I doing wrong?
Explicit examples would be very much appreciated.

Thanks.