Hi Peter and thanks for the explanation. It's been awhile; I've been on
vacation for a week.
Anyway, I tried what you said about the XPath expressions and it looks like
you're correct. I'm using the Java core XPath libraries and the prefix I
set in an instance of NamespaceContext is what dictates
Hi Michael,
OK - now this is getting to the heart of the question...
On Thu, 2014-08-07 at 16:02 -0400, Michael Bishop wrote:
Hi Peter,
You're right, I came across that table recently since I've been
working at this problem most of the day. Let me share one more thing
I've discovered. It
I've got to figure out how to debug it. Currently, it's in a Maven project
with the XMLBeans plugin running the schema compilation.
The map works when I call save(options) or xmlText(options), but not when
the document is created (Factory.newInstance(options)).
// Option that sets the namespace
OK, here is a test schema:
?xml version=1.0 encoding=UTF-8 ?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:aaa=bbb:ccc:ddd:eee:fff:aaa
targetNamespace=bbb:ccc:ddd:eee:fff:aaa
elementFormDefault=qualified
xs:element name=test type=aaa:testType/
Hi Michael,
There is a table in the Javadocs that states which options are used by
which methods: see
http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/XmlOptions.html.
You have to make the prefix suggestion in the options to a save or xmlText
method: they won't have any
Michael,
That's odd, please check that your namespace URI is exactly the same in
both the schema and the map you're setting. Also, make sure the prefix
you want is not already used in your document with a different URI.
If it's still not working and you're not afraid of debugging, you can
OK, thanks for the information. Unfortunately, this doesn't seem to fix the
problem. I thought I'd tried the steps outlined in the linked blog before,
but I did it again, just in case.
Here's the full schema definitions:
Old:
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
If you don't provide a prefix, XmlBeans will automatically pick a
prefix, and it tries to pick one that is part of the URI.
Cezar
On 07/28/2014 01:27 PM, Michael Bishop wrote:
Hello all. I've recently changed the namespace of my schema. Now I'm
getting the wrong prefix name and I'm not sure
The short answer is to use XmlOptions to configure the prefixes used in your
XmlBeans output. Something like the following will cause it to use xxx for
yyy:aaa:bbb:ccc. XmlBeans output is NOT tied to the prefixes you declare in
your schema.
HashMap ns = new HashMap();
ns.put(yyy:aaa:bbb:ccc,
9 matches
Mail list logo