Hi Richard,

Richard Kelly <[email protected]> wrote on 06/30/2009 08:37:23 AM:

> Hi everyone,
>
> Just a quick question about the XMLAttributes class.
>
> The other structures in the pipeline (QName, XMLString') are read-only
> and I copy the contents elsewhere if I want to modify them;
> e.g.
>
> private final QName fQName = new QName();
> ...
> protected QName normalize(QName qname) {
>  String prefix = qname.prefix != null ? normalize(qname.prefix) : null;
>  // etc
>  fQName.setValues(prefix, localpart, rawname, uri);
>  return fQName;
> }
>
> XMLAttributes, however, are read-write [1], so does this mean I should
> modifying the existing XMLAttributes directly or do I still need to
> copy the contents to another structure?

I think you can modify them in place. The components earlier in the
pipeline should already be done with this object and the ones after the
normalizer would want to be consuming the normalized XMLAttributes. There's
a special implementation of XMLAttributes in the org.apache.xerces.dom.
DOMNormalizer (called XMLAttributesProxy) which may not currently be
excepting that, though I'm sure it could be updated so that it's fully
read-write if it's necessary.

> thanks,
> Richard
>
> [1] http://xerces.apache.org/xerces2-
> j/javadocs/xni/org/apache/xerces/xni/XMLAttributes.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

Reply via email to