Lightweight "XSLTransform"?
by bill salkin » Wed, 03 Dec 2003 16:47:57 GMT
I have an XML input document with > 10,000 elements (and
larger documents may be coming in the future.). I need to
apply an XSLT Transform to it but all the methods I know
of use an XPathNavigator, which relies on XmlDocument,
which reads the entire XML document into memory! Not good.
Is there a lightweight XSLT approach that reads in, and
processes, say just an element at a time? (Like the
"XmlTextReader" object fo reading XML files)?
TIA,
Bill
Re: Lightweight "XSLTransform"?
by Martin Honnen » Wed, 03 Dec 2003 20:00:22 GMT
You can read in the style sheet with a reader class. And you don't need
to use a full fledged XmlDocument, a System.Xml.XPath.XPathDocument
should do which is optimized for XSLT/XPath processing.
I haven't made any tests but from the docs I understand that to be less
memory intensive than using an XmlDocument.
--
Martin Honnen
http://www.**--****.com/
Re: Lightweight "XSLTransform"?
by Oleg Tkachenko » Wed, 03 Dec 2003 22:42:33 GMT
XPathDocument doesn't rely on XmlDocument at all. That's completely
different data model, much lightweight than DOM. But it also loads the
whole document into memory, but in more effective way.
Nope. XSLT and XPath are defined to operate on the whole tree. If your
transformation logic is so simple you can implement it only using
XmlReader and XmlWriter.
--
Oleg Tkachenko
XML Insider
http://www.**--****.com/
Similar Threads:
1.Javascript problems from a lightweight - xmlhttprequest and html fragments
I am redoing my website and trying to get it to do something more
exciting using Javascript. I did normal Java at university and code at
work in VB.NET. I have got reasonably far into what I want to do but am
having some issues.
Firstly
I am using an XmlHttpRequest to pull html fragments out of files and
wish to put them into the main doccument inplace of a <span></span>
which has a given id. The user enters a "command" into a TextField and
when the onchange event is thrown I am using the contents of the text
field in a switch statement to decide which fragment should be loaded.
This works ok when TAB is pressed to throw the onchange event, apart
from the text field losing focus (which I don't want). However when
return or enter are pressed the fragment is loaded and placed in the
correct place, then the page seems to reload or refresh and loses it
again. To make this work will I need to store the loaded data so it
gets displayed again on the <body onload> event? I need someway of
getting around this refresh issue.
Secondly I get a strange duplication of information when the fragment
is loaded. The top part (main fragment that is loaded with the <body
onload> event. It does not get duplicated as text, but as some strange
unselectable object.
Ill try and get some dribbles of code up soon but I am not writing this
from my development machine.
Any help would be greatly appretiated.
Oh and can some one tell me, what is the life of a javascript variable?
Does it survive past refresh? When the script is loaded is that version
of it always used for the viewing session or does each refresh destroy
everything? If it does destroy everyting what is the best place to
store stuff - will I have to use a cookie?
Cheers
Phil.
2.markup.py 1.5 - a lightweight HTML/XML generator
3.[ANN] markup.py 1.5 - a lightweight HTML/XML generator
4.Looking for Lightweight XML Parser/Builder
Hi,
I'm looking for a package that I can install on both a Linux and a
Windows (Arrrgh) platform to support a small application I building in
C.
It needs to be a single download on either platform that supports
building XML and parsing XML. Nothing fancy.
Suggestions ??
Cheers,
Eddie
5.Problem for C# intellectuals: need a unique hash out of an XslTransform object
Here is the issue. I need to uniquely identify an XslTransform objects
without knowing how they are constructed.
Solution 1: Get the underlying source XSL and run a hash that
Issues: No "Source()" or "OuterXml()" or similar method exists
Solution 2: Use some sort of persitance method to get a stream and hash
that
Issues: Again no such method exists on that class.
Solution 3: Get a pointer to the object in memory, and use the binary
foot print as a basis for the hash.
Issues: "Unsafe code" (not that I am scared of that), and the fact that
I can't seem to get pointers to work for objects (which confirms what
little ms has written on the subject).
Solution 4: Wrap the XslTransform with my own class, implementing a
"LoadXsl(string xsl)" method.
Issues: well, at least I can implement this for sure, but would rather
not have to do it.
Any comments on any of these solutions, or any ideas will be greatly
appreciated.
Thx
todd
6. Migrating an Xml control using XslTransform
7. XslTransform
8. Very Slow XSLTransform with XPathDocument