Transforming XML from Data Objects

Hello All,

I have a collection of data objects that are based on my application's
data model. I want to be able to serialize this data to different XML
formats (schemas) for use by different consuming applications. For
example, I want to generate XML from the data one way for
Application1, and generate XML in a different format for use by
Application2.

I don't think I can just serialize my objects as XML because I would
lose the flexbility to choose the output schema.

Is there something built into the .NET framework that will allow this
to be done easily? It would be nice if there was some time of template
based system for generating XML from objects. As far as I know, you
can't really apply XSLT transforms from objects.

Any suggestions?

Thanks,
Jeff
0
9/11/2008 6:46:04 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
650 Views

Similar Articles

[PageSpeed] 44

Jeff.Thorn@gmail.com wrote:

> Is there something built into the .NET framework that will allow this
> to be done easily? It would be nice if there was some time of template
> based system for generating XML from objects. As far as I know, you
> can't really apply XSLT transforms from objects.

You could serialize the objects to XML, then process that XML as needed 
with XSLT stylesheets to create the different outputs you want.

There also is some (.NET 1.0) tool named ObjectXPathNavigator
http://msdn.microsoft.com/en-us/library/ms950764.aspx
that could be directly fed to an XSLT transformation, I don't know 
however how easy it is to port that to .NET 2.0.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
9/12/2008 11:30:05 AM
Reply:

Similar Artilces:

Need to add data to the bottom of a column using macro
I have data that I am importing from another program (see sample 1 below). This data will be changing values as well as number of rows each time I export. I need a way to determine the last line as the number of rows varies and then insert static as well as dynamic information. (See sample 2) In the first column I will be inserting "02" on the last row. In the second column i will be inserting the same numbers "150080380549" on the last row. On the 3rd column I need to count the number of rows (excluding the last line)and place this figure. On the 4th column, I...

No data when offline
When i go offline with SFO i can only view data that i created when i was off line. The data replicates to the live crm server when going back online but when i go offline this is the only data i can see. Can anyone help? I saw this issue a few months back. The fault was the useraccount in the systemuserbase table. in this table you will see the users logon details. Check their domain\username entry and make sure the domain is the netbios name rather than the FQDN like company.com etc -- John O'Donnell Microsoft CRM MVP http://www.mscrmfaq.us "Dylan" <Dylan@discussi...

using CListCtrl::Sort() with OWNER DATA
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C3DC71.9497D720 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey All, 1. Which sorting method does CListCtrl::Sort() use? eg Quick, merge, = bubble, insertion, selection. And is it a stable sort? eg the sorted = data sequence preserves the original (input) relative ordering of = equivalent data units. 2. Is it possible to use the very SAME CListCtrl::Sort() method with the = OWNER DATA option for my own data? I understand that I cannot simply = call CListCtrl::S...

xml schema to dataset to xml
Hi, I am trying to write a function that takes an xml schema and generates a dataset. I then write data into the dataset and generate xml from it. I then go to validate the xml that was generated against the original schema and the validation fails. Ive found that this is because the order of the sequence in my complex types is no longer the same. Does anyone know of a way to generate xml that will validate against the schema? ...

Macro that will add data from multiple workbooks to the 1st open r
I am looking for a way to tell my macro to pull data from multiple workbooks and copy and paste this data to the first open cell. I am extracting from multiple workbooks where each work book is updated/added to daily. (workbook1 may have data in columns A, B, C down to row 5 on Monday and then on Tuesday we may add additional rows in these same Columns A, B, C, this will hold true for all other workbooks). In workbook1 the macro needs to look at and copy data A1:A65536, B1:B65536, etc... However data will start in row 1 and will be added to daily. The Macro will then take the data fr...

Data transfer problem
I am working on a project that deals with two sets of information. M first set of information includes: A list of all the state abbreviations in the first column, the secon column has prices. E.X. AL (A1), AR (A2) ....and so on all the way through the 5 states. EX. $1.14(B1), $1.20(B2) ex--so AL has a price of $1.14, $AR has a price of 1.2 and so on... My second set of information includes: A list of state abbreviations, out of alphabetical order. I want to be able to merge these two sets of information around th prices. I do not want to go through the list and find each A abbrev...

Pivot table using External data
Hi I am generating a pivot table using the following query SELECT `'1100 REG$'`.`Ap/ArID`, `'1100 REG$'`.Amount FROM `F:\Finance\Income Reconciliation\2004-05\GL transactions 0405`.`'1100 REG$'` `'1100 REG$'` UNION SELECT `'1157 REG$'`.`Ap/ArID`, `'1157 REG$'`.Amount FROM `F:\Finance\Income Reconciliation\2004-05\GL transactions 0405`.`'1157 REG$'` `'1157 REG$'` UNION SELECT `'1165 REG$'`.`Ap/ArID`, `'1165 REG$'`.Amount FROM `F:\Finance\Income Reconciliation\2004-05\GL transactions 0405`.`'1165 REG$'` ...

