TypeScript.NET icon indicating copy to clipboard operation
TypeScript.NET copied to clipboard

System.Xml.Linq

Open agnauck opened this issue 9 years ago • 11 comments

would like to see system.Xml.Linq in the awesome library. maybe this code can be integrated: http://ltxmljs.codeplex.com/

agnauck avatar Mar 01 '15 14:03 agnauck

Ok!

electricessence avatar Mar 06 '15 21:03 electricessence

https://github.com/electricessence/TypeScript.NET/tree/develop-%28System.Xml.Linq%29 Feel free to track this branch. I've done the initial setup to get going. I'll definitely work on it, but if you want to help, please do!

electricessence avatar Mar 06 '15 21:03 electricessence

Making progress. Classes are getting their inheritance structure. Still a lot of work to do.

electricessence avatar Mar 10 '15 06:03 electricessence

what is the best way to contribute? I sent a small pull request yesterday, not sure if thats the best way.

agnauck avatar Mar 10 '15 08:03 agnauck

Well I've got some pretty good momentum right now. The best way to contribute is to code review. Ask questions. Challenge assumptions. It's pretty ragged right now, but things are unfolding well. I'm really for looking at the .NET source and comparing the code to make sure we are following their assumptions.

electricessence avatar Mar 11 '15 15:03 electricessence

Also, I didn't see any pull request.

electricessence avatar Mar 11 '15 15:03 electricessence

@agnauck: Ok. Made a significant milestone that you could definitely help. I just checked in XObject and I'm confident it is analogous with the C#.NET version. I will assign you a task. :)

electricessence avatar Mar 15 '15 19:03 electricessence

what are you plans for serializing and parsing.

Write:

  1. Implement the .NET XmlWriter
  2. use a custom simple XmlWriter?
  3. use some other existing js or ts lib

Parse:

  1. use the browsers DOMParser like ltxml.js does
  2. use sax.js
  3. use something custom, which is quite a challenge ;-)

agnauck avatar Mar 19 '15 14:03 agnauck

The XmlWriter will be deferred as long as possible. But my philosophy is this: A class should work as well or better than it's .NET counterpart. The API should either be the same or at least be very very close. Leveraging a browser based parser may exclude being able to use it with Node.js.

Right now, everything is unraveling itself. Meaning, although very difficult, dependencies are being implemented step by step. It's a lot of work, but I enjoy the challenge and I learn a lot.

For example, right now I'm implementing XsdDuration which is an internal dependency for XmlConvert. Seems overkill but I'm simply pushing forward. At first I was quite afraid of the amount of daunting work. But I believe I can slowly and steadily make this happen.

Its to the extent that I was considering writing my own C# parser that would transform C# into TS. For the moment I am using a set of Regex replace patterns to get me closer to the result. https://gist.github.com/electricessence/b575f18dc184beb5cc69

electricessence avatar Mar 21 '15 01:03 electricessence

Update: Will take some more time before I start migrating the Xml namespace into the master branch. Changing to AMD became a priority but this is definitely on the horizon.

electricessence avatar Sep 27 '15 23:09 electricessence

Update: the traverse methods have been updated with better typing. Work well with node walking.

electricessence avatar May 05 '16 03:05 electricessence