|
Guys,
Hope I am in the right forum.
What is the difference between the webservice and DLL? Which one is fater? It seems that both of them are the same it depends on how you will use it.
Just a clear explanation since I am new to WEBSERVICE.
I am C# programmer.
|
|
|
|
|
hi,
dabuskol wrote:
What is the difference between the webservice and DLL? Which one is fater? It seems that both of them are the same it depends on how you will use it.
well, when you use webservice, you actually call some methods from dll that is somewhere on the web. Communication (transfer of arguments and return value) is done via SOAP - it is XML based format, so you are close to the right forum
Dll on the other hand, is usualy on the same computer as caller. So obviously it is faster... but advantage of Web Service (WS) is that it is platform independent (all you need is to have implementation of SOAP) since communication is basicaly done via XML. And it is web service - it allows you to execute code on distant servers and get results from them.
I hope I said it understandably.
However, there is some study material:
http://msdn.microsoft.com/webservices/[^]
David
|
|
|
|
|
Hello,
I read my xml file into a dataset and set the datasource of a datagrid to access one of the datatables. Problem is that when new rows are added to the datagrid, and I call the WriteXml method, the new rows are added at the root.
Following is an example:
<?xml version="1.0" standalone="yes"?>
<root xmlns="http://tempuri.org/Database.xsd">
<Database>
<Positions>
<Position PositionCode="1" PositionName="Operations Supervisor" Salary="0" />
</Positions>
</Database>
</root>
Then I set the DataSource to of a datagrid to "Position" table and after adding a couple of rows, the saved file looks like:
<?xml version="1.0" standalone="yes"?>
<root xmlns="http://tempuri.org/Database.xsd">
<Database>
<Positions>
<Position PositionCode="1" PositionName="Operations Supervisor" Salary="0" />
</Positions>
</Database>
<Position PositionCode="2" PositionName="Secretary" Salary="0"/>
<Position PositionCode="3" PositionName="LazyGuy" Salary="0"/>
</root>
Note that the new rows were added in "/root" instead of in "root/Database/positions"
|
|
|
|
|
Hi all,
I want to know the name of the file which contains the specification of default namespace(www.w3.org/2001/XMLSchema) in XML.
Plz help..
Suman Singh
|
|
|
|
|
Hello,
I have a xml file:
<akis xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<element><sql:query>SELECT @Element</sql:query></element>
<rows><sql:query>EXEC sp_ForXML @Element,'XML'</sql:query></rows>
</akis>
and I need to get the results of that.Is there any way to get them not by running the stored procedure but from the xml itself?
thaks in advance,
akis
|
|
|
|
|
Hi, i'm trying to load an xml document from C++ with:
MSXML::IXMLDOMDocumentPtr pXMLDocument (__uuidof (MSXML:OMDocument)); // main document parsed
hr = pXMLDocument->loadXML (BSTRTemp); /* trying parse string, if success, we have doc object*/
this method uses offensive memory. i have xml files that are about 100MB size.
i feel the function does not clear the memory. anyone an idea?
if i load 3 times the same file, my memory is full.
suggestion? is there a free method or something?
thank you,
lutz
|
|
|
|
|
|
hi, thx for your answers. after several tests i think i will have to do this.
|
|
|
|
|
Hi guys,
I've tried some stuff with XML and XSLT in Java. I had to develop an application that would transform various standards (XML and text) into one overall standard (XML) and then into some other formats (again XML and text). I did it by using Xerces for the text->xml and xml->xml stuff, but it couldn't do the transformations from XML to text.
I know want to do the same thing with "C#" and again I don't know how to transform xml to text.
Does anyone know if it is possible with XSLT? And if yes, how can it be done?
greetz
Stampede
PS: An example of the transformation I need to do would be the following:
<myDoc>
<firstNode>asdf1</firstNode>
<secondNode>asdf2</secondNode>
<thirdNode>
<fourthNode>asdf3</fourthNode>
</thirdNode>
</myDoc>
this would be transformed into something like the following:
firstNode:'asdf1'
secondNode:'asdf2'
thirdNode#fourthNode:'asdf3'
Of course this is only an example, but I think it shows what I want to do.
|
|
|
|
|
|
Hi,
We are making use of SourceGenerator of Castor to generate Java class file from a given schema file and based on the class files we are calling the set functions of the respective classes to populate the corresponding tags in the XML file. We use the marshall function to generate the XML.
We might change the schema file in future, i.e. move some child tags in some different parent tags. for e.g.
excerpt of a schema file.
<empaddress>
<street> Street1
<pincode> 111111
<companyaddress>
<city> XYZ
New schema file:
<empaddress>
<pincode> 111111
<companyaddress>
<street> Street1
<city> XYZ
As it is visible, that <street> tag is moved under <companyaddress> tag. This change triggers change in the names of get/set functions for the corresponding classes and thus generates error during marshalling. Could you please suggest some steps, wherein no code change is required apart from class generation, to accomodate this change in schema file.
Thanks and Regards,
Abdul Qadir
Thanks and Regards,
Abdul Qadir
|
|
|
|
|
I have an xslt file that I use to transform an XML document to a html page. Can I use that same xslt file to change the html back to the original XML?
/\ |_ E X E GG
|
|
|
|
|
I don't see how. Plus your HTML would have to be well formed XML (but that's ok because you surely have XHTML, right?) If the transformation is "1:1", it should be easy to write transfromation (X)HTML->XML based on original one. Maybe it could be even automatized.
David
|
|
|
|
|
Your inverse XSLT may not always be accurate. Mathematically speaking,
f(x)=y, where X is the Xml file, f is the xslt file, and y is the output HTML. But it is also possible f(x2) is also y. So what I'm trying to get is that once you have a "Y", you may not always be able to distinctly identify which input xml produced that result as you may not have preserved all of the input elements/attributes in the output.
|
|
|
|
|
malharone wrote:
Your inverse XSLT may not always be accurate.
You are of course right.
Key phrase in my "solution" is
If the transformation is "1:1"
I had in mind some special cases...
example:
<article>
<title>My Article</title>
<author>Me</author>
<chapter>Chapter 1</chapter>
<text>My Article</text>
</article>
<html>
<head>
<title>My Article</title>
</head>
<body>
<h1>My Article</h1>
<p>My Article</p>
<center>© Me 2005</center>
</body>
</html>
should be easy no?
David
"Stay Kul And Happy" I.A.
|
|
|
|
|
I think simple cases as such should not have any problems. Places where you'd run into issues is when Xslt groups/aggregates and/or sorts the data.
Though bit challenging, you'll have to make sure that the formatting does not change when going XML->HTML. If it does, you'll have to take care of the special case.
I'm not sure if the following is a typo. But if it is not, then your conversion from HTML->XML will lose "Chapter 1" value.
dnh wrote:
My Article
- Malhar
|
|
|
|
|
malharone wrote:
I think simple cases as such should not have any problems. Places where you'd run into issues is when Xslt groups/aggregates and/or sorts the data.
I agree.
malharone wrote:
I'm not sure if the following is a typo. But if it is not, then your conversion from HTML->XML will lose "Chapter 1" value.
yeah damnit, I forgot that It should be only quick example... But you have the idea... and since none of us know how exactly eggie's XML/HTML/XSLT looks like, we won't get anywhere I guess.
David
|
|
|
|
|
hello..
i'm trying to do a system which the crystal report will display the data generate from my class coding.
but i know one way is to use xml to read the data from calss first. and then crystal report only can display the data from xml file....
how can i do that? totally no idea on how to do...
if anyone knows that, pls help.... thanks a lot
|
|
|
|
|
Hi all,
I'm using VB.NET and I can read my XML into a dataset and display it into a DataGrid with no problem. But what I would like to do (if possible) is select certain elements via an id attribute.
For example, if my XML had the following nodes:
<mynode id="someid">innertext
<mynode id="someid">someother innertext
<mynode id="someid">more innertext
<mynode id="someotherID">innertext
How would I be able to display on those nodes with id="someid" and bind my dataset to my Datagrid.
Is this even possible to do or will I have to create another XML document to parse and hold only those specific nodes?
Any help would be much appreciated! Thanks.
|
|
|
|
|
|
Hi,
what I try to do is only to store a string like "&88;" in a XML file using MSXML.
but I got only this content.
<root>
<t>X
What wrong, or were is the missing link?
here is the example code which I use:
.....
HRESULT hr;
IXMLDOMDocument2Ptr mXmlDom;
IXMLDOMNodePtr mRoot4Write;
try {
hr= mXmlDom.CreateInstance(__uuidof(DOMDocument40));
if (FAILED(hr) || mXmlDom == NULL) {
mXmlDom= NULL;
} else {
mXmlDom->put_resolveExternals( false);
mXmlDom->put_async( false);
mXmlDom->put_validateOnParse( true);
mXmlDom->setProperty("NewParser", VARIANT_TRUE );
mXmlDom->put_preserveWhiteSpace(true);
CString csRootNameStart("ROOT");
CString csRootNameEnd("ROOT");
CString csXML;
_bstr_t bstrXML;
csXML.Format("%s\n<%s>\n\n",CDF_PROCESSING_INSTRUCTION, csRootNameStart, csRootNameEnd);
bstrXML = csXML;
if(mXmlDom->loadXML(bstrXML)) {
mRoot4Write = mXmlDom->selectSingleNode(_bstr_t(csRootNameStart));
_variant_t nodetyp;
nodetyp = (long)NODE_ELEMENT;
IXMLDOMNodePtr plastNode = mXmlDom->createNode(nodetyp,_bstr_t("T"),_bstr_t(""));
plastNode = mRoot4Write->appendChild(plastNode);
m_Text.GetWindowText(csXML);
IXMLDOMNodePtr pNode = mXmlDom->createTextNode(_bstr_t(csXML));
pNode = plastNode->appendChild(pNode);
pNode.Release();
_bstr_t parsed;
parsed = plastNode->text;
m_Parsed.SetWindowText(parsed);
plastNode.Release();
_variant_t varFile = "c:\\temp\\test.xml";
hr = mXmlDom->save(varFile);
}
mRoot4Write.Release();
mXmlDom.Release();
}
}
catch (_com_error& er) {
_bstr_t parsed = er.Description();
m_Parsed.SetWindowText(parsed);
mXmlDom= NULL;
}
catch (...) {
mXmlDom= NULL;
}
|
|
|
|
|
wopa wrote:
what I try to do is only to store a string like "&88;" in a XML
&88; is recognized as entity. If you want literal "&88;", then you must encode & as & (as XML spec. says). I am not sure how you do it in your code, since you obviously didn't bother to read your post after yourself - fix your post, and then maybe somebody will help you more...
David
|
|
|
|
|
Sorry but this was my first post.
so here for clarifacation
...
//creating the the DOM document (mXmlDom)
//and select the root (mRoot4Write)
...
_bstr_t theValue("X"); //!!! the ASCII value
IXMLDOMNodePtr plastNode = mXmlDom->createNode(nodetyp,_bstr_t("T"),_bstr_t(""));
plastNode = mRoot4Write->appendChild(plastNode);
IXMLDOMNodePtr pNode = mXmlDom->createTextNode(theValue);
pNode = plastNode->appendChild(pNode);
pNode.Release();
plastNode.Release();
_variant_t varFile = "c:\\temp\\test.xml";
mXmlDom->save(varFile);
...
//release the interfaces
..
The expected content:
<?xml version="1.0" encoding="iso-8859-1"?>
<ROOT><T>X</T></ROOT>
!!!!!!!!!!!
But the content of the file is:
<?xml version="1.0" encoding="iso-8859-1"?>
<ROOT><T>&#88;</T></ROOT>
WHY
|
|
|
|
|
Hi David
a second attemt:
_bstr_t theValue("X"); is wrong !!!!
//the ASCII value 88 for the character X
//not the character itself
//I wrote it correctly but if i Submit the description the X lost in space and the X appear
// hoppfully this gives a small hint about the content of the text node:
CString text = "&" +"#" +"88;";
_bstr_t theValue(text );
|
|
|
|
|
Just do what I said... instead of _bstr_t theValue("X"); use _bstr_t theValue("&#88;"); . '&' is reserved character in XML, and X happen to be HTML (and XML) character entity for 'X'. I think in your code is same problem as what cause confusion in this forum I am only guessing now, but maybe MSXML is somehow optimized so when you give it &#xx; it will write down character with code xx - semanticaly it is the same, every XML parser will read &#xx; as character with code xx, so it is correct.(?)
David
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|