473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems Reading XML File

Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a test
Windows Installer .MSP (patch) file using the MsiExtractPatch XMLData()
method and directly written to disk as a test. On the surface, it seems to
me to be valid XML since IE can load & display it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0" PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>
<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to extract
some information from it, but it always fails to get anything. For example,
what's funtionally wrong with the following code? It throws an exception:
"Object reference not set to an instance of an object." when it hits the
MessageBox.Show line. When I check the LocalName of xRoot, it correctly
shows "MsiPatch", but fails to get the xTargetProductN ode, or any other
nodes below the root node. Using SelectNodes to get an XmlNodeList doesn't
work either. The only way I can seem to get the info is by looping through
the ChildNodes (and comparing their LocalNames to the tag I'm looking for)
instead of directly with a simple XPath. What am I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also fails
to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com
Jan 16 '06 #1
7 1993
John,
Where's the declaration line? You go to have '<?xml version="1.0"
encoding="UTF-8"?>' at least, on the first line of the xml file to make it
for a valid.

thx
-jsh

"John Bowman jo*********@the rmo.com>" wrote:
Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a test
Windows Installer .MSP (patch) file using the MsiExtractPatch XMLData()
method and directly written to disk as a test. On the surface, it seems to
me to be valid XML since IE can load & display it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0" PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>
<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to extract
some information from it, but it always fails to get anything. For example,
what's funtionally wrong with the following code? It throws an exception:
"Object reference not set to an instance of an object." when it hits the
MessageBox.Show line. When I check the LocalName of xRoot, it correctly
shows "MsiPatch", but fails to get the xTargetProductN ode, or any other
nodes below the root node. Using SelectNodes to get an XmlNodeList doesn't
work either. The only way I can seem to get the info is by looping through
the ChildNodes (and comparing their LocalNames to the tag I'm looking for)
instead of directly with a simple XPath. What am I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also fails
to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com

Jan 16 '06 #2
I'm not so sure about that. The line is certainly preferable, but a
well-formed XML document doesn't have to have that line.
"js********@hot mail.com" <js************ *****@discussio ns.microsoft.co m>
wrote in message news:F0******** *************** ***********@mic rosoft.com...
John,
Where's the declaration line? You go to have '<?xml version="1.0"
encoding="UTF-8"?>' at least, on the first line of the xml file to make it
for a valid.

thx
-jsh

"John Bowman jo*********@the rmo.com>" wrote:
Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a
test
Windows Installer .MSP (patch) file using the MsiExtractPatch XMLData()
method and directly written to disk as a test. On the surface, it seems
to
me to be valid XML since IE can load & display it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0"
PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>

<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to
extract
some information from it, but it always fails to get anything. For
example,
what's funtionally wrong with the following code? It throws an exception:
"Object reference not set to an instance of an object." when it hits the
MessageBox.Show line. When I check the LocalName of xRoot, it correctly
shows "MsiPatch", but fails to get the xTargetProductN ode, or any other
nodes below the root node. Using SelectNodes to get an XmlNodeList
doesn't
work either. The only way I can seem to get the info is by looping
through
the ChildNodes (and comparing their LocalNames to the tag I'm looking
for)
instead of directly with a simple XPath. What am I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also
fails
to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com

Jan 16 '06 #3


John Bowman < wrote:

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0" PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200"> Now that I can actually "see" the XML for testing purposes I want to extract
some information from it, but it always fails to get anything. F if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");


The super XPath FAQ, finding elements in the default namespace:
<http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/616>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 16 '06 #4
Scott,

I think I have to agree with you on this one. I did not create the XML, MS
did via the API call. Simply writing the text to a disk file, as is,
resulted in the XML I posted. I just couldn't figure out how to get it to
retreive the requested node(s) correctly. Based on the Martin's reply (see
next thread message), I think I'll be able to solve it when I implement
handling the namespace using an XmlNamespaceMan ager.

Thanks,

John

"Scott M." <s-***@nospam.nosp am> wrote in message
news:ep******** ******@TK2MSFTN GP09.phx.gbl...
I'm not so sure about that. The line is certainly preferable, but a
well-formed XML document doesn't have to have that line.
"js********@hot mail.com" <js************ *****@discussio ns.microsoft.co m>
wrote in message
news:F0******** *************** ***********@mic rosoft.com...
John,
Where's the declaration line? You go to have '<?xml version="1.0"
encoding="UTF-8"?>' at least, on the first line of the xml file to make
it
for a valid.

thx
-jsh

"John Bowman jo*********@the rmo.com>" wrote:
Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a
test
Windows Installer .MSP (patch) file using the MsiExtractPatch XMLData()
method and directly written to disk as a test. On the surface, it seems
to
me to be valid XML since IE can load & display it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0"
PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>

<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to
extract
some information from it, but it always fails to get anything. For
example,
what's funtionally wrong with the following code? It throws an
exception:
"Object reference not set to an instance of an object." when it hits the
MessageBox.Show line. When I check the LocalName of xRoot, it correctly
shows "MsiPatch", but fails to get the xTargetProductN ode, or any other
nodes below the root node. Using SelectNodes to get an XmlNodeList
doesn't
work either. The only way I can seem to get the info is by looping
through
the ChildNodes (and comparing their LocalNames to the tag I'm looking
for)
instead of directly with a simple XPath. What am I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also
fails
to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com


Jan 16 '06 #5
Martin, et al,

Thanks for the help. I think this link appears to contain the solution.

John

"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:e%******** ********@TK2MSF TNGP09.phx.gbl. ..


John Bowman < wrote:

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0"
PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}" MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">

