[XML-SIG] Stripping a namespace

Douglas Bates bates@stat.wisc.edu
19 Jun 2002 10:35:03 -0500


martin@v.loewis.de (Martin v. Loewis) writes:

> Douglas Bates <bates@stat.wisc.edu> writes:
> 
> > I have another complication with this operation.  The element that I
> > am copying has an xmlns attribute defined and this is propagated when I
> > copy the children.  In the new document I end up with
> > 
> > <i xmlns='http://purl.org/dc/elements/1.1/'>S</i>
> > 
> > and I want only
> > 
> > <i>S</i>
> 
> Can you please explain why you want this? Both documents are equal.

Sorry that I didn't explain things well.

I am extracting information the dc elements in the source XML document
and creating or adding to another XML document.  The description
element within the dc element contains the abstract of the paper,
sometimes with markup such as <i>, <b>, <sup>, <sub> elements.  The dc
element contains xmlns='http://purl.org/dc/elements/1.1/'.  This is
where my understanding gets vague.  It looks like an attribute but I
believe it is in fact a default namespace.

Anyway, when I copy the description element into another document and
PrettyPrint the target document, I end up with all the markup that
appears in the source document as
 <i>S</i>
showing up in the target document as
 <i xmlns='http://purl.org/dc/elements/1.1/'>S</i>

I want the abstract in the target document to appear like the abstract
in the source document.

Does this help?