Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add System.Xml.Xsl #5593

Closed
terrajobst opened this issue Jan 21, 2016 · 51 comments
Closed

Add System.Xml.Xsl #5593

terrajobst opened this issue Jan 21, 2016 · 51 comments
Assignees
Milestone

Comments

@terrajobst
Copy link
Member

@terrajobst terrajobst commented Jan 21, 2016

.NET Core currently doesn't support running XML transforms (XSLT).

@kwaazaar

This comment has been minimized.

Copy link

@kwaazaar kwaazaar commented Feb 18, 2016

Yes please! I use it a lot to manipulatie OOXML documents (Word). It's much faster than linq to XML. As the OOXML SDK may be ported as well somewhere in the future, my current solution (www.docati.com) requires XslTransform as well.

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Mar 4, 2016

Dupe of #2189?

@SariDev

This comment has been minimized.

Copy link

@SariDev SariDev commented Mar 24, 2016

I would like to see a port.

Maybe you could even improve it by adding support for XSLT 2.0 or maybe even XSLT 3.0+.
Right now the .NET Framework only supports XSLT 1.0 as far as I know.
XSLT 2.0+ makes it easier to transform non xml (text) files as it offers new xslt functions like unparsed-text() and others.

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Aug 24, 2016

This is now in the dev/api branch, so the work is largely done but it's not yet shipped.

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Aug 24, 2016

In src\System.Private.Xml\src\System\Xml\Xslt. I"ll leave this open until it's in master.

@jasongaylord

This comment has been minimized.

Copy link

@jasongaylord jasongaylord commented Aug 25, 2016

Any timeframe for that @danmosemsft?

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Aug 26, 2016

@danmosemsft, I get:

error CS0234: The type or namespace name 'Xsl' does not exist in the namespace 'System.Xml'

with "System.Private.Xml": "4.0.0-*", when I compile using System.Xml.Xsl and using System.Xml.Xsl.Xslt.

Is it added to the contract and is it possible to consume it from our our code using dev/api assemblies?

Note that I have added <add key="myget.org dotnet-core-dev-api" value="https://dotnet.myget.org/F/dotnet-core-dev-api/api/v3/index.json" /> to my NuGet.config temporarily to consume it.

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Aug 26, 2016

@ericstj What's the magic necessary here?

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Sep 18, 2016

This is now in master.

@bradwilson

This comment has been minimized.

Copy link
Member

@bradwilson bradwilson commented Sep 18, 2016

Do you have a target version and/date for this?

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Sep 18, 2016

@terrajobst are there dates you can share about 1.2/ 1.2 preview?

Note I don't think there are ref assemblies in the meta package yet, so you can't reference it. I've asked @weshaggard what the best way is to get you trying it out.

@tmsns

This comment has been minimized.

Copy link

@tmsns tmsns commented Sep 19, 2016

Is it already certain System.Xml.Xsl will be added to .NET Core 1.2?

Also, just wondering @danmosemsft , why was the assembly named System.Private.Xml? Why the private moniker?

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Sep 19, 2016

It doesn't have a reference assembly yet. @sepidehMS is working on that (needs issue)

@sepidehkh

This comment has been minimized.

Copy link
Member

@sepidehkh sepidehkh commented Sep 20, 2016

Here's the related issue: #11888

@brendansaunders

This comment has been minimized.

Copy link

@brendansaunders brendansaunders commented Sep 20, 2016

I am a little confused as i was refered here from issue #977... Will this support / allow us to get our xUnit test results in the NUnit xml format?

@mstruppBE

This comment has been minimized.

Copy link

@mstruppBE mstruppBE commented Sep 20, 2016

Is it possible to use the XSLT code that has already been posted, or is that not ready for primetime?

@bradwilson

This comment has been minimized.

Copy link
Member

@bradwilson bradwilson commented Sep 20, 2016

@brendansaunders The xUnit.net runners need this code to perform the transformations that enable support for NUnit XML. You don't need this code yourself; I do. 🙂

@sepidehkh

This comment has been minimized.

Copy link
Member

@sepidehkh sepidehkh commented Sep 20, 2016

@mstruppBE There is no ref assembly for it yet, but you can technically use it. Please refer to here to see how our tests are currently doing that.

@mstruppBE

This comment has been minimized.

Copy link

@mstruppBE mstruppBE commented Sep 21, 2016

@sepidehMS Thanks. I will wait for the ref assembly. We have some projects which utilize XSLT that we're porting to Net Core that I am hoping to test soon.

@mstruppBE

This comment has been minimized.

Copy link

@mstruppBE mstruppBE commented Oct 5, 2016

@sepidehMS Just checking in here - is the ref assembly yet available for testing XSLT functionality in Net Core? Thanks!

