Parsing a Schema

This should cover W3C XML Schema, Relax NG and DTD related problems.
Posts: 15
Joined: Thu Feb 26, 2009 12:12 am

Parsing a Schema

Post by dylan » Thu Feb 11, 2010 2:24 am

I am about to start development on a tool that will (in Author mode) provide functionality that is similar to the 'surround with' dialog that is displayed when a user selects some text and hits ctrl+spacebar.

The form I am creating needs to display a list of valid tags that can be applied based on the location of the selected text.

Before I begin from scratch, I was wondering if there is a way for me to utilize the functionality behind the 'surround with' dialog?

If not, is there another way to get a list of valid tags other than manually parsing the schema with a package like XSOM?


Posts: 6927
Joined: Fri Jul 09, 2004 5:18 pm

Re: Parsing a Schema

Post by Radu » Thu Feb 11, 2010 10:23 am

Hi Dylan,

I will assume you are using Oxygen and the Author SDK to customize editing in the Author page.
In Oxygen 11.1 new API was added to the AuthorDocumentController to allow access to an AuthorSchemaManager object:

Code: Select all

  public AuthorSchemaManager getAuthorSchemaManager();
The AuthorSchemaManager contains a method to build an elements context like:

Code: Select all

  WhatElementsCanGoHereContext createWhatElementsCanGoHereContext(int offset) throws BadLocationException;
and then require the elements which can appear at that certain offset:

Code: Select all

  List<CIElement> getChildrenElements(WhatElementsCanGoHereContext context);
Radu Coravu
<oXygen/> XML Editor

Post Reply