Add data to next new record
I need to add data from my drop downlist. It works, but it's not adding to the next available record. Its adding over the top of data. Can anyone tell me why? DoCmd.GoToRecord , , acNewRec ' Perform some action. Form!sfrmToQCLog![PO] = cboLookupPO.Column(0) Form!sfrmToQCLog![ITEM] = cboLookupPO.Column(1) Form!sfrmToQCLog![VENDOR] = cboLookupPO.Column(2) -- Matt Campbell mattc (at) saunatec [dot] com Message posted via http://www.accessmonster.com ...

HELP? Having some problems with XML Serialization...
Hi, I seem to be having a bit of a problem serializing a complex object into XML. I've done this many times with simpler objects and it's always worked just fine. The error I'm getting is the natorious "File or assembly name [asciijunk].dll, or one of its dependencies was not found. I have turned on XML Serialization debugging int the web.config file, so I have all of the output generated by the serializer. When I examine the .out file generated there, I have the following: ================================================== c:\Documents and Settings\DEV100\ASPNET\L...

Can BP 4.0 contain "any" data from SQL?
Hello: SmartList Builder can pull most any data from the GL databases in SQL? Is it a fair statement to say that any SmartList favorite that is created in GP can be shown in a query in Business Portal 4.0? Or, is it more accurate to say "Not all data can be displayed in Business Portal 4.0 but customization to create entities can be done to bring in the data."? childofthe1980s childofthe1980s, Thanks for using the newsgroups. Your second statement below would probably be more correct. BP has entities that are created out of the box and map to certain tables. Not all ta...

OpenReport with WHERE clause not 'filtering' data
Hi guys I have an Access 2003 project talking to a MS SQL database. I have created a report with the datasource being a Stored Procedure (usr_GetCases). I am opening this report via the click event of a Command Button on a form (which will later be used to gather report filtering parameters). I am opening the report with the DoCmd.OpenReport command and a WHERE clause however I get the full recordset not the selected data. Here is my command: DoCmd.OpenReport "usr_GetCaseByDate", acViewPreview, , "[ExposureAmount] = 5000" Exposureamount is a 'money' field ty...

transform data in excel
I need to transform data in an excel srpeadsheet. I need to reverse a 5 rows, 200 columns table into a 5 columns, 200 rows table. Much appreciated!Vincent Hi Vincent Copy the set of data. Got to your destination and choose Paste Special and click the box marked Transpose. -- Regards Roger Govier "Vincent Yang" <vyang69@verizon.net> wrote in message news:MVORb.1866$px6.279@nwrddc02.gnilink.net... > I need to transform data in an excel srpeadsheet. I need to reverse a > 5 rows, 200 columns table into a 5 columns, 200 rows table. > > Much appreciated!Vincent >...

Remove Dataset name as ROOT of XML
Hi, I am generating deeply nested XML document from a Dataset using ' Write to the file with the WriteXml method. DataSet21.WriteXml(myXmlWriter) The generated XML contains the <DataSet2> node as a root node (see below) is there a way to get rid of it? I ned the <Header> node to be a Root node. All info is generated from database. Thanks LoF <DataSet2> <Header> <WONo>2308100</WONo> <EDDID>SEDD</EDDID> .... create an XmlDataDocument from the DataSet http://msdn.microsoft.com/library/en-us/cpref/html/frl...

Training Senior Volunteers Basic Excel data entry
As the IT Director for a county commissioner, I've been asked to visit our rural office today to give a "training" to 5 volunteers on data entry using Excel 2003. The volunteers have little or no experience using Office or Excel..... Any suggestions as to the best Microsoft "Help" web link that would be best suited for educated, senior (65+ yrs old) folks, using Excel for data entry. The problem with most of the Help links is so much information overload........ Basically looking for the best KIS (Keep It Simple) Excel, Word and/or Outlook help link...............

offset data markers
Anyone know whether you can / how to offset data markers in a "line with markers" excel chart? I have a series of comparative data that mostly overlaps and I want to spread the data points horizontally by a few points... thanks. First, use an XY chart. You can use a format that has lines and markers. The XY chart treats the X values as real continuously variable values, instead of discrete non-numeric categories. Second, in the worksheet, add the offset to the range used to plot the X values. - Jon ------- Jon Peltier Peltier Technical Services, Inc. http://peltiertech.com/ ...

