What the code that you posted does is retrieve the identity constraints
from types that have only one element in their content model. In
particular, this works for constraints that are declared on top-level
elements but not for others.
Since you want not only the constraints, but also their scope,
Like Jacob said, XmlError.getObjectLocation() should do the trick. When
you say 'the source XmlObject field' do you mean the "String source
field"? If so, this is the name of the XML document and whether it gets
set or not depends on how you parse your document.
Radu
On Tue, 2007-05-08 at 13:24 -
Vance,
The key is to get an XmlObject whose Schema type (as returned by
XmlObject.schemaType()) is the Schema type that you want to validate
against. There are multiple ways to get that, but in your case what may
be applicable and don't think was mentioned thus far is
SchemaTypeLoader.newInstance(
Hi Jacob,
Thanks for taking the time to help out. Unfortunately, the XSD is
user-provided, meaning that it is a full-fledged schema that we have no control
over. We display fields that match what the schema requires (and we have this
part working great using XmlBeans), but as we've been discu
Have you tried using simpleTypes in your XSD for these values.
ie
You could then refer to this type in various places in the schema
...
And when you got the user input you would be able to do something like:
VehicleTypeValidateElement v =
VehicleTypeValidateElement.Factory
Hi Jacob,
Ah, I can see how you that could be confusing. Imagine an editor display like
the following (this is a contrived example, but is similar to what we're doing):
Vehicle (no input allowed, this is a parent element that can't hold a value)
Model number: __ (the value should be
Hi Jacob
Thanks for the reply
I don't think line numbers will completely solve our problem - although
its a good suggestion that we might utilize in other ways. Our issue is
that we abstract the document and XML details from users and have
"tried" to use only the XMLBeans libraries and generated
I know you can get line information from the XmlError, will this not
work for you?
What about getting the XmlCursor using the
XmlError.getCursorLocation() or even XmlError.getObjectLocation()?
I have had success with those in the past, is there something
preventing you from using them?
-Jacob Dann
Hi Vance,
I guess I'm a little confused as to what you are trying to do. It
sounds like you are trying to validate user input with xmlbeans
without a schema or values since you don't care about the elements or
other data.
Why not use some kind of form validation? - since xml/xsd is not
important t
Our application invokes the validate method of XML object and saves the
returned XmlError messages through an XmlOptions instance containing a
collection. We need to be able to report back to the user a list of
invalid nodes and attributes, but it seems the source XmlObject field in
the XmlError i
A couple of questions
1.
I am having a problem where I cannot find certain
schemaIdentityConstraints in the generated code for our XSD. Our code
walks the schema and derives a mapping from the constrained element to
its actual constraint and scope in the model. This is working for the
vast majorit
11 matches
Mail list logo