Dataset.WriteXml does NOT produce well formed XML

For example:


Dim filename As String
filename = Server.MapPath("./") & "xml/dataSet.xml"
Dim myFileStream As New System.IO.FileStream(filename, 

Dim myXmlWriter As New System.Xml.XmlTextWriter
(myFileStream, System.Text.Encoding.Unicode)



Thus, if there is data in the dataset with a string such 

"Where are my < & > ESCAPE sequences?"

The resulting XML will look like:

<foo>Where are my < & > ESCAPE sequences?</foo>

How can I get my escape sequences?

mmarano (1)
11/3/2003 8:55:54 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 7

It works properly for me...  How are you opening the .xml 
file?  Open it in notepad and see if the illegal 
characters have been replaced.  Opening it up in IE will 
translate the characters automatically.

>-----Original Message-----
>For example:
>Dim filename As String
>filename = Server.MapPath("./") & "xml/dataSet.xml"
>Dim myFileStream As New System.IO.FileStream(filename, 
>Dim myXmlWriter As New System.Xml.XmlTextWriter
>(myFileStream, System.Text.Encoding.Unicode)
>Thus, if there is data in the dataset with a string such 
>"Where are my < & > ESCAPE sequences?"
>The resulting XML will look like:
><foo>Where are my < & > ESCAPE sequences?</foo>
>How can I get my escape sequences?
11/3/2003 9:21:51 PM

Similar Artilces:

Opening a template form & renaming it from a cell input automatica
I want to use Excel for a Form in our office, but i need to make sure that it is saved using the last name of the client found in a cell. How can i make this "idiot proof"? -- J Galt ...

Passing form name
I found this code (EnableFormControls) in the forum to enable/disable controls on a form but I'm having trouble setting the variable 'frmAny' and passing it to the sub EnableFormControls. What am I doing wrong? Sub EnableFormControls(frmAny As Form, _ strControlSkip As String, _ Optional tfEnable As Boolean = True) Dim ctlAny As Control On Error GoTo ERROR_Handler frmAny(strControlSkip).SetFocus For Each ctlAny In frmAny.Controls If ctlAny.Name <> strControlSkip Then Select Case ct...

Search and verify that all forms are password protected
Is there a quick way that I can search through all of my forms and ensure that protection is enabled on them? I've done a project of about 300 forms. They will all be uploaded to a Sharepoint drive. Is there a quick way that I can ensure that all of the files have protection enabled before I upload them (without having to open every file and check)? See the article "Skipping Password Protected Documents in a Batch Process" at: -- Hope this helps. Please reply to the newsgroup unless you wish...

e-mail the current worksheet using a form button
I want to create a submit button that when I click on it, the current worksheet/file will be e-mailed to someone. Instead of saving the file, then inserting into an e-mail. I have seen this before in a file before, but can't figure out exactly how it works. I happened to notice in the VB Editor I saw something like... CommandClick() Excel.Application.Send "" End Sub Or something similar to that. I don't know any VBA.. So if that's what I need to learn, then let me know. TIA Richard, check out Ron's site for a LOT of information on this http://...

Form Control Button Name
I have 2 Form Control Buttons that I have assigned macros to in Worksheet 1. In one of the Buttons, my macro (among other things) copys Sheet 1 from Worksheet 1, and pastes it into a New Worksheet and attempts to delete the Control Buttons. The problem is, in Worksheet 1, my Control Buttons are named "Button 4" and "Button 48". When Sheet 1 from Worksheet 1 gets copied to the New Worksheet, the Control Buttons names change ("Button 2" and "Button 3" in one test and "Button 4" and "Button 5" in another test on a different ...

String representation of XML from System.Xml.XmlTextWriter
Is there anyway to get the XML string representation from the XmlTextWriter object? I created a function to create an XML using this object, but I need to send back an XML as the return value of this function. But I am not sure how to do this. Sub getXML() Dim objXMLWriter As New System.Xml.XmlTextWriter(w, Text.Encoding.UTF8) objXMLWriter.WriteStartDocument() objXMLWriter.WriteStartElement("firstElement") objXMLWriter.WriteStartElement("SecondElement") objXMLWriter.WriteElementString("ThirdELement", "Just text&qu...

Newbie question about various forms options
Hi, Very new to sharepoint. I've been tasked with trying to use one list for PTO requests. While the PTO request is being made in a new record in the list we'd like certain fields to be enterable and visible. If the user wants to go to the same record after approval and cancel the PTO request, we'd like another set of fields to be available to the user. What I've found is that I am inundated with various options fo this. Liveform (a 3rd party tool), swapping list views (seemingly the easiest since it's a native sharepoint solution), creating custom aspx...

Bill of Lading form
I am looking for a Bill of Lading form for Dynamics for shipments my company makes. Has anyone found a form that works with the system? I know that the German version of the program has one, beets me why the US version doesn't. A reasonably good BOL form can be created using Crystal or SRS. You will need to use some of the optional fields in Inventory to flag any items that may require special handling, if your firm has any such hazardous materials. -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users Get our Free Tips and Tricks Newsletter and che...

Problem with iif and datediff expression in form
Hi, I have a form where I have to display the value of the field based on some criteria. The first criteria is =IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") and the second criteria to add is dbo_PWO_Status.[Quote] = -1 My first question is how do I accommodate the dbo_PWO_Status.[Quote] = -1 criteria in the iif statement? The second question I have is that with the first expression put in the source for display I am getting Name instead of the Y value for matching condition. I would appreciate any help. Thanks. You n...

Form goes blank when no records 12-15-09
Messaggio multiparte in formato MIME. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a form that goes blank when a user deletes all records. Is there a way to have vba to add a record when the form is open. This=20 would keep the form from going blank. ------=_NextPart_000_009F_01CA7D8E.88CB66E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">...

Set a value on a form
I use the following code to open a form DoCmd.OpenForm stDocName, , , stLinkCriteria Is there any way to pass data to the form (through the constructor) or to set the value of a label on the form Thank you, Samuel You can use the OpenArgs argument to pass a value to the new form, and then use the new form's Load event to read the value and put it into a control on itself. First step -- pass the value: DoCmd.OpenForm stDocName, , , stLinkCriteria, , "ValueToPass" Second step - read the value and use it; this code goes with the Load event of the stDocName form: ...

How to find the check form to use for GP 9.0
I don't want to use Deluxe as our check vendor. I want to use Harland. Microsoft MBS sales just gives us Deluxe's phone number, when we request help with obtaining the correct format for Harland checks. Harland has two check formats for GP payable checks. 1) Great Plains Accounting 7.0 - 9.0 2) Great Plains Dynamics Harland isn't sure and can't reference Deluxe. Thanks, John John, From what I can tell from Harland's website, you want the Laser Multi-Purpose checks they show under Microsoft Great Plains. That's the one with the check in the middle, stub on t...

Continuous Form 11-17-07
I have a Dashboard with a subform that is a continuous form. The subform is a summary list of all audits in the database. I want the user to be able to click on the audit number listed in the subform and have another form "frmAA" open filtered to that particular audit and ready for editing. I've seen attempted solutions posted but results have been either the frmAA opening to a blank record or opened to a particular audit regardless of the audit that was selected. Thanks in advance, kljohn should be easy enough. the audit table has a primary key field, correct? and tha...

newbie question: read form properties from another class
Hi, I am sorry for this n00b question, but I'm stumped. I created a form application (using C#.NET Express). For now, it is a simple, singe form, that contains 1 button and 1 textbox. The button calls a method in another class. My question: how do I read the forms' textbox text from that class? My problem seems to be getting a proper reference to the form in my class. My background is VB6, where this was straightforward. I tried the following: -make the textbox public, -create a public property in the form, that returns the textbox text, -passing the form ob...

Use values from a form as criteria in a DSum
Hello All, I have a report in which the end user selects a single person or multiple people from a form and then I store their selection(s) in a temp table (ttmp_Prn_Isu). I have a report that uses this temp table as its datasource so that I can sort and group it properly. All the fields are populated via DSum function because the final report resembles a crosstab report that may contain rows with no data and yet the rows still need to be seen. My difficulty is in referencing the personID stored in the temp table ([ttmp_Prn_Isu].[IsuNm]) as criteria in my DSum function. I also have...

Creating a Form #2
Hi: I am trying to create a database of people that attended my mortgage seminar. But instead of giving them a 4x6 piece of paper to write their information on, I will have my laptop at the booth and have them fill out the information that is created in an excel form. It's just to hard to read people's handwriting these days. I am trying to create a form that once someone's fills it out their information will automatically go to another part of the worksheet. But what I don't know how to do is get rid of the previous person's information before the next person fills ...

Duplicate the record in form and subform
Hi Allen Browne, I try to use your code to duplicate the record in form and subform but I got a error message "Error#3265". BTW, my primary key value is not autonumber, how to change the code to fit my database? Thanks for your expert comments in advance! Presumably we are talking about this article: The "Item not found" error was caused by which line? Whichever line it is, you have some name Access can't identify, e.g. you have not changed the field names to match what's in your form. -- Allen Browne - Microsoft MVP...

Scroll Bar on Forms
I am using tab controls to move through my forms. When the form opens, the right scroll bar is not at the top, but a little ways down. This prevents the tabs from being seen, without moving the scroll bar to the top. I am using a Form Header and a detail section. How can I make sure the scroll bar on the right, stays at the top upon opening the form. Thanks In your form's Load event, SetFocus to a control that can receive the focus and will result in your form being scrolled to the proper location, -- HTH Stephen Lebans Access Code, Tips and Tricks Please re...

recall of infor on a form
I have created two tables: table one has basic info lname, fname, grade, student id number. Table two is an incident report form with fields: student id number, date ,grade , etc. I have a relationship from table one to to table two in a one to many relationship respectively. My user wishes to enter incidents on a form. So I created a form from table two and all works as planned. However my user would like to enter either a)student number or b) last name with out using a drop down list( long list of choices.) and then have it display both student number and last name then save...

Outlook 2003 Forms Problem
Whenever I try to open or design a form, Outlook keeps asking me to open another data file. It appears as if it thinks the default library is in another (older) data file. I have tried clearing the forms cache, renaming frmcache.dat, etc. Nothing works. Can anyone help? Thanks. What is the exact text of the error message?=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers

How to pass Window name & Form Name Ananymously in procedure?
I want to create generalized procedure for navigation, save, delete, add etc. buttons. But I cannot pass name of the window,name of form anonymously to the procedure. Can I pass name of the window or form in a procedure anonymously as it can be done with tables and fields? I seem to recall that I spent some time on this in Dexterity, and couldn't get it to work. I wish you could. If you find out how, please post or mail me the solution. "Nupur" wrote: > I want to create generalized procedure for navigation, save, delete, add etc. > buttons. But I cannot pass ...

Forms #10
I run Exchange 2003 and MS Outlook 2003. I am wondering about forms under my scenario. Does someone know of a good site that details the use of forms? Thanks Custom Outlook forms? See the Forms pages at -- Ken Slovak [MVP - Outlook] Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options "Mostro" <> wrote in message news:gJ5Cf.19265$ >I run Exchange 2...

This is an honest question, no sarcasm intended. I'm really curious, what -is- the big deal about XML? I'm heaing all sorts of things such as an open standard that can be read across all platforms, etc. But really, my colleagues are insisting that we transfer large chunks of data using XML. There is so much overhead compared to a simple flat file using csv or fixed length fields. A 10k record file is ending up being 3 times that of what it would be if it were fixed length. Even ini files still have their appeal to me over what I've seen from XML. Maybe I'm missing ...

Setting row color to be based on content in cells in rows in XML
What would be the best software, and also what would be the best programming language based solution, to solve the following problem: I have an XML data set I reference with the usual HTML table. What I want to do, is to give rows in the data that contain, say the word X in column 2 a red background color, while I give rows in the data that contain, the word Y in column 2 a green background color. More ambitiously, I would like to set rows that contain X in column 2 to have the font style, text color, text size, etc and also the background color determined by one CSS id, while I set the row...

Design the Contact Form
Hi, I want to add a few fields to the standard Contacts form. When I select Design this Form it flickers and I end up looking at a basic version of some kind. I am using Office 2010 so I'm not sure why this happens. Pointers most welcome. Also I too end up with the sticky note icon and not a contacts icon for new contacts using this form. P.S. I can now add that I think it might be the differences between Forms 2.0 controls and Outlook controls. I have added all the Outlook controls to my Control Toolbox but still no joy... ...