incubator-odf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <ben...@basistech.com>
Subject Re: xpath.setNamespaceContext(new OdfNamespace());
Date Wed, 16 Oct 2013 12:32:22 GMT
Svante, what I need is a namespace context, not a namespace.

The code is:

  xpath.setNamespaceContext(OdfNamespace.newNamespace());

That requires a namespace context, and OdfNamespace does not implement that
interface.

I came up with:


         stylesDom = outputDocument.getStylesDom();

        XPath xpath = XPathFactory.newInstance().newXPath();
        xpath.setNamespaceContext(stylesDom);




On Wed, Oct 16, 2013 at 4:01 AM, Svante Schubert
<svante.schubert@gmail.com>wrote:

> Hi Benson,
>
> nice to hear from you again!
>
> Am 15.10.2013 21:42, schrieb Benson Margulies:
> > This line is still in the web doc, but the constructor is private. What's
> > the new recipe?
> >
> OdfNamespace.newNamespace()
>
> The reason why we chose the static factory pattern was that we want to
> be in control of the namespaces.
> For instance, when writing out an ODF XML file the prefix are being
> normalized to the prefix being used in the ODF specification.
>
> Best regards,
> Svante
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message