|
Hi Daniel,
Thanks for the reply, despite my hard to read post!
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi,
I tried the SelectNodes and SelectSingleNode method. However, it starts its search from the root document. However, I want it to search only in its own node context. Am I missing something here?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
I have a .net web service which expects a soap requested outlined by a structure of classes. Working on the client side I have created an xml file that contains everything that will be in the body of the soap envelope. If possible I want to take the contents of the xml file and shove them directly into the class and send it the web service. Here is the code I have been trying.
<br />
Dim sXMLFile As String = txtXML.Text<br />
Dim doc As New XmlDocument()<br />
Dim rc As localhost.Request<br />
<br />
Dim ds As New DataSet()<br />
Dim tbl As DataTable<br />
Dim col As DataColumn<br />
Dim row As DataRow<br />
<br />
doc.Load(sXMLFile)<br />
ds.ReadXml(New XmlNodeReader(doc))<br />
<br />
''
'rc.SetInfo = ds.Tables(0).DataSet<br />
'rc.SetInfo2 = ds.Tables(1).DataSet<br />
<br />
''
''
'wr.SubmitRequest(ctype(ds, localhost.Request)<br />
'wr.SubmitRequest(ctype(sXMLFile, localhost.Request)<br />
wr.SubmitRequest(ctype(XmlNodeReader(doc), localhost.Request)<br />
Is this possible and if so how?
Thanks,
Jason W.
|
|
|
|
|
Yep, its possible. Do you have the WSDL for the method in question? You will need to use the correct schema.
If you have the WSDL however, it would probalby be a better idea to generate a proxy and use that, much more maintainable.
Ryan.
|
|
|
|
|
Actually, I finally figured out how to do it this morning. Here is what I came up with:
Dim sXMLFile As String = txtXML.Text<br />
Dim serializer As New XmlSerializer(GetType(localhost.RequestChange))<br />
Dim fs As New FileStream(sXMLFile, FileMode.Open)<br />
Dim rc As localhost.RequestChange<br />
rc = CType(serializer.Deserialize(fs), localhost.RequestChange)
Thanks for the response,
Jason W.
|
|
|
|
|
I need to accept XML formatted data over a socket connection and place the data into a dataset for parsing. The XML data is bracketed by a start character and an end character, but may range from 50 bytes to thousands of bytes. The app will need to be in c++. ANy ideas
Thanks
|
|
|
|
|
Just grab the XML and use DataSet.ReadXml to load it into a DataSet object. You can use the socket stream as the parameter, or use any TextReader (such as the XmlTextReader ) as the parameter. Just see the ReadXml for the overloads.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I’m hitting my .Net web service with a .Net client app I developed and am getting the following error.
A first chance exception of type 'System.ObjectDisposedException' occurred in system.dll<br />
Additional information: Cannot access a disposed object named "System.Net.Sockets.NetworkStream".
Any Ideas why it is occurring?
Thanks,
Jason W.
|
|
|
|
|
Where can I find info on creating PDF format with XML/XSL?
|
|
|
|
|
|
Where can I find info on created PDF format with XML/XSL?
|
|
|
|
|
My problem is in the Subject.
APe
|
|
|
|
|
How to display xml transformed in HTML in a windows Application?
|
|
|
|
|
using XSL ...
Your question is way too general, so I'll recommend that perhaps you get yourself a good XML book (i.e., Teach yourself XML in 24 hours).
As for displaying HTML in a windows Application, you'll need to make use of the IBrowser/IBrowser2 interface.
D.
|
|
|
|
|
|
Hi ,
I am creating xml document from dataset.
one of my data field is of data type datetime.
so when I am converting it to xml it is getting conveted in to long date value ,but i don't want long date.
for example
my datetime field value is 8/29/2002
and it is getting converted into '2002-08-29T00:00:00.0000000+05:30'
I hope I have explained my problem to some extent.
can anybody help me out to solve this problem?
thanks
|
|
|
|
|
I ran into this same "issue", and I ended up just storing the Date as a string in the XML and then converting it back into a Date/Time when I read the data back in ...
There's probably a more "direct" approach to take, but this works just fine.
D.
|
|
|
|
|
I have very little idea about XML and i want to learn this thing. Can some one suggest link, good book to learn
1-XML basics and what it is.
2-Good way to learn MSXML API.
Thanks
paracha3
|
|
|
|
|
|
Jump in over your head... try O'Reilly's XSLT Cookbook.
|
|
|
|
|
Oops... sorry, I mis-read your post and thought you were looking for XSL resources.
|
|
|
|
|
Hi...
I have createds a XML document (chart.xml) along with a seperate XML Schema (chart.xsd) document to describe the structure of the XML document and its data types.
My confusion comes in (after trying the w3CSchools explanation unsuccessfully) when namespaces need to be applied.
All I want to do is get the XML document to reference this XSD document (which are located in the same folder) so that value and elements within the XML document are of the correct format (this is what schema is for is it not?).
Also how can I tell its working properly?
Any help/pointers would be very appreicated.
Ta
John
XML CODE----------------------------------------
<chartdata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
="" xsi:nonamespaceschemalocation="file:chart.xsd">
<chart name="ttt">
<data_xaxis>
<dataitem>Mon
<dataitem>Tue
<dataitem>Wed
<dataitem>Thu
<dataitem>Fri
<dataitem>Sat
<dataitem>Sun
<data_yaxis>
<dataitem>45
<dataitem>50
<dataitem>30
<dataitem>10
<dataitem>30
<dataitem>50
<dataitem>70
<totalsizex>600
<totalsizey>400
<legend_xaxis>Days of the month
<legend_yaxis>Total man hours
<chart_title>Daily Studio man hours
<xmargin>50
<ymargin>50
<plotstart_leftx>30
<plotstart_topy>20
Schema CODE-------------------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xs:element name="CHART">
<xs:complextype>
<xs:sequence>
<xs:attribute name="name"
="" type="xs:string" use="required">
<xs:element name="DATA_XAXIS">
<xs:complextype>
<xs:sequence>
<xs:element name="DATAITEM"
="" type="xs:string" minoccurs="0" maxoccurs="unbounded">
<xs:element name="DATA_YAXIS">
<xs:complextype>
<xs:sequence>
<xs:element name="DATAITEM"
="" type="xs:string" minoccurs="0" maxoccurs="unbounded">
<xs:element name="TOTALSIZEX" type="xs:integer">
<xs:element name="TOTALSIZEY" type="xs:integer">
<xs:element name="LEGEND_XAXIS" type="xs:string">
<xs:element name="LEGEND_YAXIS" type="xs:string">
<xs:element name="CHART_TITLE" type="xs:string">
<xs:element name="XMARGIN" type="xs:integer">
<xs:element name="YMARGIN" type="xs:integer">
<xs:element name="PLOTSTART_LEFTX" type="xs:integer">
<xs:element name="PLOTSTART_TOPY" type="xs:integer">
|
|
|
|
|
--XML CODE------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<CHARTDATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:chart.xsd">
<CHART NAME="ttt">
<DATA_XAXIS>
<DATAITEM>Mon</DATAITEM>
<DATAITEM>Tue</DATAITEM>
<DATAITEM>Wed</DATAITEM>
<DATAITEM>Thu</DATAITEM>
<DATAITEM>Fri</DATAITEM>
<DATAITEM>Sat</DATAITEM>
<DATAITEM>Sun</DATAITEM>
</DATA_XAXIS>
<DATA_YAXIS>
<DATAITEM>45</DATAITEM>
<DATAITEM>50</DATAITEM>
<DATAITEM>30</DATAITEM>
<DATAITEM>10</DATAITEM>
<DATAITEM>30</DATAITEM>
<DATAITEM>50</DATAITEM>
<DATAITEM>70</DATAITEM>
</DATA_YAXIS>
<TOTALSIZEX>600</TOTALSIZEX>
<TOTALSIZEY>400</TOTALSIZEY>
<LEGEND_XAXIS>Days of the month</LEGEND_XAXIS>
<LEGEND_YAXIS>Total man hours</LEGEND_YAXIS>
<CHART_TITLE>Daily Studio man hours</CHART_TITLE>
<XMARGIN>50</XMARGIN>
<YMARGIN>50</YMARGIN>
<PLOTSTART_LEFTX>30</PLOTSTART_LEFTX>
<PLOTSTART_TOPY>20</PLOTSTART_TOPY>
</CHART>
</CHARTDATA>
--XSD CODE------------------------------------------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xs:element name="CHART">
<xs:complexType>
<xs:sequence>
<xs:attribute name="name"
type="xs:string"
use="required" />
<xs:element name="DATA_XAXIS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATAITEM"
type="xs:string"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATA_YAXIS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATAITEM"
type="xs:string"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TOTALSIZEX" type="xs:integer" />
<xs:element name="TOTALSIZEY" type="xs:integer" />
<xs:element name="LEGEND_XAXIS" type="xs:string" />
<xs:element name="LEGEND_YAXIS" type="xs:string" />
<xs:element name="CHART_TITLE" type="xs:string" />
<xs:element name="XMARGIN" type="xs:integer" />
<xs:element name="YMARGIN" type="xs:integer" />
<xs:element name="PLOTSTART_LEFTX" type="xs:integer" />
<xs:element name="PLOTSTART_TOPY" type="xs:integer" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
|
|
|
|
|
Namespaces are used to qualify elements and attributes. They aren't necessary, but are usually a good idea so that you can easily qualify elements and attributes when using XML documents with mixed content. To use them, add the xs:targetNamespace (where xs is the namespace prefix for XMLSchemas) and then use the same namespace to qualify your XML document that you gave first. To use it as the default namespace, use xmlns="....." with no prefix.
When you're using code to access the DOM, you can use any prefix you want, so long as the namespace in the namespace manager (in .NET, this is the XmlNamespaceManager ) matches (case-sensitively) the namespace declared in the document.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
- IXMLDOMDocument2Ptr ObjXMLDoc;
- hresult = ObjXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0");
i then perform the following call:
- ObjXMLDoc->load(Filename);
where Filename is a valid XML file (no scheme is used).
this call takes out memory resources, and when i use the same last call with a different Filename, it takes more of it - without releasing the last one's resources.
is there a way to "Unload" an xml file from memory (to perform something like the opposite of "load" method)?
|
|
|
|