relaxng / jing-trang

Schema validation and conversion based on RELAX NG
http://www.thaiopensource.com/relaxng/
Other
228 stars 69 forks source link

How to get documentation for element, attribute pattern? #274

Open angelozerr opened 2 years ago

angelozerr commented 2 years ago

I have implemnted successfuly the XML completion based on RelaxNG by using Pattern and visitor.

Now i would like to get the documentation for a given element, attribute and I noticed that ElementPattern doesn't store the annotation documentation.

It seems that https://github.com/relaxng/jing-trang/tree/master/mod/rng-schema/src/main/com/thaiopensource/relaxng/edit can parse and get the documentation of RelaxNG grammar, but it means that I need to parse twice the grammar:

I tried to customize https://github.com/relaxng/jing-trang/blob/84ec6ad578d6e0a77342baa5427851f98028bfd8/mod/pattern/src/main/com/thaiopensource/relaxng/pattern/SchemaBuilderImpl.java#L766 but as SchemaBuilderImpl have a private constructore we cannot extend it.

Many thanks for you help.