@sepidehkh

This comment has been minimized.

Copy link
Member

@sepidehkh sepidehkh commented Oct 7, 2016

@mstruppBE The XSLT functionality is now available in System.Xml.ReaderWriterassembly. Closing this.

@sepidehkh sepidehkh closed this Oct 7, 2016
@Tandis5

This comment has been minimized.

Copy link

@Tandis5 Tandis5 commented Oct 7, 2016

@sepidehMS So I'm new to Net Core and Github, but I'm doing a project with Net Core and need the XSLT functionality. How do I get this latest version with the XSLT functionality? I downloaded System.Xml.ReaderWriter from NuGet (version 4.0.11) but it doesn't not have the XSL classes.

@mstruppBE

This comment has been minimized.

Copy link

@mstruppBE mstruppBE commented Oct 7, 2016

@Tandis5 I downloaded the "System.Xml.ReaderWriter": "4.4.0-beta-24607-05 version from myGet (which was last updated today) and it also doesn't have XSL classes. I'm pretty sure I'm missing something here.

@sepidehkh

This comment has been minimized.

Copy link
Member

@sepidehkh sepidehkh commented Oct 7, 2016

@Tandis5 @mstruppBE Can you tell me how you are looking for XSL classes? I am seeing the namespace System.Xml.Xsl included in netstandard1.7 dll in the latest package (the same version @mstruppBE mentioned)

@mstruppBE

This comment has been minimized.

Copy link

@mstruppBE mstruppBE commented Oct 7, 2016

@sepidehMS Thank you for your response. I created a Net Core C# console application, installed the System.Xml.ReaderWriter package I referenced above and then tried to instantiate System.Xml.Xsl classes but nothing happened. That's all I did, so I may be missing a step or two.

@Tandis5

This comment has been minimized.

Copy link

@Tandis5 Tandis5 commented Oct 7, 2016

@sepidehMS @mstruppBE Mine is an ASP.net core web service... started with an empty project and downloaded System.Xml.ReaderWriter (version 4.0.11) from NuGet. I've never used myGet before. Where can I find it on there? I tried searching for a bit but was unsuccessful.

@Tandis5

This comment has been minimized.

Copy link

@Tandis5 Tandis5 commented Oct 7, 2016

@sepidehMS @mstruppBE Ok I got the 4.4.0 beta version from myGet, but I'm still having the same issue. I'm assuming it has something to do with it referencing the wrong library under the package. I changed my project.json to have "netstandard1.7" as a framework import, but that didn't change anything. If I browse to the System.Xml.ReaderWriter in the references it appears as if that library is empty. If I right-click on the reference and choose "scope to this" I get an empty window.

@weshaggard

This comment has been minimized.

Copy link
Member

@weshaggard weshaggard commented Oct 8, 2016

@Tandis5 what do you mean by adding "netstandard1.7" as a framework import? Can you show a snippet of your project.json? I believe you will actually need to change your framework to "netstandard1.7" and not import it.

@Tandis5

This comment has been minimized.

Copy link

@Tandis5 Tandis5 commented Oct 9, 2016

@weshaggard So I'm confused by the whole .net core vs .net standard and how this project.json works. After reading some I realize now that what I was doing was wrong. Are you saying I need to remove "netcoreapp1.0" from my "frameworks" node in the project.json and replace it with "netstandard1.7"? When I try that I get an error during package restore that says "Microsoft.NETCORE.App 1.0.1 is not compatible with netstandard1.7".

@weshaggard

This comment has been minimized.

Copy link
Member

@weshaggard weshaggard commented Oct 11, 2016

@Tandis5 yes netstandard1.7 isn't compatible with netcoreapp1.0/Microsoft.NETCore.App1.0.1. Unfortunately we are in the middle of a large set of changes in our master branch right now which isn't going to be easily consumed in isolation. I suspect it would require a update of all the packages as well as the tools because an updated nuget(dotnet restore) is needed to understand the new target frameworks. These XML changes are definitely not in a place to be incrementally consumed with existing applications but if you are interested expermenting I can try and help you get through all the various updates. Otherwise I would suggest you hold off until our 1.2 release which is coming out next spring sometime.

@Tandis5

This comment has been minimized.

Copy link

@Tandis5 Tandis5 commented Oct 11, 2016

@weshaggard Thanks for the response. I'm going to take a different route and avoid using XSLT for now.

@agray

This comment has been minimized.

Copy link

@agray agray commented Jan 11, 2017

REALLY need XUnit to emit nunit3 XML. new tools now take nunit 3 xml as input. Have also raised this ticket: https://issues.jenkins-ci.org/browse/JENKINS-27906 to Critical as it is increasingly redonkulous that Jenkins STILL doesn't handle NUnit 3 XML AFAICS.