Exporting XL data
What versions of XL allow you to export data to an XML file format? AFAIK -- Regards Frank Kabel Frankfurt, Germany Bill wrote: > What versions of XL allow you to export data to an XML > file format? Hi Bill AFAIK introduced with Excel 2003 -- Regards Frank Kabel Frankfurt, Germany Bill wrote: > What versions of XL allow you to export data to an XML > file format? I've never used it, but there's a: XML Spreadsheet (*.xml) under the "save as type" box in the file|saveAs dialog in xl2002. Frank Kabel wrote: > > Hi Bill > AFAIK introduced wit...

Simple Xml Validation with strings
Hello, I have two strings; string XmlFragment; //contains the xml document string XsdSchema; //contains the xsd schema I would like to validate the XmlFragment against the XsdSchema. What is a clean, simple way for accomplishing this? Bye, Ward Try something like this: 1) Load your XsdSchema into a StreamReader MemoryStream ms = new MemoryStream((new Text.ASCIIEncoding()).GetBytes(XsdSchema)); StreamReader schemaReader = new StreamReader(ms); 2) Validate your XmlFragment on the StreamReader XmlTextReader xmlReader = new XmlTextReader(new System.IO.StringReader(XmlFragment)); X...

Comparing a value in EXCEL and XML files
want to know how to write a code in VB.NET for the following situation > I have a field( Ex. Capital) in my XML file and that field results in a value(Ex. $5000)....now i have my Excel file with multiple worksheets in it....I want to write a code that can read a single field (Ex. Capital) in XML file and then take it's value (Ex.$5000).....After reading the $5000 it should search through my entire Excel file( In all Worksheets) and see if that Value exists ....If it exists then return as "Pass" if not "Fail".....I also hav 1 more condition but first i would like to...

Memory Leak in Visio Data Refresh
Hi There, I am using the built-in data refresh in Visio 2007. I am automatically refresh every 3 minutes. What I have found is that the MemUsage incrementally increases after each data refresh until I get an error message of not having enough virtual memory. Is there a work around besides closing Visio down and restarting again after some hours? This also happens using a macro that microsoft suggested: intCount = ThisDocument.DataRecordsets.Count Set vsoDataRecordset = ThisDocument.DataRecordsets(intCount) vsoDataRecordset.Refresh --- frmsrcurl: http://msgroups.net/microsoft.public...

Charting Dated Data
I have a small file, using only 6 rows and 6 columns. A1 has the word Date in it, A2 through A6 has the dates, 1/1/08, 1/8/08, 1/15/08, 1/22/08, and 1/29/08. B2 through B6 has person's names and the cells from B2 through E6 contains numerical data. I am attempting to create a column chart, with the weekly dates on the X axis and the names in the legend, each column represents an individual. The problem is I am getting a lot of dates between the entered dates, every other day is showing up on the X axis, cluttering up the axis and setting the column widths very narrow. The gap wid...

How to XslTransform.Transform to new web page from code behind?
I'm working with a typed dataset and want to implement a print button that prints my formatted data without the company logo and other stuff on the form. I've created an XSLT file to transform the XML version of the dataset into HTML and would like to display it in a new browser window leaving the original window up and/or maybe even just send it out to the default printer or bring up the print dialog for printing out the web page. I have successfully saved the html file, but I'm not sure how to send to a new browser window instead of a file. Please help, code below: XmlData...

XSL Transform Problem using Xml.XSL.Transform
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty well for simple transforms. But as soon as I add Xsl variables or For each loops to the XSL string in the db, it fails to transform the XML. I can see that it will transform everything until that point. ALso If I copy the XSL & XML I am trying to transform from my watch window into a file.. It works perfectly. Any Ideas? The following is the C# code I am using to transform & the XSL I a...

XML parsee
Hi All I am very new to XML ... i have an xml file how do i parse it.. Its has a very simple structure : I need to get the output in the following for/m: For all records: Get the fieldname, Then check the Filetype if input then ignore if derived then retrieve the file name if constant then get the constant value. please help me out i need to parse this asap Expectin a quick reply.. i need a optimized one as this records in the xml will be hugs.. Thanks a lot Regards Hemlata Fields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Cour...

What does the message "object can not be found" mean in Outlook
After configuring my email, the tests go through fine. Then, when I send an email I receive an error message of "object cannot be found". I am not sure why I am receiving this message or what to do to fix the problem. Any help would be appreciated. ...

How to import the old data
Dear All, Before actually investing into MS CRM, my company decided to take a test drive and I installed CRM 1.2 using MSDN key. I configured five users with appropriate security roles and they entered quite a lot of data to throughly check the product. After the successful test drive, my company has bought 10 users license professional suite and I have installed it successfully. Now the problem is that I want to transfer that old data entered by old users into the new deployment with the following considerations 1- In new installation, some of the old users have been deleted and some ...