|
hi there , may i know are there any full examples for ebxml ... removeobjectrequest , adhocquery , updateobjectrequest and submitobjectrequest
thanks ...
|
|
|
|
|
I want to merge two xml files using dom parser in C++ using xerces library.
and also to compare one xml file with the xsd file using all with dom parser.
eg:
merge:
<root>
satheesh
<tm>bhaskar
<pl>siddesh
<pl>prashanth
i have to merge a xml file which is
<pl>siddesh
<pe>chary
<pe>sandy
to the above xml file
and out put should be
<root>
satheesh
<tm>bhaskar
<pl>siddesh
<pe>chary
<pe>sandy
<pl>prashanth
and also how to compare one xml file with xsd file using dom in c++.
with regards
Chary
|
|
|
|
|
Any recomendations on a standalone app to test wsdl's. On line would not be acceptable.
I am having an problem with creating a web reference based on a WSDL created by an axis server. The MS supplied wsdl.exe crashs (out of stack space) when I try to create the client code. Both command line and in visual studio.
I run the saved file and or the url through everything I have (other than WSDL.exe) and no compliants. My tools are the current version of SoapScope, Stylus Studio 5.0, Cape Clears SOA editor and some general purpose xml display tools I created.
I do not mind getting old. It beats all the other options that I can think of.
|
|
|
|
|
I'm attempting to validate some xml and absolutely stumped. However, the code always says it fails.
I'm using the note example from the w3schools.com xml tutorial and using the validator linked
to on their website it says everything is good.
The string coming into the doValidation function is the xml file, as a flat string no linebreaks or carriage returns.
Any thoughts/ideas would be great!
<br />
private bool doValidation( string note )<br />
{<br />
_isValid=true;<br />
<br />
StringReader srXml = new StringReader( note );<br />
<br />
XmlValidatingReader vr;<br />
XmlTextReader tr;<br />
XmlSchemaCollection schemaCol = new XmlSchemaCollection();<br />
schemaCol.Add( "http://www.w3schools.com", "c:\\note.xsd" );<br />
<br />
try <br />
{<br />
tr = new XmlTextReader( srXml );<br />
vr = new XmlValidatingReader( tr );<br />
<br />
vr.ValidationType = ValidationType.Schema;<br />
vr.Schemas.Add( schemaCol );<br />
vr.ValidationEventHandler += new ValidationEventHandler(validationCallBack);<br />
<br />
while( vr.Read() )<br />
{}<br />
}<br />
catch( Exception e )<br />
{<br />
this._errorMessage = e.Message;<br />
return false;<br />
}<br />
<br />
return _isValid;<br />
}<br />
<br />
private void validationCallBack( object sender, ValidationEventArgs args )<br />
{<br />
_isValid = false;<br />
_errorMessage = args.Message;<br />
}<br />
|
|
|
|
|
Hi everyone,
I want to learn web services from A to Z, how to write web services, how to call them, how to let other user (on other machine of course)use them. what protocols I need to understand in order to write web services...
If you can give me some links to articles or tutorials to begin understanding the web services technologies.
also if u can give me some book titles discussing web services.
Thanks.
|
|
|
|
|
Goodway wrote:
I want to learn web services from A to Z
Rather a large request.
Ok, Start with tcp/ip and general web communications. There are some articles here on CP to get you started.
Next understand that a web service is the process of sending and optionally recieving a SOAP message sent with the above protocals.
SOAP is just an XML message that is compliant with the SOAP specification.
When you get that down. you can think about what style of service you want. RPC for exposing existing capability as a service or new development doc/litteral (wsdl first)
I hope you get the understanding to know it a-z is not trival. You do not have to know it all to get started.
Just get C# or vb project setup (look over cp, many good articles, some of the better ones are from Roman Kiss, and of course Chris M. also.)
Get your feet wet. Then study what you really have created. I suggest finding a tcp/ip trace tool so you can see what you really sent over the wires.
Good luck.
I do not mind getting old. It beats all the other options that I can think of.
|
|
|
|
|
whats wrong in this xml:
<?xml version='1.0' encoding='utf-8'?>
<root xmlns=''>
<data xmlns=''>
<name>ahmed galal</name>
<name>tamer galal</name>
</data>
</root>
if nothin wrong then why everytime i try to use XmlDocument.Load() it throws an System.Xml.XmlException with message "Root element is missing"
any help ?
|
|
|
|
|
I have no idea. But from the top of my head, try remove empty namespaces.
David
|
|
|
|
|
thanx for ur reply, i think i found the clue, but its not about namespaces
at the begin i was reading the xml data from a stream using XmlDocument.Load() and thats why i had the problem, but finally i tried to read the stream into a string then i use XmlDocument.LoadXml() instead and thats worked fine, but i still don't know why i can't read from the stream directly while XmlDocument.Load() function supports that.
anyway thanx
|
|
|
|
|
hmm I don't know but it could be some encoding issue.. was that xml file really UTF-8 encoded? I mean, try to open it in notepad and re-save with UTF-8 encoding. (assuming you have notepad in WinXP or similar which allows that. VS can do it too IIRC)
David
|
|
|
|
|
actually its not a xml file, its just generated xml send through XmlHttp from the client to the server, and i also don't know about the UTF-8 i just choosed any encoding.
|
|
|
|
|
I'm trying to write a C++ (MFC) program that updates an XML file. I originally just wanted to write my C++ program to deal with the code itself, but then I started updating it to work with special cases and the code got messy. I was told to use an XML parser and since MSXML appears to be already installed on my computer I decided to go with that. The problem is, all the tutorials I found are confusing because they include a lot of unnecessary tasks that would be useful for programs that work with XML files extensively but not for mine. The fact that oftentimes they just show the whole code and say what its final result is doesn't help much either.
I figured out how to create a parser instance and open up a file, but that's as far as I got. My program just needs to update some settings for some tags. For example if the xml file is something like:
<first Value="0"><br />
...<br />
</first><br />
...<br />
<second Value="1"><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
</second>
I just need to get it to look for all isntance of that "first" tag and change its "Value" to 2, then for all instances of "second" tag I need to change it's "Value" to say 3, and also inside every "second" tag I would need to change "OtherValue" setting just for the second occurance of "subsecond" and not for any others. So that the output would end up being something like:
<first Value="2"><br />
...<br />
</first><br />
...<br />
<second Value="3"><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="1"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
</second>
Any help or a link to a tutorial that would actually cause more good than harm would be greatly appreciated, thanks.
|
|
|
|
|
Sorry, the formatting got rid of my XML examples. Here they are again, this is the original:
<first Value="0">
...
</first>
...
<second Value="1">
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
</second>
And the wanted result is:
<first Value="2">
...
</first>
...
<second Value="3">
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="1">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
</second>
Also, please note that the nodes are not necessarily in
<node Value="#">...</node> format, they could also come in <node Value="#" /> format and the second node might come without childnodes, in which case it's second childnode won't be modified (since it doesn't have one).
|
|
|
|
|
Hello:
I am trying to contract an empty tag (with attributes) to the short XML form.
For example:
[current] <col width="100"></col>
[desired] <col width="100"/>
My current XSLT template, outputs beginning <col> and end </col> tags:
<xsl:for-each select="colspec">
<col>
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="(name() = 'colwidth') or (name() = 'colsep') or (name() = 'colname') or (name() = 'colnum')">
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:if test="@colwidth"><xsl:attribute name="width"><xsl:value-of select="@colwidth"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
</col>
</xsl:for-each>
I am wondering how to collapse the end tag when the element is actually empty. Any insight would be greatly appreciated.
Lyteck
|
|
|
|
|
Can't you just create a new element (empty) (<xsl:element name="col" /> ) when you find that the one in your document is empty?
~Javier Lozano
|
|
|
|
|
Hello, I couldn't use your suggestion as the col element has attributes (which need to be added while in some kind of ... "loop").
What I ended up doing is recreate the desired syntax using text output and disable-output-escaping.
<xsl:text disable-output-escaping="yes"><col
<xsl:for-each select="@*">
...
<xsl:text disable-output-escaping="yes">/>
Thanks Javier for the suggestion.
Lyteck Lynhiavu
100 Broadway Ave
New York, NY 10005
|
|
|
|
|
can anybody help me solve why this is happening? I get this exception when tryin to use a custom rendered control from XSLT.
<code>Base Exception: Cannot widen from target type to primitive type.</code>
This is caused when I apply:
<code>
<xsl:element name="ImageControl" namespace="Custom">
<xsl:attribute name="ImageStream">
<xsl:value-of select="imgfn:GetImageByAvatarID(AvatarID)"/> <-- THIS LINE IN PARTICULAR!!!
</xsl:attribute>
</xsl:element>
</code>
the XSLT Extension object (below) IS correctly loaded because i can execute my control without any problem if it is within the ASPX page itself and configured declaritively using control.ImageStream = helper.GetImageByAvatarID(x) ect.
<code>
public System.IO.Stream GetImageByAvatarID(int avatarid)
{
DataRow dr = images.Tables[0].Rows.Find(avatarid);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
foreach(Byte b in (Byte[])dr["avatar"])
{
ms.WriteByte(b);
}
ms.Position = 0;
return ms;
}
</code>
code to init the transform
<code>
public string ExecuteTransform(DataSet ds, string ThreadID)
{
DataSet dsImages = new DataSet();
DataLayer dlAvatarImages = new DataLayer("csp_avatars", DataLayerCommandType.StoredProc);
dlAvatarImages.Parameterize("@thread", ThreadID);
dsImages = dlAvatarImages.Query("avatars");
//xslt transform on post data
XmlDocument xdoc = new XmlDocument();
XslTransform xsl = new XslTransform();
StreamReader sr = new StreamReader(new MemoryStream());
xdoc.LoadXml(ds.GetXml());
//transform attributes
XsltArgumentList xList = new XsltArgumentList();
XsltDateTransform fnDate = new XsltDateTransform();
XsltAvatarGrabber fnAvatar = new XsltAvatarGrabber(dsImages);
//extension objects
xList.AddExtensionObject("urn:datetransform", fnDate);
xList.AddExtensionObject("urn:images", fnAvatar);
xsl.Load(HttpContext.Current.Server.MapPath("")+"\\ForumThread.xslt");
xsl.Transform(xdoc, xList, sr.BaseStream, null);
//reset the underlying stream
sr.BaseStream.Position = 0;
return sr.ReadToEnd();
}
</code>
Any input would be appreciated as I am completely stuck on this one.
|
|
|
|
|
Hi,
I'm pretty much a newbie to xsd's in general, and have a case in a schema I'm designing that I'm not sure how to solve. Basically I have a situation like this:
<parenttype>
<category>Standard</category>
<standardcategorynodes>
<a/>
<b/>
</standardcategorynodes>
</parenttype>
<parenttype>
<category>Special</category>
<specialcategorynodes>
<c>
<d/>
<c/>
</specialcategorynodes>
</parenttype>
where the parent node type is the same, but depending on the value of the category node, subsequent nodes are different. I thought a good solution would be to have a xs:choice, where each choice has a fixed value for the category node and then the relevant subsequent nodes follow but I get a Unique Particle Attribution violation as both choices have the category node. Is there a solution for this type of situation or will i have to workaround it somehow?
Thanks very much, Matt
|
|
|
|
|
I have Xml File like the follwing :
<b><Students xmlns="http://tempuri.org/DemoFile.xsd">
<Student>
<RegNO>1220200054</RegNO>
<Name>Chetan Ranpariya</Name>
<Dept>IT</Dept>
<City>Ahmedabad</City>
</Student>
</Students>
and I had a .xsd file for that in which I set the datatype for
"RegNo" as "long" and set it as a primary key column.
Now problem is when ever I tried to ented text data int RegNo the error is given. It's Ok. But if I enter duplicate value in RegNo field then it does not give any error and accepts data.
So how can I make primary to work like in sql, and access.
Can any one help me?
Thanks in advance for help.
Chetan Ranpariya
|
|
|
|
|
I have a couple of xml files I'd like to create xsd schemas for. This is not so difficult but the problem is that the strcuture of the xml file (something I can't easily influence) is strange.
The files problem section look like this:
<applications>
<version>1.0</version>
<application name="Imager" custom="SlasHas AB">
<device Merge="Yes">
<section name="apsect dependency" default="false">
<key name="defaultImageType">.jpg</key>
<key name="imageHeight">128</key>
<key name="imageWidth">128</key>
<key name="imageColours">65536</key>
<key name="modelGroupName">X Model</key>
<key name="modelSeriesName">X</key>
<key name="modelNames">
<model>X1</model>
<model>7592597B-E087-4565-9BAC-596C096EBB2C</model>
<model>X2</model>
<model>523DC659-B6F8-4b38-8EEB-B19E7AC7F2E3</model></key>
<key name="aspectID">1:1</key>
<key name="transferMode">TCFILETRANSFER</key>
<key name="hidden">1</key>
<key name="defaultImageFolderName">\\</key>
</section>
</device>
</application>
</applications>
My problem is not that I can create a working schema. It is that I'd like to have restrictions on all key elements which I cannot figure out how to do since they are all of different types. For example
key name="defaultImageType" has a string as value and i'd like to have a restriction xs:enumeration value=".jpg | .bmp | .gif"
but I also want to have key name="imageHeight with type xs:positiveInteger and so on.
Is this possible, to have different types on elements with same name? Apparently the xml file works.
And if it is allowed how can I do the schema?
/Clatten
|
|
|
|
|
Hello, I'm trying to save into a xml file some rows that my programs generates, the number of lines to insert into the file is about 2000 and when I generates it, stops into the middle of a line without generation an exception. Anyone knows of such a problem? all the lines have the same structure and they're printed ok on console.
If u need I can paste the code, but I don't if it's too large the number of elements I try to insert.
Thanks
Paolo
ok.....was my fault, with a little more of patients I found that I was missing
xtw.close();
and so the flush of object was not written into file, now that all is ok, I continue playing with my new toy!
|
|
|
|
|
Hello,
I am reading the <item> nodes from a XML file and add them to a dataset.
When I display my dataset in a datagrid I always see the same record.
It's like the For loop is not moving from one item to the next one.
This is my code:
' Load RSS File
Dim news As New XmlDocument()
news.Load("http://www.domain.com/_rss/news.rss")
' Create Dataset
Dim dsNews As DataSet = New DataSet()
dsNews.Tables.Add
dsNews.Tables(0).Columns.Add("title", GetType(String))
dsNews.Tables(0).Columns.Add("description", GetType(String))
' Read Item Nodes
Dim items As XmlNodeList =
news.SelectNodes("/rss[@version='2.0']/channel/item")
For Each item As XmlNode In items
Dim row As DataRow = dsNews.Tables(0).NewRow()
row.Item("title") =
CType(news.SelectSingleNode("/rss[@version='2.0']/channel/item/title").InnerText,
String)
row.Item("description") =
CType(news.SelectSingleNode("/rss[@version='2.0']/channel/item/description").InnerText,
String)
dsNews.Tables(0).Rows.Add(row)
Next
Can someone tell me what is wrong?
Thank You,
Miguel
|
|
|
|
|
Guys,
I have tried to implement the default stylesheet which IE uses to display xml files. Now with a few tweaks to this stylesheet i have tried to acheive one thing that i needed to i.e creating a generic stylesheet which would be applicable to any xml file. I also wanted to display the xml file in the same manner as IE. Now instead of the - and + i have prepended a checkbox. What i need now is to be able to work with these checkboxes. Say like if i select the check box for the parent node all it's child nodes should get selected after this is achieved i need to also incorporate the delete node functionality. When a node is selected it should be deleted from the xml file which in my case would be simply commenting the node in case the user wants the node back.
If there is any other possible way out please lemme know. And yep would it be possible for any of u guys to just gimme a solution as soon as possible.
Please mail me anf i'll send u the xml and xsl files for review.
Regards
Wilbur J. Pereira
"If they love me let them, for the heck of it.If they don't, who da heck cares about it"
|
|
|
|
|
This question arises in my mind when I was reading regarding Yukon support for the XML. My question is in two parts,
"How many there use XML as Pure Database?"
"when we should go for XML as database?"
any comments appreciated
|
|
|
|
|
this questions going through my head too, hope to get comments
|
|
|
|