473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

XmlSerializer and XslTransform

I'm making a 6-tiered application that is using Xml to tie the various
layers together in a very clean manner. I'm also trying to do this on the
1.1 Framework although I'm willing to switch to the 1.0 Framework if need
be.

One layer, which I call a Data Persistence Layer, uses the
System.Xml.Serialization.XmlSerializer to transform our business/domain
objects into the appropriate Xml format.

The layer below that is what I call a Data Transformation/Translation Layer.
This layer converts the Xml from the Persistence layer into the appropriate
format for storage (Sql server, file system, e-mails, web services, etc.)

The key to our architecture is being able to move between layers as quickly
and as efficiently as possible. Although serialization is an expensive
operation, we have determined that these performance costs are acceptable
given appropriate caching mechanisms of the XmlSerializer objects.

The issue I'm encountering is with the .NET API. It seems that the
XmlSerializer wants to work on streams while the XslTranform wants to work
with XPathNavigator/IXPathNavigatable.

So my question is: what is the best way to represent my Xml when I pass it
between layers. Based on an episode of MSDN TV, I tried to pass everything
around as an XPathNavigator as it seemed that this would provide an
efficient yet robust API for Xml access. The problem is that I couldn't
figure out a way to get the XmlSerializer to work with this since it demands
the use of an XmlReader, TextReader, or System.IO.Stream. Try as I might, I
couldn't figure out how to get an XmlReader from an XPathNavigator without
resorting to the costly operation of creating a new document in memory.

Of course, if I use the 1.0 Framework then the XslTransform object will
accept an XPathNavigator, however in the 1.1 Framework this is deprecated.
Thus, I assume that there is a preferred method for being able to use the
XslTranform on data generated by the XmlSerializer.

Right now I've gotten rough prototypes working using a string (I know, I
know, awful!) and another using XmlNode to pass data between layers. The
XmlNode is little more prone to throwing exceptions than I'd like, however.

Anyone know what the magic data type I should use is? Any samples you can
point me to would be most appreciated.

There just has to be a way to get the XmlSerializer and the XslTransform to
use each others output without having to resort to really costly operations
like cloning documents or resorting to the file system.

Much thanks for all of your help in advance.

Kevin Conroy

Programmer/Analyst

Nov 11 '05 #1
0 1746

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anthony Bouch | last post by:
Can anyone tell me why I receive the following compiler warning after having recently upgraded to VS.Net 2003 and .Net 1.1? Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,...
1
by: Rodger McNab | last post by:
While parsing xpath expressions within an XSLT document the .NET XslTransform class seems to delete the first "/" after a "]" within an expression containing a "|". This problem can be demonstrated...
2
by: Graham Pengelly | last post by:
Hi I am trying to transform on System.Xml.XmlDocument into another using XslTransform without writing the object out to a file. I am guessing it should work something like this... public...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
1
by: shell shell via .NET 247 | last post by:
How do you get the underlying Xslt stylesheet content from an XslTransform object that has been created and loaded with a stylesheet file or some text? Assume a method will create an XslTransform...
1
by: manlio | last post by:
how can I load a XSL string (not an xsl file!!) with XslTransform ??? If I use the code: // Create a new XslTransform class and load the stylesheet XslTransform myXslTransform = new...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
1
by: rmgalante | last post by:
Hello, I have a VB.Net component that uses the XslTransform object. I am using the FXSL randomizeList function in my XSL template. When I transform the XML in the VB.Net component, my...
1
by: Praveen | last post by:
Have a common function in Javascript which do transform for all .xsl's. XSL object is loaded like this. var xslobj=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0"); xslobj.async = false;...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.