Now that I can actually "see" the XML for testing purposes I want to
extract some information from it, but it always fails to get anything. F

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");


The super XPath FAQ, finding elements in the default namespace:
<http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/616>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Jan 16 '06 #6
Hi,

I think your problem can be solved by using an XmlNamespaceMan ager on your
calls to SelectSingleNod e and SelectNodes
Even when the nodes you are searching for are in the default namespace, you
still need a prefix, and whenever you use a prefix in an XPath expression,
you need an XmlNamespaceMan ager.
(See class XmlNamespaceMan ager.AddNamespa ce in VS help for a description)

XmlNamespaceMan ager nsmgr = new XmlNamespaceMan ager(xDoc .NameTable);
// Create a namespace manager
nsmgr.AddNamesp ace("default", http://www.microsoft.com/msi/patch);
// Add the default namespace with a prefix of "default"; could be any
character string e.g. "aa"

XmlNode xTargetProductN ode =
xRoot.SelectSin gleNode("defaul t:TargetProduct ", nsmgr); // Use the
prefix in the XPath expression and pass the namespace manager
XmlNodeList xNodeList = xRoot.SelectNod es("default:Tar getProduct",
nsmgr); // Use the prefix in the XPath expression and
pass the namespace manager

Regards
"John Bowman jo*********@the rmo.com>" <<Remove this before reply> wrote in
message news:u$******** *****@TK2MSFTNG P14.phx.gbl...
Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a
test Windows Installer .MSP (patch) file using the
MsiExtractPatch XMLData() method and directly written to disk as a test. On
the surface, it seems to me to be valid XML since IE can load & display
it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0" PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}"
MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>

<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to
extract some information from it, but it always fails to get anything. For
example, what's funtionally wrong with the following code? It throws an
exception: "Object reference not set to an instance of an object." when it
hits the MessageBox.Show line. When I check the LocalName of xRoot, it
correctly shows "MsiPatch", but fails to get the xTargetProductN ode, or
any other nodes below the root node. Using SelectNodes to get an
XmlNodeList doesn't work either. The only way I can seem to get the info
is by looping through the ChildNodes (and comparing their LocalNames to
the tag I'm looking for) instead of directly with a simple XPath. What am
I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also
fails to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com

Jan 17 '06 #7
KDOR,

Thanks. Between your help & Martin's before you, I managed to make it work.

Take care,

John
"KDOR" <KD**@newsgroup s.nospam> wrote in message
news:OK******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

I think your problem can be solved by using an XmlNamespaceMan ager on your
calls to SelectSingleNod e and SelectNodes
Even when the nodes you are searching for are in the default namespace,
you still need a prefix, and whenever you use a prefix in an XPath
expression, you need an XmlNamespaceMan ager.
(See class XmlNamespaceMan ager.AddNamespa ce in VS help for a description)

XmlNamespaceMan ager nsmgr = new XmlNamespaceMan ager(xDoc .NameTable);
// Create a namespace manager
nsmgr.AddNamesp ace("default", http://www.microsoft.com/msi/patch); //
Add the default namespace with a prefix of "default"; could be any
character string e.g. "aa"

XmlNode xTargetProductN ode =
xRoot.SelectSin gleNode("defaul t:TargetProduct ", nsmgr); // Use the
prefix in the XPath expression and pass the namespace manager
XmlNodeList xNodeList = xRoot.SelectNod es("default:Tar getProduct",
nsmgr); // Use the prefix in the XPath expression
and pass the namespace manager

Regards
"John Bowman jo*********@the rmo.com>" <<Remove this before reply> wrote in
message news:u$******** *****@TK2MSFTNG P14.phx.gbl...
Hi All,

I'm fairly new to XML, so I presume I'm doing something obviously dense
here, but here it goes. Below is an XML file that was extracted from a
test Windows Installer .MSP (patch) file using the
MsiExtractPatch XMLData() method and directly written to disk as a test.
On the surface, it seems to me to be valid XML since IE can load &
display it.

<MsiPatch xmlns="http://www.microsoft.c om/msi/patch_applicabi lity.xsd"
SchemaVersion=" 1.0.0.0"
PatchGUID="{2AA C52C8-0F60-481F-852D-116CDE7EBE0D}" MinMsiVersion=" 3">
<TargetProduc t MinMsiVersion=" 200">
<TargetProductC ode
Validate="true" >{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<TargetVersio n Validate="true" ComparisonType= "LessThanOrEqua l"
ComparisonFilte r="MajorMinorUp date">1.00.0000 </TargetVersion>
<TargetLangua ge Validate="false ">1033</TargetLanguage>
<UpdatedLanguag es>1033</UpdatedLanguage s>
<UpgradeCode
Validate="true" >{1C18A718-D408-4D74-B2C6-0F6A932CE841}</UpgradeCode>
</TargetProduct>

<TargetProductC ode>{C2E2F155-71DD-458A-966B-3C231CFB5E7D}</TargetProductCo de>
<SequenceData >
<PatchFamily>C2 E2F15571DD458A9 66B3C231CFB5E7D </PatchFamily>
<Sequence>0.0.1 7219.55500</Sequence>
<Attributes>0 </Attributes>
</SequenceData>
</MsiPatch>

Now that I can actually "see" the XML for testing purposes I want to
extract some information from it, but it always fails to get anything.
For example, what's funtionally wrong with the following code? It throws
an exception: "Object reference not set to an instance of an object."
when it hits the MessageBox.Show line. When I check the LocalName of
xRoot, it correctly shows "MsiPatch", but fails to get the
xTargetProductN ode, or any other nodes below the root node. Using
SelectNodes to get an XmlNodeList doesn't work either. The only way I can
seem to get the info is by looping through the ChildNodes (and comparing
their LocalNames to the tag I'm looking for) instead of directly with a
simple XPath. What am I doing wrong?

if(File.Exists( FileSpec) == true)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(DEF_O UTPUT_FILENAME) ;
XmlNode xRoot = xDoc.DocumentEl ement;
XmlNode xTargetProductN ode = xRoot.SelectSin gleNode("Target Product");
//XmlNodeList xNodeList = xRoot.SelectNod es("TargetProdu ct"); ///Also
fails to find anything and the xNodeList.Count = 0;
MessageBox.Show (xTargetProduct Node.LocalName) ;
}
else
{
MessageBox.Show ("Unable to read file:" +
Environment.New Line +
FileSpec);
}
Thanks in advance for the help,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com


Jan 17 '06 #8

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

Similar topics

2
3300
by: Keegan Alex | last post by:
Hi folks, I downloaded PHP-Nuke 6.7, and after reading the INSTALL file, it looks very simple... but either i'm reading them wrong or they're very flawed. First, it says: Untar the package into the directory you want to use on you web server, if you're unsure where that is, ask you system administrator.
6
1929
by: Sara Khalatbari | last post by:
Dear friends In a code, I'm opening a file to read. Like : lines = open(filename).readlines() & I'm never closing it. I'm not writing in that file, I just read it. Will it cause any problems if you open a file to read & never close it?
2
17407
by: jfixsen | last post by:
Hello! Oracle 9.2.0.4 SunOS pchi-db01 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-EnterpriseSystem = SunOS Node = pchi-db01 Release = 5.8 KernelID = Generic_108528-19 Machine = sun4u BusType = <unknown>
4
3730
by: hall | last post by:
Hi. I ran across a bug in one of my problems and after spending some time tracking it down i found that the problem arose in a piece of code that essentially did this: ----------- ifstream in("in.txt"); if(!in) {cout << "error\n";} in.close(); if(!in) {cout << "error\n";} in.close(); if(!in) {cout << "error\n";}
1
2011
by: Need Helps | last post by:
Hello. I'm writing an application that writes to a file a month, day, year, number of comments, then some strings for the comments. So the format for each record would look like: mdyn"comment~""comment~"\n Now, I wrote some code to read these records, and it works perfectly for every date I've tried it on, except when the day is 26. I tried saving a record for 6/26/2004 and 7/26/2004 and it read it in as the day, year, and number of...
4
2259
by: Jonathan [sbrodolo] | last post by:
Hi there, I am using a LOTUS/DOMINO Web Service in my ASP.Net application and I am having quite a lot of problems. I have managed to solve most of them but this one it really is giving me terrible headaches. Web Service send's me back an XML that I have managed to read with an enormous quantity of problems (it sends me back an XML file with double XML declaration, not the real XML format). In case of server errors, DOMINO sends me back an...
9
2191
by: Sheldon | last post by:
Good day Everyone, I am a still very new at learning C and I have thrown myself in the deep end. I started with a simple program and kept widening the scope. This has taught me many things about C and some, I must admit, have not really sunk in yet. Still, I push on. Now I am taken a library of C programs that were designed to read HDF files. I work on a Unix server and in Mandrake10. The program below is most likely broken but I cannot...
2
2957
by: patrickdepinguin | last post by:
Hi, I use zlib to write data structures to a compressed file, using the gzwrite function. Afterwards I read the data back with gzread. I notice that this works well when the data written is not that much, but when there is more data to write, after a while I get data errors when reading back the data. Error in main: couldn't read stat zlib error -3: test512-20070531-18h10m02.stat.gz: data error
3
1735
by: katz911 | last post by:
Hello, I've encountered a strange problem which I can't seem to explain. I've written a simple C++ class that deals with a certian binary file. In one of the methods there, I wish to update a file - namely to read a certain field whose offset I know, and then write to another field, whose offset I also know. In order to read the data, I first use file.seekg(offset, ios::beg), and then a read command; I've checked the variable, and...
12
4657
by: xamdam | last post by:
Hi fellas, I am experiencing problems reading a 2GB zipfile consisting of multiple zipped files. I found a thread http://mail.python.org/pipermail/python-dev/2005-April/053027.html that mentions a problem on the writing side, does such a problem exist on a reading side? I am using 2.4.1, perhaps there is a fix in a later version?
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
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...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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
8613
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
7351
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
6176
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
4173
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...
2
1732
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.