- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: XSL tranforms in .NET
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "XSL tranforms in .NET"
Collapse
-
The problem is all this dodgy code written by Russians:
Authors: Sergey Dubinets, Anton Lapounov
Leave a comment:
-
Alexei....
Check out this....
http://blogs.msdn.com/xmlteam/articl...Transform.aspx
Although marked as 'unfinished' it does seem to back yup your observation ... executing the transform is performed using an XmlReader that traverses the whole document.
"Performing the Transformation
Once the stylesheet is fully loaded, XslCompiledTransform can transform the input document. Transformation of the input document to output involves the following steps:
Parsing the input document and building an in-memory XML tree representation for it.
Transforming the input XML tree to the output tree.
Serialization of the output tree.
To load the cache, XslCompiledTransform uses XmlReader to read the input document. At this time, XslCompiledTransform applies whitespace stripping rules.
"
Leave a comment:
-
mvp.xml
Originally posted by AtW4.8 MB .NET distribution?
No, a hybrid solution was proposed - query object using XPath and then pass that XML to XSL template, it better fking work!
Leave a comment:
-
4.8 MB .NET distribution?
No, a hybrid solution was proposed - query object using XPath and then pass that XML to XSL template, it better fking work!
Leave a comment:
-
-
Xsl transform functions is clearly a badly written piece of code, strange as it seems to be written by Russians ...
Shimano - chew your gum dude...
Leave a comment:
-
Originally posted by DimPrawnI guess your code is just tulip then AtW.
If .NET hurts, you ain't doing it right.
Leave a comment:
-
I guess your code is just tulip then AtW.
If .NET hurts, you ain't doing it right.
Leave a comment:
-
As you can see from code above I use XPathNavigateable object, which should ensure tranformations are fast. XPath queries directly on that object work fast and nice. However giving it to Transform function of XSL is slow even when XSL document is empty - ie no queries there at all, none zero zilch. I can see from debugger that the damn thing walks whole tree of the XPathNavigeable object even though nobody asked it to do it - I can see it in debugger that they do it ffs. What's worse is that the damn thing adds to transformed results some junk that should not be there.
Leave a comment:
-
Oi!
Put this in technical Webby,FFS!
The general forum is reserved for mindless tosh, not this IT-related geek-speak.
Leave a comment:
-
I use FX 2.0.
I have got a custom object that implements XPathNavigator - this allows to run XPath queries and those work just fine, no problems there.
Then I thought to use XSL to run those XPath statements, here is how I do it:
Code:public string ExecXSLT(string sFileName,XsltArgumentList oList) { XslCompiledTransform oXsl=new XslCompiledTransform(); // loads XSL template oXsl.Load(sFileName); return ExecXSLT(oXsl,oList); } public string ExecXSLT(XslCompiledTransform oXsl,XsltArgumentList oList) { StringBuilder oSB=new StringBuilder(); XmlWriterSettings oWS=new XmlWriterSettings(); oWS.Indent=true; oWS.NewLineHandling=NewLineHandling.None; oWS.Encoding=Encoding.UTF8; oWS.OmitXmlDeclaration=false; oWS.ConformanceLevel=ConformanceLevel.Auto; XmlWriter oWriter=XmlWriter.Create(oSB,oWS); // Xnav is XPathNavigator object that controls actual data document that should be dealt with by XSL oXsl.Transform(Xnav,oList,oWriter); return oSB.ToString(); }
Leave a comment:
-
Originally posted by AtWI've got running test here that made me certain it happens - I pass XPathNavigator object to it, if I run XPath directly on that object then it only touches bits that have to be touched, when I put same XPath into XSL document I can see that whole object is walked, in fact if I have empty (!) XSL template the fking thing still walks the whole object. How do I know? Because I've got XPathNavigator over normal live .NET object and can see that its being walked over.
To add insult to injury it appears that XSL POS adds some junk into output that should not be there - its junk and some searches on the Net seems to confirm that.
Compiled XSLT explained
Leave a comment:
-
This should be posted in the technical forums.
What are you using, an XmlDocument or XPathDocument or XmlDataDocument?
How are your XPath queries formulated? Do by their nature have to traverse the whole document to find the required node(s)?
Please read http://support.microsoft.com/kb/325689/EN-US/
PS V1.1 of the framework has a lot of issues processing XSLT on large XML documents. I believe V2.0 is much better in this respect.
Leave a comment:
-
I've got running test here that made me certain it happens - I pass XPathNavigator object to it, if I run XPath directly on that object then it only touches bits that have to be touched, when I put same XPath into XSL document I can see that whole object is walked, in fact if I have empty (!) XSL template the fking thing still walks the whole object. How do I know? Because I've got XPathNavigator over normal live .NET object and can see that its being walked over.
To add insult to injury it appears that XSL POS adds some junk into output that should not be there - its junk and some searches on the Net seems to confirm that.
Leave a comment:
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Which IT contractor skills will be top five in 2025? Jan 2 09:08
- Secondary NI threshold sinking to £5,000: a limited company director’s explainer Dec 24 09:51
- Reeves sets Spring Statement 2025 for March 26th Dec 23 09:18
- Spot the hidden contractor Dec 20 10:43
- Accounting for Contractors Dec 19 15:30
- Chartered Accountants with MarchMutual Dec 19 15:05
- Chartered Accountants with March Mutual Dec 19 15:05
- Chartered Accountants Dec 19 15:05
- Unfairly barred from contracting? Petrofac just paid the price Dec 19 09:43
- An IR35 case law look back: contractor must-knows for 2025-26 Dec 18 09:30
Leave a comment: