Git Product home page Git Product logo

vscode-sxml's People

Contributors

dependabot[bot] avatar oscarlevin avatar raffazizzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-sxml's Issues

Tag not allowed when it should and hints not working

Hello, thanks for this wonderful tool! I am experiencing some issues when reading this sample TEI document that should be well formatted:

I've got tag not allowed here — "availability" (http://www.tei-c.org/ns/1.0) when in fact it should, and also I can't see any documentation when I use ctrl+space. Am I doing something wrong? Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
  href="https://vault.tei-c.org/P5/current/xml/tei/custom/schema/relaxng/tei_all.rng"
  schematypens="http://relaxng.org/ns/structure/1.0"
  type="application/xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang="en" xml:id="basic_ms_sample2">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Basic Manuscript Encoding Sample</title>
        <author xml:id="jf">
          <persName ref="/path/to/WWP/personography.xml#jflanders.lfw">Julia Flanders</persName>
        </author>
        <respStmt xml:id="sb">
          <resp>encoder</resp>
          <persName ref="/path/to/WWP/personography.xml#sbauman.emt">Syd Bauman</persName>
        </respStmt>
      </titleStmt>
      <publicationStmt>
        <availability status="restricted">
          <ab>Copyleft 2010 Syd Bauman and the Women Writers Project</ab>
        </availability>
      </publicationStmt>
      <sourceDesc>
        <!-- much of the manuscript description is fictional -->
        <msDesc>
          <msIdentifier>
            <country>United States of America</country>
            <settlement>Providence</settlement>
            <institution>Brown University Library</institution>
            <repository>Center for Digitial Scholarship</repository>
            <collection>TEI Teaching Materials</collection>
            <msName>Basic MS Sample 06</msName>
          </msIdentifier>
          <msContents>
            <summary>Only 1 page which represents the entirety of chapter 1 is extant.</summary>
            <textLang mainLang="en" otherLangs="fr"> The document is written in English with
              scattered short French passages with which to demonstrate the use of
                <att>xml:lang</att>
            </textLang>
            <msItemStruct>
              <author>
                <persName ref="/path/to/WWP/personography.xml#jflanders.lfw">Julia
                  Flanders</persName>
              </author>
              <incipit>Chapter 1: The Manor House</incipit>
              <explicit>End of Chapter 1.</explicit>
              <!-- <decoNote>* -->
              <filiation>This text is a hand transcription of <ref
                  target="http://www.wwp.neu.edu/encoding/current/presentations/html/basic_encoding_01.xhtml"
                  >our basic encoding slide</ref> with some minor, but deliberate, changes by the
                author to make it more suitable for teaching manuscript encoding.</filiation>
              <note resp="#sb">The <gi>filiation</gi> element is really supposed to be about the
                relationship of this manuscript to <cit>
                  <quote>surviving manuscripts of the same text</quote>
                  <ptr target="http://www.tei-c.org/release/doc/tei-p5-doc/en/html/MS.html#msfil"/>
                </cit>.</note>
            </msItemStruct>
          </msContents>
          <physDesc>
            <objectDesc form="USLetter">
              <supportDesc material="paper">
                <support>standard US copy machine paper, white</support>
                <extent>The original is 1 page, which has fewer than 750 characters</extent>
                <foliation>There is no page numbering or other sequencing information</foliation>
                <collation>Single leaf</collation>
                <condition>Deliberately damaged with 2 coffee stains near the bottom of the written
                  portion of the page. One is light, through which text can easily be seen, the
                  other is dark and obscures the underlying text somewhat.</condition>
              </supportDesc>
              <layoutDesc>
                <layout columns="1" writtenLines="16">No ruling, no pricking</layout>
              </layoutDesc>
            </objectDesc>
            <handDesc hands="2">
              <summary>Written in two contemporary hands, although that of the major contributor is
                occasionally in blue ink.</summary>
              <handNote xml:id="jflanders_blue" script="cursive" medium="ink-blue" scope="minor"
                scribe="jflanders.lfw"/>
              <handNote xml:id="jflanders_black" script="cursive" medium="ink-black" scope="major"
                scribe="jflanders.lfw"/>
              <handNote xml:id="sbauman_black" script="printing" medium="ink-black" scope="minor"
                scribe="sbauman.emt"/>
            </handDesc>
            <accMat>This sample is included as part of the WWP <ref
                target="file:///Users/syd/Documents/WWPweb/encoding/current/presentations/html/basic_manuscript_encoding_00.xhtml"
                >presentation on basic MS encoding</ref>.</accMat>
          </physDesc>
          <history>
            <origin>The manuscript was created on or about <date when="2010-09-22">Wed 22 Sep
                2010</date></origin>
            <provenance><!-- fictional -->The manuscript was part of <persName>Dot
              Porter</persName>’s personal collection of J. Flanders memorabilia before it was
              stolen.</provenance>
            <provenance><!-- fictional -->After the FBI recovered the manuscript, it was held in
              Langley, VA for <date when-iso="P17M" precision="medium">~17
              months</date>.</provenance>
            <acquisition><!-- fictional -->After the trial was over, <persName>Dot Porter</persName>
              asked the FBI to send the manuscript to the <name type="org">Center for Digital
                Scholarship</name>; it arrived <date when="2010-09-23">Thu 23 Sep
              2010</date>.</acquisition>
          </history>
          <additional>
            <adminInfo>
              <recordHist>
                <source>invented by <persName ref="#sb">Syd</persName></source>
              </recordHist>
              <availability status="restricted">
                <p>Copyleft 2010 by Julia Flanders and the Women Writers Project</p>
                <p>While there are currently no restrictions on viewing the manuscript, it is only
                  circulated among participants in WWP manuscript encoding workshops and
                  seminars.</p>
              </availability>
            </adminInfo>
            <surrogates>~5 photocopies were made on <date when="2010-09-24">the first day of the
                first introductory workshop</date>.</surrogates>
          </additional>
        </msDesc>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change when="2010-09-24" who="#sb">created</change>
    </revisionDesc>
  </teiHeader>
  <facsimile>
    <surface facs="../presentations/gfx/basic_ms_sample2.pdf" n="1"/>
  </facsimile>
