Giter Site home page Giter Site logo

fabianlauer / tsxml Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 4.49 MB

A small XML parser and serializer. No dependencies, no hassle.

License: MIT License

TypeScript 34.11% HTML 42.84% XSLT 3.58% Makefile 0.08% JavaScript 19.38%
xml-parser xml-serialization formatter

tsxml's People

Contributors

fabianlauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tsxml's Issues

Lock-up on unterminated comments

It appears that parsing input which contains an unterminated XML comment causes tsxml to begin traversing beyond the end of the string searching for the closing token. I’m hoping to work on reproducing this and coming up with a fix soon!

Attribute ending in backslash fails formatting

From FabianLauer/vs-code-xml-format#6:

An attribute like:

<absPath url="D:\Users\kgunders\Documents\MR\Projects\HyperLinkSheets"

Will cause the following error:

XML formatting failed: at line 2, column 694: namespace prefix must be followed by a tag name.

Here is more context from the problematic XML:

<Choice Requires="x15">
    <absPath url="D:\Users\kgunders\Documents\MR\Projects\HyperLinkSheets\" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac" />
</Choice>

A work around is to temporarily add a character after the backslash, format, and remove the extra character.

Max Line Length

There should be a way to limit the line length and insert a line break after a certain number of characters, eg:

<a>
    <values alpha="1" beta="2" delta="3"
            gamma="4" />
</a>

Support void elements as in HTML5 <meta>, <link>, etc

To be able to parse HTML, support for "void elements" is necessary. These elements do not require a closing tag or closing slash, for example:
<meta charset="utf-8">

To support these elements, the parser will need a list of tag names where this is allowed (or even enforced). Without such a list, the parser can not determine whether a void element is one on purpose or whether the missing closing tag or slash is actually syntax error.

The list of void tags for HTML5 can be found here:
https://www.w3.org/TR/html-markup/syntax.html#syntax-elements

Error on format code in a Ternary Operator

I have tried to use Ternary Operators with expression using < and I got the error above, but not when using something like that !=:

XML formatting failed: at line 13, column 76: expected exclamation mark, question mark or alphabetic tag name.

<StackLayout>
    <Label text="label using < " visibility="{{ p.cond < 1 ? 'visible' : 'collapsed' }}"  />
    <Label text="label using != " visibility="{{ p.cond != 1 ? 'visible' : 'collapsed' }}" />
</StackLayout>

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.