@grahamehorner

This comment has been minimized.

Copy link

@grahamehorner grahamehorner commented Jan 11, 2017

@weshaggard I'm having the same issue; I can't see the Xsl namespace using the following project.json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "System.Xml.ReaderWriter": "4.3.0",
    "System.Xml.XmlDocument": "4.3.0",
    "System.Xml.XPath": "4.3.0"
  },

  "frameworks": {
    "netstandard1.7": {
      "imports": "dnxcore50"
    }
  }
}
@weshaggard

This comment has been minimized.

Copy link
Member

@weshaggard weshaggard commented Jan 11, 2017

Have a look at https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md for instructions on how to use our latest packages.

@eerohele

This comment has been minimized.

Copy link

@eerohele eerohele commented Feb 22, 2017

Looks like the <msxsl:script> element isn't supported at the moment. If you try to use it, you get System.PlatformNotSupportedException: Compiling JScript/CSharp scripts is not supported.

Will .NET Core ever get <msxsl:script> support?

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Feb 24, 2017

We don't have plans to support it right now. As you know it requires out of proc compilation, at least as currently implemented and we don't have that. When we looked at it, it wasn't super commonly encountered. You could open an issue specifically for that if you like, and we can gauge popularity.

@Jonathan34

This comment has been minimized.

Copy link

@Jonathan34 Jonathan34 commented Mar 17, 2017

So this is part of the .net standard 1.7 and will be integrated into .Net Core 2.0?
i am currently trying to migrate a .net framework 451 dll to .net standard 1.6 and it heavily uses xslt...

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Mar 17, 2017

@Jonathan34 yes System.Xml.Xsl is part of .NET Standard 2.0 and will ship in .NET Core 2.0. (Just not support for <msxsl:script>.)

Do you want to try it out? Here are instructions for using .NET Core 2.0 nightly builds in VS 2017.
https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md
If you hit any problems please do post back.

@Jonathan34

This comment has been minimized.

Copy link

@Jonathan34 Jonathan34 commented Mar 17, 2017

@danmosemsft thanks. What i thought. can we use a .Net standard 2.0 assembly in an asp.Net core 1.1 (mvc)?

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Mar 17, 2017

If it runs on .NET Core 2.0. I don't know how to do that upgrade (but obviously it's supported!). @davidfowl where is the "dogfooding guide for ASP.NET Core 2.0"?

@Jonathan34

This comment has been minimized.

Copy link

@Jonathan34 Jonathan34 commented Mar 17, 2017

Well the dll will use .Net standard 2.0 but my app will rely on .Net core 1.1 (until 2.0 is out). We can't use the beta version in prod but we may survive if one dll is in beta....

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Mar 17, 2017

The assembly must run on .NET Core 2.0 runtime.

@Jonathan34

This comment has been minimized.

Copy link

@Jonathan34 Jonathan34 commented Mar 17, 2017

The assembly yes. But what about the ASP.net core app using the 2.0 assembly? Sorry I m trying to see if 1.1 can run a 2.0 assembly or if everything needs to be 2.0.

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented Mar 17, 2017

Sorry everything from the implementation of XSL downwards needs to be 2.0. Do you use XSL in a limited way? If so perhaps there is a 3rd party library you could use for XSL meantime.

@busbina

This comment has been minimized.

Copy link

@busbina busbina commented May 16, 2017

@danmosemsft Is there a bug\feature started for msxsl:script support?

@krwq

This comment has been minimized.

Copy link
Member

@krwq krwq commented May 16, 2017

cc: @sepidehMS

@sepidehkh

This comment has been minimized.

Copy link
Member

@sepidehkh sepidehkh commented May 16, 2017

@busbina Currently there is no plan to add msxsl:script support and it's not being tracked by an issue right now. You could file a bug with your scenario and we will make a decision based on popularity :)

@busbina

This comment has been minimized.

Copy link

@busbina busbina commented May 16, 2017

@sepidehMS Thanks!

@danmosemsft

This comment has been minimized.

Copy link
Member

@danmosemsft danmosemsft commented May 16, 2017

Right, this issue is closed (XSL support in general) but we'd welcome a distinct new issue for msxsl:script.

@busbina

This comment has been minimized.

Copy link

@busbina busbina commented May 22, 2017

@danmosemsft @sepidehMS I opened an issue for script support a few days ago.
#19837

@mstaal

This comment has been minimized.

Copy link

@mstaal mstaal commented Mar 24, 2019

I have made a comment in in #19837 explaining how Microsoft XSLT Extension Objects is (at least in many cases) an alternative to using the <msxsl:script>-tag.` I hope it may help someone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.