</TEI>

Problems with regular expressions

There seems to be a problem with validating RegEx in attributes:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
  <meiHead>
    <fileDesc>
      <titleStmt>
        <title>Simple test file RegEx</title>
      </titleStmt>
      <pubStmt>
        <respStmt>
          <persName>Klaus Rettinghaus</persName>
        </respStmt>
      </pubStmt>
    </fileDesc>
  </meiHead>
  <music>
    <body>
        <div>
            <p>
                <rend color="rgb(99,99,99)"></rend>
                <rend color="hsl( 360 , 100% , 100%)"></rend>
            </p>
        </div>
    </body>
  </music>
</mei>

Valid XML with duplicated IDs?

At the moment Scholarly XML says XML is valid even when there are duplicate IDs.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.1/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0" ?>
<?xml-model href="https://music-encoding.org/schema/4.0.1/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron" ?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.1">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title xml:id="A">Title A</title>
                <title xml:id="A">Title A</title>
            </titleStmt>
            <pubStmt>
            </pubStmt>
        </fileDesc>
    </meiHead>
    <music>
    </music>
</mei>

Support for PreTeXt documents

I am the developer of the pretext-tools extension, which provides tools for working with PreTeXt documents. These are XML with a particular schema, so your sxml extension is of great interest. Instead of forking your project and integrating parts directly into pretext-tools, I wonder if it would make more sense to contribute to vscode-sxml directly to provide the flexibility I would need to require it by pretext-tools (I hope I have that language right).

