1

I'm writing XML that will be consumed by the Windows WebFolder (for mounting a WebDAV volume). WebFolder requires that all elements have a prefix on them, so instead of this:

<one xmlns="DAV:">
    <two />
    <three />
</one>

I need to do this:

<D:one xmlns:D="DAV:">
    <D:two />
    <D:three />
</D:one>

This is ugly and should be unnecessary, but it's Microsoft, and they do it their way, so whatever. The question is, how can I tell JDOM to write the XML this way?

1 Answer 1

3

Found the answer: the JDOM Namespace class has a 3-arg version that takes a local name, namespace, and prefix. If you use that version with the desired prefix, it works as desired. Sorry for the dumb question, maybe this will help somebody else.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.