Menu

#116 Internal catalog

open
5
2014-09-14
2008-02-03
Belgabor
No

Could you add an internal catalog? What I mean is the ability to map root elements and/or namespaces to local schema files for validation and/or auto-complete.

In fact that could solve a long standing short-coming: A way to map relaxng schemas to a document, enabling single keypress rng validation (without needing to remember which position it got in the menu) and validate-as-you type validation as you already have for XML Schemas.

I would suggest implementing it as a simple list consisting of
- root element (optional)
- namespace (optional if root element given)
- schema type (DTD, XML Schema or RelaxNG)
- schema file
- separate schema file for auto-complete (optional)

The last would allow (for example) to validate against RelaxNG, but use a simpler XML Schema for auto-complete (especially as long as you don't implement RelaxNG-based auto-complete ;-) ).

Cheers

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Yes, I agree. I've been looking at this option for a while and this is what James Clark has implemented for the nXML emacs mode.

    RNG has been tricky because libxml doesn't do much to share the contents of the grammar once it's loaded. Xerces is much more helpful there (though it doesn't read RNG/RNC of course).

    The next big change coming up should enable me to get around this: currently auto-completion and validation-as-you-type is based on a simplified content model derived from XSD and DTD, which is obviously unsatisfactory. I want to replace this behaviour with a full validating parse of the current parent, stopping at the insertion point. Provided libxml supports validation of parts of the DOM tree Xerces and libxml together should provide full grammar-based insertion help.

    (This would still allow the application to scale to 24MB docs without taking a serious performance hit.)

    -Gerald

     
  • gnschmidt

    gnschmidt - 2008-02-05
    • assigned_to: nobody --> gnschmidt
     
  • Bernhard Weichel

    Could you support oasis-open catalogs even to find the schema location.

    for example


    OVERRIDE YES

    SYSTEM "http://www.w3.org/2001/03/xml.xsd" "xml.xsd"
    SYSTEM "xml.xsd" "xml.xsd"

    SYSTEM "AUTOSAR.XSD" "./AUTOSAR_4-2-1_COMPACT.xsd"
    SYSTEM "AUTOSAR_4-1-3.xsd" "./AUTOSAR_4-2-1_COMPACT.xsd"
    SYSTEM "AUTOSAR_4-2-1.xsd" "./AUTOSAR_4-2-1_COMPACT.xsd"

    then should match


    <AUTOSAR xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://autosar.org/schema/r4.0"
    xsi:schemaLocation="http://autosar.org/schema/r4.0 AUTOSAR_4-1-3.xsd"


    to AUTOSAR_4-2-1_COMPACT.xsd

    System files are resolved relative to the position of the catalog.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.