Here are the features that I would love to see implemented (and would be happy to work on myself):

  • Support for the ptx language (which is really xml, but pretext-tools defines a new "language" recognized on the file extension .ptx). So some way to start validation for such files.
  • The ability to specify the schema used universally, rather than included at the top of each file. Perhaps on a project level, but of course, respecting the current behavior for xml files that have the schema referenced in the file.
  • Support for xi:include (your #28 )
  • Use of snippet-like behavior for completions. No idea how easy/hard this is, but it would be great if the completion suggestions were for more complex snippets that were provided by pretext-tools (in the case of ptx files; otherwise snippets specified for xml by the user).

Would love to hear your thoughts on these ideas.

Reload schemas that have changed on disk

Hi,

I found your plugin when looking for a RelaxNG validator. It appears to work great (thank you!), however I've noticed that it caches schemas/grammars indefinitely. This clearly works for well-defined schemas, however does not work when concurrently developing a RNG schema, forcing me to restart vscode to revalidate the XML.

The RNG schemas are in the same project and on disk. A solution that requires no further user action if preferred, e.g. adding the file's last-modified date to the cache preferred, but perhaps falling back to user-friven shortcut to flush the grammar cache could address this in a pinch.

Thanks!

Command 'sxml.wrapWithEl' not found

grafik

CTRL+E for wrapping not working.

Version: 1.69.2 (user setup)
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Datum: 2022-07-18T16:12:52.460Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
Betriebssystem: Windows_NT x64 10.0.19043

XML escape entities not correctly highlighted

The regex matching them may be too permissive. Example

&<tag>asdasd</tag>
more text <tag>sdf</tag>
text;

shows the error only at the semicolon, or at the end of the document if there is no semicolon.

TEI writing convention for pointing to xml:id values

Hello, I am very interested in using Scholarly xml in class for teaching TEI to DH students. It would be great if we could have a solution to use TEI convention of referencing an ID value with a hashtag (#) in the value's attribute pointing to the ID, like for example:
<persName xml:id="DL">Diogenes Laertius</persName><del resp="#DL">blabla</del>

It would be a serious improvment for TEI community !

Support for xinclude

Currently xinclude elements raise a validity error. Scholarly XML should process xi:include elements before validation.

Better feedback when RelaxNG file isn't correctly associated

Currently, if the <?xml-model?> processing instruction isn't associated correctly, the extension only shows "Loading..." when trying to use Intellisense. There should be better feedback for the user.

Example (notice the erroneous use of @file instead of @href:

image

Cursor position on new line

Ensure that when entering a new line the cursor is position in the right place in the hierarchy. Currently it's positioned at the same column as the start tag of the parent element.

Improve responsiveness for large XML files by turning off background validation.

I am playing around with this extension and I am generally impressed by the functionality, which leads me to recommend VSCoce as a viable alternative to oXygen for editing XML files with bi-directional content. However, when I am editing a rather large XML file of some 5,5 MB (a TEI-encoded bibliography of more than 3500 entries), suggestions take about 5-10 seconds after typing the opening bracket <. I assume that the problem is that in the background the extension re-validates the XML because typing < invalidated the document (wellformedness is obviously violated). It would be great if one could turn off continuous validation for this purpose.

Another benefit of such an option would be massive energy savings and thus improved battery life even on modern laptops. Editing said XML file, my recent 15" MacBook Pro uses 300% CPU cycles for VSCode and the extension, quickly draining the battery.

Select a license

Hi,

Can you please select a license for this repository? I'd like to consider modifying this package to better suit my requirements (see #10).

Thanks!

Support Relax NG selection by VS Code settings

Please, add support to select .rng file for XML files by VSCode configuration. For example:

"xml.validation.relaxng.associations": {
	"src/doc/**/*.xml": "tools/docs/rng/OpenDocument-v1.3-schema.rng"
}

or

"xml.validation.xml-model.associations": {
	"src/doc/**/*.xml": {
		"href": "tools/docs/rng/OpenDocument-v1.3-schema.rng",
		"schematypens": "http://relaxng.org/ns/structure/1.0",
		"type": "application/xml"
	}
}

Intellisense not working with Scholarly XML

Intellisense (code suggestion and completion) doesn't work with Scholarly XML. ctrl-space brings up "Loading ..." and sticks there. Intellisense works fine with other languages/plugins. Any help much appreciated.

wrap selection & suggestions

Is there any chance to combine the wrap selection with element function with schema based suggestions "oxygen" style? So that when you make a selection, hit the hotkey, suggestions are made for the wrap around element are made similar to those when inserting a new element?

Validate multiple schemas/models on single file?

Hi.

I'm trying to use this extension to validate schemas for Odoo XML, it works somewhat fine with the base fields using the XML below:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
  href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/import_xml.rng"
  schematypens="http://relaxng.org/ns/structure/1.0"
  type="application/xml"?>

However in addition to the import_xml.rng file they also have additional RNG files for various tags here: https://github.com/odoo/odoo/tree/16.0/odoo/addons/base/rng

I'd like to also at least validate tree_view.rng file as it's not in the import_xml.rng file.

I tried adding an additional<?xml-model?> tag that points to the tree_view.rng file, as per the w3c spec example at the bottom here https://www.w3.org/XML/2010/01/xml-model/#d29e669

<?xml-model href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/import_xml.rng"
  schematypens="http://relaxng.org/ns/structure/1.0"
  type="application/xml"?>
<?xml-model href="https://raw.githubusercontent.com/odoo/odoo/16.0/odoo/addons/base/rng/tree_view.rng"
  schematypens="http://relaxng.org/ns/structure/1.0"
  type="application/xml"?>

However this doesn't seem to work, it's not offering any completion or errors on invalid attributes on my <tree> tags.

Does this extension support multiple schemas?

Apologies if I'm not understanding how this works correctly as I have not worked with XML validation before, any help would be appreciated.

RNG schema is incorrect for a valid RNG schema in Oxygen

Hello, I use regularly Scholarly XML for TEI and never met this problem before : I try to valid my file with a RNG schema that is valid in Oxygen, and the association does not work in VSCode, the error message "RNG schema is incorrect" appears, with mention "could not parse schema".
The schema is valid in Oxygen validator, so it means that there is something that trigger Scholarly XML validation and that is not related to RNG syntax. Is there any internal constraint that could explain this behaviour ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.