icarus-consulting / yaapii.xambly Goto Github PK
View Code? Open in Web Editor NEWA port of Xembly library by Yegor Bugayenko. Lighweight XML parser, generator and manipulator.
License: MIT License
A port of Xembly library by Yegor Bugayenko. Lighweight XML parser, generator and manipulator.
License: MIT License
We have a unittest.
No Unittest.
Xembly uses Atoms 0.5.9
It uses 0.5.8
ANTL4 Parser is ready but not integrated.
ANTL4 Parser works
Update the projects to target netstandard 2.0.
If wie target netstandard2.0 and netcoreapp2.0 we can run xunit on visual studio for mac.
No warnings when compiling.
Still warnings:
Severity Code Description Project File Line Suppression State
Warning CS3021 'XemblyBaseListener' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Antlr4\XemblyBaseListener.cs 44 Active
Warning CS3021 'XemblyLexer' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Antlr4\XemblyLexer.cs 40 Active
Warning CS3021 'IXemblyListener' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Antlr4\XemblyListener.cs 40 Active
Warning CS3021 'XemblyParser' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Antlr4\XemblyParser.cs 43 Active
Warning CS0162 Unreachable code detected Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Directive\Directives.cs 431 Active
Warning CS0162 Unreachable code detected Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Directive\Directives.cs 490 Active
Warning CS0168 The variable 'ex' is declared but never used Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Xembler.cs 127 Active
Warning CS0168 The variable 'ex' is declared but never used Yaapii.Xml.Xembly C:\Users\csa\Source\Git\Yaapii.Xembly\src\Yaapii.Xml.Xembly\Xembler.cs 132 Active
Build
We have a unittest.
No Unittest.
I created a class for retrieving XmlDocument from Node which encapsulates your solution. But I realized that we appearantly do not need the else if, because the msdn says:
Wenn der Knoten ein XmlDocument ist (NodeType ist gleich XmlNodeType.Document), gibt diese Eigenschaft null zurück.
Agreed @koeeenig ?
Project lacks cake script and AppVeyor integration.
Tecnomatix uses .Net 4.6.1 which cannot use ANTLR 4.7.
Xembly uses ANTLR 4.6 which is available for .Net 4.6.1.
We have a unittest.
No Unittest.
We can modify directives and Apply() is not affected.
Is this possible?
Another solution could be that we use the (yet not existing) copyof method, which then should be threadsafe.
But lets discuss, if this is needed or not.
ANTLR4 files are generated, the AppVeyor executes the PreBuild event whic is defined in Yaapii.Xml.Xembly.csproj
Parser files are not generated. They are included manually now.
Doesnt :(
When I change the xembly.g file which is an ANTLR4 source file, the ANTLR4 compiler is triggered and my C# classes are being updated.
I have to trigger the compilation manually.
To trigger the compiler, navigate into project root and call from commandline:
java -jar tools/antlr-4.7-complete.jar -Dlanguage=CSharp .\src\Yaapii.Xml.Xembly\Antlr4\Xembly.g
Java 1.8 is needed.
This test is implemented: https://github.com/icarus-consulting/Yaapii.Xembly/blob/7316280f92154eb434812e7d052147ab21f37cae/tests/Yaapii.Xml.Xembly.Tests/Directive/DirectivesTest.cs#L247
Isnt 👎
Most Tests have the namespace Yaapii.Xml.Xembly.Tests.Directive
some have the namespace Yaapii.Xml.Xembly.Directive.Tests
I think to remeber we said the last one should be used, right?
Mixed namespace
Comments like in PR #49
No comments.
Directive considers xml namespaces
namespaces are ignored
Doesn't :(
Comments like in PR #49
No comments.
Project references Atoms 0.5.8
Add directives to a given XmlDocument
Throws Yaapii.Xml.Xembly.ImpossibleModificationException
var doc = new XmlDocument();
new Xembler(
new EnumerableOf<IDirective>(
new AddDirective("root")
)
).Apply(doc);
Yaapii.Xml.Xembly.ImpossibleModificationException: 'Exception at dir 1: Yaapii.Xml.Xembly.AddDirective'
In the AddDirective The XmlNode dom element is null at OwnerDocument if it is of type XmlDocument.. There fore a new XmlDocument is created as dom element. https://github.com/icarus-consulting/Yaapii.Xembly/blob/b44eae162e96205f6733a47a48bcf91a21caa187/src/Yaapii.Xml.Xembly/Directive/AddDirective.cs#L30-L34
If is pass in a XmlNode into the Apply-Method everything works fine.
We have XPath 2.0 or 3.0
Microsoft C# only supports XPath 1.0
This Issue depends on issue #20
The code works as its designed
Directives accept IText
Directives accepts only string
Cake Build script exists.
Steps are:
No build script for Build server exists
The build script is similar to icarus-consulting/Yaapii.Deployment
We have a unittest.
No Unittest.
There is an Directive e.g. AddComment() to add comments
The code works as its designed
This Issue Depends on issue #14
Add MIT License in all files:
// MIT License
//
// Copyright(c) 2017 ICARUS Consulting GmbH
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
And add missing comments in some files.
Missing License and missing comments.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.