|
I want to store an xml file in sqlserver using asp
xml file should be used as an input paramenter for a stored procedure
suneel
|
|
|
|
|
I want function in one namespace to create instance of class defined in
another namespace.
(more detailed - I try to make independent "Seralizer" dll, to be used
by different application, each calling it from its own class which
defines the application configuration)
I failed to make it work.
Notify that in the Seralizer source I dont know the definition of the
class I get.
Foe example, how do I make lines like below working?
public void Deserialize(Type cfgType)
{
myType obj = Activator.CreateInstance(cfgType);
XmlSerializer serializer = new XmlSerializer( cfgType);
FileStream stream = new FileStream("some file...", FileMode.Open,
FileAccess.Read);
cfgType configuration = (cfgType)serializer.Deserialize(stream);
}
thanks
Michael Lev (mlev)
|
|
|
|
|
hello
I am making DOm msxml parser .
My current compiler in visual C++ 6
but it crashes while loading xml file in loadxml() method.
if any one know how to overcome this error kindly help me ?:->
mast
|
|
|
|
|
How can i get the value in an xml file when i specify the name in the xml file..Please provide me the code to do this in C#.NET..
Thanks..
|
|
|
|
|
I'm studying computer science and I'm in 400 level. I have a project to be submitted in 3month time and I should get the review and some of the designs ready for January. My project is to design a Software Like you cvtmovie but this time around it would convert any movie compres it and probably keep it in an archive untill its demanded for. This should aid the applications of large video user to be able to keep voluminuous video. I can cope with any prog language if i understand the problem being defined. I need to start from somewhere but I dont know how.
God Bless
|
|
|
|
|
I have an xml file which contains schedules for all employees. How do I extract data from this file for a specific employee? Below is a snippet of the code, but this loads all employees.
DataSet allSchedulesDs = new DataSet();
// get schedules
allSchedulesDs.ReadXml(myFilepath + "AllSchedules.xml");
scheduleCount = allSchedulesDs.Tables["ALLSCHEDULES"].Rows.Count - 1;
for (int j = 0; j <= scheduleCount; j++)
{
// check all xml file for badge number input
if ((string)allSchedulesDs.Tables["ALLSCHEDULES"].Rows[j][0] == textBoxBadgeId.Text.PadLeft(5, '0'))
// record found set up for display
{
// this gets all schedules need to limit display to just this badge number
scheduleList.DataSource = allSchedulesDs.Tables["ALLSCHEDULES"].DefaultView;
scheduleList.DataBind();
}
}
|
|
|
|
|
Hi everyone,
I first would like to warn you that I'm a newbie programmer. So if I have left out important code for you guys to determine what I'm doing wrong, let me know.
I am making a PocketPC application using C# and an XML file as a database. I would like to display the corresponding JPG image in a PictureBox, or somewhere on the main page.
A sample of my xml file. The bolded line is the picture reference.
<fragenkatalog><br />
<ca_id>4</ca_id><br />
<ca_titel>head ap</ca_titel><br />
<ca_bildurl1>kopf_ap.jpg</ca_bildurl1><br />
<ca_disabled>0</ca_disabled><br />
<ca_alter>999</ca_alter><br />
<ca_sex>n</ca_sex><br />
</fragenkatalog>
This is what I have, which doesn't work.
<br />
ca_bildurl.DataBindings.Add("Image",dt,"ca_bildurl1");
The ID is chosen from a ListBox, and the corresponding data is displayed on the screen.
Any help would be appreciated! Thanks!
M.
-- modified at 21:09 Friday 30th December, 2005
|
|
|
|
|
Please repost your XML with < and > instead of the < and > symbols.
Michael Flanakin
Web Log
|
|
|
|
|
Ok, it's changed. Sorry about that.
|
|
|
|
|
Trouble using sql:relation/sql:relationship in xsd file ...
Hi ...
I am attempting to use the sql:relation annotation and am having some troubles. I have used it successfull with the MS Sample (Customer / Order) where all the data is contained in elements (example below).
<code><ROOT>
<Customers>
<CustomerID>1111</CustomerID>
<SynchID>700</SynchID>
<CompanyName>Sean Chai</CompanyName>
<City>NY</City>
<Order OrderID="1" />
<Order OrderID="2" />
</Customers>
</ROOT>
In the xml that I am having trouble with the data is contained in attributes. In the code below I get the following
error when executing the bulk insert.
Any comments ?
Thanks !!
Chris
//////////////////////////////////////////////////////////////////////////
// error message
<?xml version="1.0"?><Result State="FAILED"><Error><HResult>0x80004005</HResult><Description><![CDATA[Schema: the parent/child table of the relationship on 'surface' does not match.]]></Description><Source>Schema mapping</Source><Type>FATAL</Type></Error></Result>
//////////////////////////////////////////////////////////////////////////
// xsd file
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:annotation>
<xsd:appinfo>
<sql:relationship name="MacgowanTest_Atmospheric_Surface"
parent="MacgowanTestRWISRawAtmospheric"
parent-key="SystemId RpuId"
child="MacgowanTestRWISRawSurface"
child-key="SystemId RpuId" />
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="site" sql:relation="MacgowanTestRWISRawAtmospheric" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sensors" sql:relation="MacgowanTestRWISRawSurface"
sql:relationship="MacgowanTest_Atmospheric_Surface">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="surface" sql:relation="MacgowanTestRWISRawSurface"
sql:relationship="MacgowanTest_Atmospheric_Surface" >
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" sql:field="SensorId"/>
<xsd:attribute name="datetime" type="xsd:date" sql:field="ObsDateTime" />
<xsd:attribute name="surfacecondition" type="xsd:string" sql:field="SurfaceCondition"/>
<xsd:attribute name="surfacetemp" type="xsd:string" sql:field="SurfaceTemperature"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="sysid" type="xsd:string" sql:field="SystemId"/>
<xsd:attribute name="rpuid" type="xsd:string" sql:field="RpuId"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
//////////////////////////////////////////////////////////////////////////
// xml data file
<?xml version="1.0"?>
<odot_rwis_site_info>
<site id="200000" number="1" sysid="200" rpuid="0" name="1-SR127 @ SR249" longitude="-84.554946" latitude="41.383527">
<atmospheric datetime="12/05/2005 03:48:00 PM" airtemp="-490" dewpoint="-800" relativehumidity="73" windspeedavg="11" windspeedgust="19" winddirectionavg="265" winddirectiongust="295" pressure="65535" precipitationintensity="None" precipitationtype="None" precipitationrate="0" precipitationaccumulation="-1" visibility="2000" />
<sensors>
<surface id="0" datetime="12/05/2005 03:48:00 PM" name="North Bound Driving Lane" surfacecondition="Dry" surfacetemp="1900" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="450" waterlevel="0">
<traffic datetime="12/05/2005 03:48:00 PM" occupancy="0" avgspeed="82" volume="21" sftemp="1900" sfstate="255">
<normalbins>
<bin datetime="12/05/2005 03:48:00 PM" binnumber="0" bincount="7" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="1" bincount="0" />
</normalbins>
<longbins>
<bin datetime="12/05/2005 03:48:00 PM" binnumber="2" bincount="0" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="3" bincount="0" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="4" bincount="1" />
<bin datetime="12/05/2005 03:48:00 PM" binnumber="5" bincount="0" />
</longbins>
</traffic>
</surface>
<surface id="1" datetime="12/05/2005 03:48:00 PM" name="Bridge Deck Simulator" surfacecondition="Other" surfacetemp="-60" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="-999999" waterlevel="0" />
</sensors>
</site>
<site id="200001" number="2" sysid="200" rpuid="1" name="2-Hardin County Garage" longitude="-83.6148588" latitude="40.6305358">
<atmospheric datetime="12/05/2005 03:49:00 PM" airtemp="-590" dewpoint="-900" relativehumidity="75" windspeedavg="9" windspeedgust="22" winddirectionavg="303" winddirectiongust="299" pressure="65535" precipitationintensity="None" precipitationtype="None" precipitationrate="0" precipitationaccumulation="-1" visibility="2000" />
<sensors>
<surface id="0" datetime="12/05/2005 03:49:00 PM" name="Bridge Deck Simulator" surfacecondition="Other" surfacetemp="-410" freezingtemp="32767" chemicalfactor="255" chemicalpercent="255" depth="32767" icepercent="255" subsurfacetemp="300" waterlevel="0" />
</sensors>
</site>
</odot_rwis_site_info></code>
|
|
|
|
|
I am not too hot on XML etc, and would appreciate a little help.
I have a large XML document and would like to know if it is possible to find a node within the document that has a specific value, (not attribute), with the .SelectNode( ... ) function? All that I have read so far leads me to believe that I will have to loop through the document searching for a node with a specific value rather than being able to home in on it with a clever XPath expression!
|
|
|
|
|
If you have
<doc>
<node>1</node>
<node>2</node>
</doc>
then the XPath expression node[text()='1'] should select the node with text contents of '1' (i.e. the first node in that document)
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
That's not completely true. You'll have to already be in the doc element, for that to work. If you're not already traversing thru the XML, you'll need to specify the absolute path to a property you want. You can do this by typing /doc/node . That will give you the value within the node element. If you have attributes, they need to be preceded with the at (@) symbol.
http://www.w3schools.com/xpath/default.asp[^]
Michael Flanakin
Web Log
|
|
|
|
|
Hi
I have lot of config data in a table which I want to put in .config file.
Is there any tool using which I can save the data into customized xml file?
Please advice. Thanks
Pankaj
|
|
|
|
|
May be you should place your data in a table and use the forXML T-SQl extension.
This can be done on MS SQL and SQL Anywhere.
The other option is to put it ina Access tbale and export in XML format.
|
|
|
|
|
I'm fairly new to XML and I'm just wondering if there is any difference between using elements or attributes to store data in an XML file. From a programatic view is is better to use one or the other for having to read in the file and such? Are there any performance differences? Is one more flexible than the other?
Any information on the topic is very appreciated.
- Aaron
|
|
|
|
|
There are no rules about when to use attributes, and when to use child elements. My experience is that attributes are handy in HTML, but in XML you should try to avoid them. Use child elements if the information feels like data.
Some of the problems with using attributes are:
.attributes cannot contain multiple values (child elements can)
.attributes are not easily expandable (for future changes)
.attributes cannot describe structures (child elements can)
.attributes are more difficult to manipulate by program code
.attribute values are not easy to test against a Document Type
.If you use attributes as containers for data, you end up with documents that are difficult to read and maintain.
Try to use elements to describe data. Use attributes only to provide information that is not relevant to the data.
Sushant Mathur
Ocwen Financial Sol. Pvt. Ltd,
Bangalore,
INDIA.
-- modified at 3:17 Wednesday 14th December, 2005
|
|
|
|
|
i fairly agree with you, i'm newbie too,and i'm always baffled by configuration of document.
|
|
|
|
|
Hi..
I am new to XML.NET Parser...So can anyone help me in providing some good links for XML .NET Parser so that i can load an xml file and validate it with xsd file in VC++..
Kindly provide the links or any advices regarding this..Plz don't tell me to search in Google..I had searched alot..So whoever familiar with XML .NET Parser,plz help me..
Thanks..
|
|
|
|
|
|
|
I have a project, in which we need to read in an XML file. But, when we read in that file, we need to parse it so that only designated data is used. So we parsed it into a string. We now are running into the difficulty of passing the String into the XSLT.
Is there a way to convert a String with XSLT, or do we need to rewrite the XML file?
TIA,
Scott
|
|
|
|
|
You can load the tring into an XMLDocument object much like you load it from file.
HRESULT loadXML(BSTR bstrXML,VARIANT_BOOL * isSuccessful);
This migth be an Microsoft extension of the DOM model, but it exists in
MSXML.
Then it is possible to transform it using the transformNode method of the XMLDocument object.
HRESULT transformNode(IXMLDOMNode *stylesheet, BSTR *xmlString);
/Per
|
|
|
|
|
What language/technology are you using?
Michael Flanakin
Web Log
|
|
|
|
|
Hi
i have an webpage which at the time of loading populates a table. the user can also populate the table by clicking on a button. There is a column called seqno which is populated in "space-SeqNo-space" fashion at the time of loading time population. Same thing when trying to accomplish through javascript it is seen that xsl loading time space is not identical with javascript space.
for example:
XSL:
" 1 "
" 2 " etc.
Javascript:
" 1 "
" 2 "
(here in example to show the effect i am using two space for javascript)
seeming an indentation problem.
My resolution is 1152 X 864.
Another thing for same color-code from javascript and from xsl it shows different color.
Thanks in advance
Chiranjib
|
|
|
|