473,669 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlReader.Creat e returns none

raj
i have this code which is upgraded to work with 2.0 and works great with
framework 1.0 and 1.1 without the upgraded code.

//2.0 code//
public static XmlReader RtfToXml( string Rtf )

{

if ( moForm == null )

moForm = new frmRTFtoXML();

string sDocBookXml = moForm.RtfToXml ( Rtf );

XmlDocument xDoc = new XmlDocument();

xDoc.PreserveWh itespace = true;

xDoc.LoadXml( sDocBookXml );

XmlDocument doc = new XmlDocument();

xsltDocBookToPa ra.Transform(xD oc, null,
doc.CreateNavig ator().AppendCh ild());

XmlReader xr = doc.CreateNavig ator().ReadSubt ree();

return xr;

}

the variable doc has both innerxml and outerxml.

However, the xmlreader is none. i cannot figure out why. I have tried many
ways such as writting xml to stream and reading back with xmlreader, etc.
None work. I always have xmlreader as none.

Also i have used xml spy to validate my xml schema and input. It transforms
them correctly. The transformation from xml spy is the same as what i get by
doing "xsltDocBookToP ara.Transform(x Doc, null,
doc.CreateNavig ator().AppendCh ild());".

what could i be doing wrong!

thanks
Jul 18 '06 #1
2 7576
Could you print which node you are on before the calling to ReadSubtree? If
you are not on a valid node on which ReadSubtree should be called, you might
get a NULL reader.

"raj" <ra*@aol.comwro te in message
news:eU******** ******@TK2MSFTN GP03.phx.gbl...
i have this code which is upgraded to work with 2.0 and works great with
framework 1.0 and 1.1 without the upgraded code.

//2.0 code//
public static XmlReader RtfToXml( string Rtf )

{

if ( moForm == null )

moForm = new frmRTFtoXML();

string sDocBookXml = moForm.RtfToXml ( Rtf );

XmlDocument xDoc = new XmlDocument();

xDoc.PreserveWh itespace = true;

xDoc.LoadXml( sDocBookXml );

XmlDocument doc = new XmlDocument();

xsltDocBookToPa ra.Transform(xD oc, null,
doc.CreateNavig ator().AppendCh ild());

XmlReader xr = doc.CreateNavig ator().ReadSubt ree();

return xr;

}

the variable doc has both innerxml and outerxml.

However, the xmlreader is none. i cannot figure out why. I have tried
many
ways such as writting xml to stream and reading back with xmlreader, etc.
None work. I always have xmlreader as none.

Also i have used xml spy to validate my xml schema and input. It
transforms
them correctly. The transformation from xml spy is the same as what i get
by
doing "xsltDocBookToP ara.Transform(x Doc, null,
doc.CreateNavig ator().AppendCh ild());".

what could i be doing wrong!

thanks


Jul 19 '06 #2
raj
Hey

Thanks for the reply...
I figured it out...it was a problem not due to any nodes but due to upgrade
to the .net 2.0 xml model.
in 1.0 and 1.1 the scripts (xslt with java embeded in it) worked well.
however with 2.0 you have to use xmluriresolver and give right permissions
for the scripts to be able to run. Wihtout the scripts being able to run we
were getting a null back for a value in Xslt.

:)

thanks again

"Zafar Abbas" <so*****@somewh ere.comwrote in message
news:O4******** ******@TK2MSFTN GP03.phx.gbl...
Could you print which node you are on before the calling to ReadSubtree?
If
you are not on a valid node on which ReadSubtree should be called, you
might
get a NULL reader.

"raj" <ra*@aol.comwro te in message
news:eU******** ******@TK2MSFTN GP03.phx.gbl...
>i have this code which is upgraded to work with 2.0 and works great with
framework 1.0 and 1.1 without the upgraded code.

//2.0 code//
public static XmlReader RtfToXml( string Rtf )

{

if ( moForm == null )

moForm = new frmRTFtoXML();

string sDocBookXml = moForm.RtfToXml ( Rtf );

XmlDocument xDoc = new XmlDocument();

xDoc.PreserveW hitespace = true;

xDoc.LoadXml ( sDocBookXml );

XmlDocument doc = new XmlDocument();

xsltDocBookToP ara.Transform(x Doc, null,
doc.CreateNavi gator().AppendC hild());

XmlReader xr = doc.CreateNavig ator().ReadSubt ree();

return xr;

}

the variable doc has both innerxml and outerxml.

However, the xmlreader is none. i cannot figure out why. I have tried
many
>ways such as writting xml to stream and reading back with xmlreader, etc.
None work. I always have xmlreader as none.

Also i have used xml spy to validate my xml schema and input. It
transforms
>them correctly. The transformation from xml spy is the same as what i get
by
>doing "xsltDocBookToP ara.Transform(x Doc, null,
doc.CreateNavi gator().AppendC hild());".

what could i be doing wrong!

thanks



Jul 20 '06 #3

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

Similar topics

3
8035
by: Michael Malinak | last post by:
Since XmlWriter offers so many nice options for formatting, I thought it would be nice to read in via XmlReader, and write back out via XmlWriter. It might be overkill, but I'd also like to be able to check some values during that time also so I was going to be using XmlReader anyway. Unfortunately I don't see an easy way to stream it back out through XmlWriter without going node by node. Any suggestions? Is there an easier/faster way...
1
6235
by: dongxm | last post by:
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
1
2304
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code: Public Class Form1 Inherits System.Windows.Forms.Form
0
2633
by: Jen | last post by:
My main question: "How can I get a TextReader or Stream object from an existing XmlReader?". Read on for more: I have an existing XmlReader. Let's call it reader1. I'm creating another reader, reader2, after creating new XmlReaderSettings and a new XmlParserContext. // customContext and customSettings may or may not make use reader1's properties XmlParserContext customContext = new XmlParserContext(...);
6
2399
by: Rob Meade | last post by:
Hi all, I'm having a few difficulties with the above, ie I cant find any good examples anywhere of how to do what I want to do! I have an xml file on my desktop which I want to read in. Having checked the info for XML file reading it suggests that with .net 2.0 you should use the XMLReader class...
2
6852
by: jonfroehlich | last post by:
According to the MSDN documentation within the XmlTextReader class for ..NET 2.0, the recommended practice to create XmlReader instances is using the XmlReaderSettings class and the XmlReader.Create() method. However, the problem is, the XmlReader class does not expose certain properties that I need, e.g., LineNumber, LinePosition, etc. I would like to follow Microsoft's recommended practices, but I'm not sure how I can get XmlTextReader...
1
3493
by: Franck | last post by:
Hi, I'm quit confused with the following problem: I'm tryin to read an Embedded Xml file from my Class Library using a static method which should returns a XmlReader. The point is that using DataSet or XmlDocument works perfectly... using XmlReader always fails. I always get "None" as a result. Even using XmlReaderSettings does not change anything.
2
7581
by: Joe Rattz | last post by:
I am trying to create an XmlReader using XmlReader.Create, but it always returns {None}. I have tried several examples from the web, and Create always returns "{None}". Here is my code: XmlReaderSettings settings = new XmlReaderSettings(); settings.ConformanceLevel = ConformanceLevel.Fragment; settings.IgnoreWhitespace = true; settings.IgnoreComments = true;
23
7397
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8587
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.