473,385 Members | 1,465 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,385 software developers and data experts.

about String convert XmlReader

XslTransform xslt = new XslTransform();
xslt.Load(myXmlReader)

the myXmlReader is a XmlReader,but i have String of xsl file's content...
how to do,String convert XmlReader?

thanks
Nov 17 '05 #1
1 6217

"dongxm" <ia****@hotmail.com> wrote in message
news:ej**************@TK2MSFTNGP15.phx.gbl...
XslTransform xslt = new XslTransform();
xslt.Load(myXmlReader)

the myXmlReader is a XmlReader,but i have String of xsl file's content...
how to do,String convert XmlReader?

Its a bit of a pain. Basically you need to create a StringReader and create
the XmlReader around that

StringReader sr = new StringReader(<string>);
XmlReader myXmlReader = new XmlTextReader(sr);

You may also have to use XML encoded to unicode instead of UTF8 since I
believe StringReader always returns unicode bytes(which means the encoding
attribute has to be properly set).
Nov 17 '05 #2

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

Similar topics

3
by: bheem | last post by:
I have a few questions about DTD ENTITY. I would appreciate any help. 1. Is there any equivalent of this in xsd? Suppose I want to use the same string in multiple places in an xml file, is it...
3
by: Scott M. Lyon | last post by:
I'm trying to figure out the best way (considering there could be instances where I get a lot of data in this XML, and I want to minimize any slowdowns) to extract the value of one particular node...
2
by: muesliflakes | last post by:
I wish to receive some data from SqlServer as XML and write out result to as a string. Eg: cmd = new SqlCommand( "select * from blah for xml auto", con ); XmlReader result =...
9
by: Jon Paal | last post by:
how can I read an xml file and convert it to a string or convert an XmlTextReader to a string
1
by: Ronald S. Cook | last post by:
I have a string (see below) that I want to parse out the values. As you can see, some are element-based and some are attribute-based. <METADATA version="Format5"><TITLE value="Adrenaline...
4
by: Paul | last post by:
The title says it all. Is there a speed efficient way of validating that a string contains valid Xml without the overhead of try catch around a load attempt? Thanks in advance.
11
by: Gustaf | last post by:
Some error handling code: catch (System.Xml.XmlException e) { Console.WriteLine("Error in " + e.SourceUri + ": " + e.Message); return; } The output:
0
by: BobbyS | last post by:
I've a xml file.I'm taking its data passing it to a method in string form and converting that string "xmlData" to a array of bytes by Convert.FromBase64String(xmlData) but I'm getting a exception...
2
by: SammyBar | last post by:
Hi all, I'm trying to convert the xml obtained from a XmlReader object into a UTF-8 array. My general idea is to read the XmlReader and write into a MemoryStream. Then convert the MemoryStream...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.