XSLoader loads the schema for you, have a look for that.

As for auto-completion, there is no support for this in Xerces that I know
of. I'm faced with a similar challenge, and it looks I have to implement
that myself (there isn't even a syntax tree that you can query, you'll have
to build that up by analysing the DOM and cross-referencing it with the
Schema grammar. The Schema API is your friend (or not)!
One thing to start with is to load the XML DOM with schema validation turned
on and querying the ElementPSVI, which gives you the XSElementDeclaration
for this element. But you'd need to re-parse the document every time you add
a node, so I'm not sure how well that'll scale with larger documents.

Good Luck,

Uwe


On Thu, Oct 21, 2010 at 8:50 AM, Don Smith dsmith-at-locke-smith.com |
xerces.apache.org/Example Allow| <vk4xkjx...@sneakemail.com> wrote:

> I need to implement an XML editor that validates against XML Schema. I want
> to provide the users XML code completion based on the Schema (like every XML
> editor) so they don't have to know the Schema themselves. Can someone point
> me to the classes to use in Xerces for reading the Schema and determining
> the valid elements from an arbitrary context in the document, or perhaps an
> example of doing this with Xerces?
>
> Thanks,
>
> Don
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org
>
>

Reply via email to