Skip to content
This repository has been archived by the owner on Dec 25, 2018. It is now read-only.

System.Xml.Linq #13

Open
agnauck opened this issue Mar 1, 2015 · 11 comments
Open

System.Xml.Linq #13

agnauck opened this issue Mar 1, 2015 · 11 comments

Comments

@agnauck
Copy link

agnauck commented Mar 1, 2015

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

@electricessence
Copy link
Owner

Ok!

@electricessence
Copy link
Owner

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
Copy link
Owner

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

@agnauck
Copy link
Author

agnauck commented Mar 10, 2015

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

@electricessence
Copy link
Owner

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
Copy link
Owner

Also, I didn't see any pull request.

@electricessence
Copy link
Owner

@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. :)

@agnauck
Copy link
Author

agnauck commented Mar 19, 2015

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 ;-)

@electricessence
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants