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
<[email protected]>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
>

Reply via email to