473,385 Members | 1,400 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.

Write error on Read() ??

I'm writing a console app in c# and am encountering a strange problem. I'm
trying to use redirection of the standard input stream to read input from a
(xml) file. The following code snippet is from this app:
===============================
static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking

XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;

if (args.Length > 1) Console.SetOut(new
StreamWriter(args[1]));//executes if I don't use the "<", ">" redirection
syntax when invoking

XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = "DBDumper.DumpSpec0.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
Assembly a = Assembly.GetExecutingAssembly();
Debug.Assert (a.GetManifestResourceInfo(SchemaResource) != null);
XmlTextReader xsdreader = new XmlTextReader(new
StreamReader(a.GetManifestResourceStream(SchemaRes ource)));
xmlvr.Schemas.Add(null, xsdreader);
try
{
xmlvr.Read();
....
=============================
So, assuming my app's executable is foo.exe, things work fine if I type in

foo input.xml output.xml

Also,
foo input.xml > output.xml

works fine. But, if I type in:

foo < input.xml > output.xml

I get an error on the xmlvr.Read() in the last line above, complaining that
the stream does not support a Write!!

Can anyone give me help on this? I've stared at it now for a while and don't
see the problem.

Thanks in advance,
Bill
Jul 21 '05 #1
4 2373
Hi Bill,

I can not reproduce the problem, here is my code , you may have a try.
Did I misunderstand your meaning?
Can you please post the exactly error messge?

[HeadCount.xml]
<hc:HeadCount xmlns:hc='xsdHeadCount' xsi:schemaLocation='xsdHeadCount
HeadCount.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<Name>Waldo Pepper</Name>
<Name>Red Pepper</Name>
</hc:HeadCount>

[HeadCount.xsd]
<xs:schema xmlns="xsdHeadCount" targetNamespace="xsdHeadCount"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name='HeadCount' type="HEADCOUNT"/>
<xs:complexType name="HEADCOUNT">
<xs:sequence>
<xs:element name='Name' type='xs:string' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='division' type='xs:int' use='optional' default='8'/>
</xs:complexType>
</xs:schema>

static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;
if (args.Length > 1) Console.SetOut(new StreamWriter(args[1]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = @"c:\HeadCount.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
XmlTextReader xsdreader = new XmlTextReader(SchemaResource);
xmlvr.Schemas.Add(null, xsdreader);
xmlvr.ValidationType=ValidationType.Schema;
while (!xmlvr.EOF)
xmlvr.Read();
xmlw.WriteStartDocument();
xmlw.WriteStartElement("TestPref","TestName","Test NS");
xmlw.WriteElementString("TestName","TestNS","TestC on");
xmlw.WriteEndElement();
xmlw.WriteEndDocument();
}

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Bill Cohagan" <bi**@teraXNOSPAMXquest.com>
Subject: Write error on Read() ??
Date: Sat, 27 Sep 2003 16:24:02 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#x**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general,microsoft.public.d otnet.languages.csharpNNTP-Posting-Host: cs24313-53.austin.rr.com 24.243.13.53
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:187725 microsoft.public.dotnet.general:110132X-Tomcat-NG: microsoft.public.dotnet.general

I'm writing a console app in c# and am encountering a strange problem. I'm
trying to use redirection of the standard input stream to read input from a
(xml) file. The following code snippet is from this app:
===============================
static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking

XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;

if (args.Length > 1) Console.SetOut(new
StreamWriter(args[1]));//executes if I don't use the "<", ">" redirection
syntax when invoking

XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = "DBDumper.DumpSpec0.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
Assembly a = Assembly.GetExecutingAssembly();
Debug.Assert (a.GetManifestResourceInfo(SchemaResource) != null);
XmlTextReader xsdreader = new XmlTextReader(new
StreamReader(a.GetManifestResourceStream(SchemaRe source)));
xmlvr.Schemas.Add(null, xsdreader);
try
{
xmlvr.Read();
....
=============================
So, assuming my app's executable is foo.exe, things work fine if I type in

foo input.xml output.xml

Also,
foo input.xml > output.xml

works fine. But, if I type in:

foo < input.xml > output.xml

I get an error on the xmlvr.Read() in the last line above, complaining that
the stream does not support a Write!!

Can anyone give me help on this? I've stared at it now for a while and don'tsee the problem.

Thanks in advance,
Bill


Jul 21 '05 #2
Peter-
Thanks for the response. I'll try your code to see if I can figure out
the difference. In the meantime, did you try this using the redirection
symbols ">" and "<"? That's how I got the error.

Regards,
Bill

"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:mE**************@cpmsftngxa06.phx.gbl...
Hi Bill,

I can not reproduce the problem, here is my code , you may have a try.
Did I misunderstand your meaning?
Can you please post the exactly error messge?

[HeadCount.xml]
<hc:HeadCount xmlns:hc='xsdHeadCount' xsi:schemaLocation='xsdHeadCount
HeadCount.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<Name>Waldo Pepper</Name>
<Name>Red Pepper</Name>
</hc:HeadCount>

[HeadCount.xsd]
<xs:schema xmlns="xsdHeadCount" targetNamespace="xsdHeadCount"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name='HeadCount' type="HEADCOUNT"/>
<xs:complexType name="HEADCOUNT">
<xs:sequence>
<xs:element name='Name' type='xs:string' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='division' type='xs:int' use='optional' default='8'/> </xs:complexType>
</xs:schema>

static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;
if (args.Length > 1) Console.SetOut(new StreamWriter(args[1]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = @"c:\HeadCount.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
XmlTextReader xsdreader = new XmlTextReader(SchemaResource);
xmlvr.Schemas.Add(null, xsdreader);
xmlvr.ValidationType=ValidationType.Schema;
while (!xmlvr.EOF)
xmlvr.Read();
xmlw.WriteStartDocument();
xmlw.WriteStartElement("TestPref","TestName","Test NS");
xmlw.WriteElementString("TestName","TestNS","TestC on");
xmlw.WriteEndElement();
xmlw.WriteEndDocument();
}

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Bill Cohagan" <bi**@teraXNOSPAMXquest.com>
Subject: Write error on Read() ??
Date: Sat, 27 Sep 2003 16:24:02 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#x**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general,microsoft.public.d otnet.languages.csharp
NNTP-Posting-Host: cs24313-53.austin.rr.com 24.243.13.53
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:187725 microsoft.public.dotnet.general:110132
X-Tomcat-NG: microsoft.public.dotnet.general

I'm writing a console app in c# and am encountering a strange problem.

I'mtrying to use redirection of the standard input stream to read input from a(xml) file. The following code snippet is from this app:
===============================
static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking

XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;

if (args.Length > 1) Console.SetOut(new
StreamWriter(args[1]));//executes if I don't use the "<", ">" redirection
syntax when invoking

XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = "DBDumper.DumpSpec0.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
Assembly a = Assembly.GetExecutingAssembly();
Debug.Assert (a.GetManifestResourceInfo(SchemaResource) != null);
XmlTextReader xsdreader = new XmlTextReader(new
StreamReader(a.GetManifestResourceStream(SchemaRe source)));
xmlvr.Schemas.Add(null, xsdreader);
try
{
xmlvr.Read();
....
=============================
So, assuming my app's executable is foo.exe, things work fine if I type in
foo input.xml output.xml

Also,
foo input.xml > output.xml

works fine. But, if I type in:

foo < input.xml > output.xml

I get an error on the xmlvr.Read() in the last line above, complaining thatthe stream does not support a Write!!

Can anyone give me help on this? I've stared at it now for a while and

don't
see the problem.

Thanks in advance,
Bill

Jul 21 '05 #3
Peter-
I've figured out the problem. In my case the XML file in question was
written using UTF-8 encoding -- which apparently includes some binary
"chars" at the beginning of the file. If I remove those characters then my
use of Console.In to create an xmltextreader works as expected. So, the
problem was pilot error; although I think the "Write error on Read()" error
was certainly a misleading one!

Thanks again for the response,
Bill

"Bill Cohagan" <bi**@teraXNOSPAMXquest.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Peter-
Thanks for the response. I'll try your code to see if I can figure out
the difference. In the meantime, did you try this using the redirection
symbols ">" and "<"? That's how I got the error.

Regards,
Bill

"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:mE**************@cpmsftngxa06.phx.gbl...
Hi Bill,

I can not reproduce the problem, here is my code , you may have a try.
Did I misunderstand your meaning?
Can you please post the exactly error messge?

[HeadCount.xml]
<hc:HeadCount xmlns:hc='xsdHeadCount' xsi:schemaLocation='xsdHeadCount
HeadCount.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<Name>Waldo Pepper</Name>
<Name>Red Pepper</Name>
</hc:HeadCount>

[HeadCount.xsd]
<xs:schema xmlns="xsdHeadCount" targetNamespace="xsdHeadCount"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name='HeadCount' type="HEADCOUNT"/>
<xs:complexType name="HEADCOUNT">
<xs:sequence>
<xs:element name='Name' type='xs:string' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='division' type='xs:int' use='optional' default='8'/>
</xs:complexType>
</xs:schema>

static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;
if (args.Length > 1) Console.SetOut(new StreamWriter(args[1]));
//executes if I don't use the "<", ">" redirection syntax when invoking
XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = @"c:\HeadCount.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
XmlTextReader xsdreader = new XmlTextReader(SchemaResource);
xmlvr.Schemas.Add(null, xsdreader);
xmlvr.ValidationType=ValidationType.Schema;
while (!xmlvr.EOF)
xmlvr.Read();
xmlw.WriteStartDocument();
xmlw.WriteStartElement("TestPref","TestName","Test NS");
xmlw.WriteElementString("TestName","TestNS","TestC on");
xmlw.WriteEndElement();
xmlw.WriteEndDocument();
}

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Bill Cohagan" <bi**@teraXNOSPAMXquest.com>
Subject: Write error on Read() ??
Date: Sat, 27 Sep 2003 16:24:02 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#x**************@TK2MSFTNGP10.phx.gbl>
Newsgroups:

microsoft.public.dotnet.general,microsoft.public.d otnet.languages.csharp
NNTP-Posting-Host: cs24313-53.austin.rr.com 24.243.13.53
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.languages.csharp:187725
microsoft.public.dotnet.general:110132
X-Tomcat-NG: microsoft.public.dotnet.general

I'm writing a console app in c# and am encountering a strange problem.

I'mtrying to use redirection of the standard input stream to read input from a
(xml) file. The following code snippet is from this app:
===============================
static void Main(string[] args)
{
if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
//executes if I don't use the "<", ">" redirection syntax when invoking

XmlTextReader xmlin = new XmlTextReader(Console.In);
xmlin.WhitespaceHandling = WhitespaceHandling.None;

if (args.Length > 1) Console.SetOut(new
StreamWriter(args[1]));//executes if I don't use the "<", ">"
redirectionsyntax when invoking

XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
string SchemaResource = "DBDumper.DumpSpec0.xsd";
XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
Assembly a = Assembly.GetExecutingAssembly();
Debug.Assert (a.GetManifestResourceInfo(SchemaResource) != null);
XmlTextReader xsdreader = new XmlTextReader(new
StreamReader(a.GetManifestResourceStream(SchemaRe source)));
xmlvr.Schemas.Add(null, xsdreader);
try
{
xmlvr.Read();
....
=============================
So, assuming my app's executable is foo.exe, things work fine if I type

in
foo input.xml output.xml

Also,
foo input.xml > output.xml

works fine. But, if I type in:

foo < input.xml > output.xml

I get an error on the xmlvr.Read() in the last line above, complaining thatthe stream does not support a Write!!

Can anyone give me help on this? I've stared at it now for a while and

don't
see the problem.

Thanks in advance,
Bill


Jul 21 '05 #4
Hi Bill,

I have tried to use the redirection symbols ">" and "<" in my demo code.
I am glad that the problem has been resolved.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Bill Cohagan" <bi**@teraXNOSPAMXquest.com>
References: <#x**************@TK2MSFTNGP10.phx.gbl> <mE**************@cpmsftngxa06.phx.gbl>
<ue**************@TK2MSFTNGP10.phx.gbl>Subject: Solved - Re: Write error on Read() ??
Date: Mon, 29 Sep 2003 13:50:14 -0500
Lines: 163
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <e6**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: cs24313-53.austin.rr.com 24.243.13.53
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:110274
X-Tomcat-NG: microsoft.public.dotnet.general

Peter-
I've figured out the problem. In my case the XML file in question was
written using UTF-8 encoding -- which apparently includes some binary
"chars" at the beginning of the file. If I remove those characters then my
use of Console.In to create an xmltextreader works as expected. So, the
problem was pilot error; although I think the "Write error on Read()" error
was certainly a misleading one!

Thanks again for the response,
Bill

"Bill Cohagan" <bi**@teraXNOSPAMXquest.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Peter-
Thanks for the response. I'll try your code to see if I can figure out
the difference. In the meantime, did you try this using the redirection
symbols ">" and "<"? That's how I got the error.

Regards,
Bill

"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:mE**************@cpmsftngxa06.phx.gbl...
> Hi Bill,
>
> I can not reproduce the problem, here is my code , you may have a try.
> Did I misunderstand your meaning?
> Can you please post the exactly error messge?
>
> [HeadCount.xml]
> <hc:HeadCount xmlns:hc='xsdHeadCount' xsi:schemaLocation='xsdHeadCount
> HeadCount.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
> <Name>Waldo Pepper</Name>
> <Name>Red Pepper</Name>
> </hc:HeadCount>
>
> [HeadCount.xsd]
> <xs:schema xmlns="xsdHeadCount" targetNamespace="xsdHeadCount"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name='HeadCount' type="HEADCOUNT"/>
> <xs:complexType name="HEADCOUNT">
> <xs:sequence>
> <xs:element name='Name' type='xs:string' maxOccurs='unbounded'/>
> </xs:sequence>
> <xs:attribute name='division' type='xs:int' use='optional'

default='8'/>
> </xs:complexType>
> </xs:schema>
>
> static void Main(string[] args)
> {
> if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
> //executes if I don't use the "<", ">" redirection syntax when invoking
> XmlTextReader xmlin = new XmlTextReader(Console.In);
> xmlin.WhitespaceHandling = WhitespaceHandling.None;
> if (args.Length > 1) Console.SetOut(new StreamWriter(args[1]));
> //executes if I don't use the "<", ">" redirection syntax when invoking
> XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
> string SchemaResource = @"c:\HeadCount.xsd";
> XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
> XmlTextReader xsdreader = new XmlTextReader(SchemaResource);
> xmlvr.Schemas.Add(null, xsdreader);
> xmlvr.ValidationType=ValidationType.Schema;
> while (!xmlvr.EOF)
> xmlvr.Read();
> xmlw.WriteStartDocument();
> xmlw.WriteStartElement("TestPref","TestName","Test NS");
> xmlw.WriteElementString("TestName","TestNS","TestC on");
> xmlw.WriteEndElement();
> xmlw.WriteEndDocument();
> }
>
>
>
> Regards,
> Peter Huang
> Microsoft Online Partner Support
> Get Secure! www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers norights. >
> --------------------
> >From: "Bill Cohagan" <bi**@teraXNOSPAMXquest.com>
> >Subject: Write error on Read() ??
> >Date: Sat, 27 Sep 2003 16:24:02 -0500
> >Lines: 50
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> >Message-ID: <#x**************@TK2MSFTNGP10.phx.gbl>
> >Newsgroups:
> microsoft.public.dotnet.general,microsoft.public.d otnet.languages.csharp > >NNTP-Posting-Host: cs24313-53.austin.rr.com 24.243.13.53
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.languages.csharp:187725
> microsoft.public.dotnet.general:110132
> >X-Tomcat-NG: microsoft.public.dotnet.general
> >
> >I'm writing a console app in c# and am encountering a strange problem.

I'm
> >trying to use redirection of the standard input stream to read inputfrom
a
> >(xml) file. The following code snippet is from this app:
> >===============================
> > static void Main(string[] args)
> > {
> > if (args.Length > 0) Console.SetIn(new StreamReader(args[0]));
> >//executes if I don't use the "<", ">" redirection syntax when invoking > >
> > XmlTextReader xmlin = new XmlTextReader(Console.In);
> > xmlin.WhitespaceHandling = WhitespaceHandling.None;
> >
> > if (args.Length > 1) Console.SetOut(new
> >StreamWriter(args[1]));//executes if I don't use the "<", ">"redirection > >syntax when invoking
> >
> > XmlTextWriter xmlw = new XmlTextWriter(Console.Out);
> > string SchemaResource = "DBDumper.DumpSpec0.xsd";
> > XmlValidatingReader xmlvr = new XmlValidatingReader(xmlin);
> > Assembly a = Assembly.GetExecutingAssembly();
> > Debug.Assert (a.GetManifestResourceInfo(SchemaResource) != null);
> > XmlTextReader xsdreader = new XmlTextReader(new
> >StreamReader(a.GetManifestResourceStream(SchemaRe source)));
> > xmlvr.Schemas.Add(null, xsdreader);
> > try
> > {
> > xmlvr.Read();
> > ....
> >=============================
> >So, assuming my app's executable is foo.exe, things work fine if I

type in
> >
> > foo input.xml output.xml
> >
> >Also,
> > foo input.xml > output.xml
> >
> >works fine. But, if I type in:
> >
> > foo < input.xml > output.xml
> >
> >I get an error on the xmlvr.Read() in the last line above, complaining

that
> >the stream does not support a Write!!
> >
> >Can anyone give me help on this? I've stared at it now for a while and
> don't
> >see the problem.
> >
> >Thanks in advance,
> > Bill
> >
> >
> >
>




Jul 21 '05 #5

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

Similar topics

4
by: Bill Cohagan | last post by:
I'm writing a console app in c# and am encountering a strange problem. I'm trying to use redirection of the standard input stream to read input from a (xml) file. The following code snippet is from...
0
by: Frederic Rentsch | last post by:
Hi all, Working with read and write operations on a file I stumbled on a complication when writes fail following a read to the end. 30L 'abcdefg' Traceback (most recent call last): File...
6
by: wiso | last post by:
My problem is this (from: http://www.cplusplus.com/ref/iostream/fstream/open.html) #include <fstream> using namespace std; int main() { fstream f;
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: eholz1 | last post by:
Hello PHP Group, I am having trouble setting permissions correctly so that the magickwand api (php 5.2) can read and write images. I usually read a file from one directory, create a magickwand...
2
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project,...
24
by: Bill | last post by:
Hello, I'm trying to output buffer content to a file. I either get an access violation error, or crazy looking output in the file depending on which method I use to write the file. Can anyone...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.