|
<employees xmlns="http://www.x.com">
<employee>
<fname>x<lname>y
when i run this line
XmlNode node = doc.SelectSingleNode("/employees/employee[lname='y']/fname");
node obj is null and it made me sick because XPath expr is right..
But, if i clear below part from xml doc, query runs properly.
xmlns="http://www.x.com"
What is wrong?
Any idea..
GMtl
|
|
|
|
|
Is the XML doc available on a Web site so we can see access it?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I found my mistake. I didnot write xpath expr correctly.
private string FindNode(string expr)
{
//load xml doc
doc.Load(rootPath + "sam.xml");
//specify default namespace
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
nsmgr.AddNamespace("x", "http://www.GMtl.com");
//xpath expression
string xpath_expr = "/x:employees/x:employee[x:lname='y']/x:fname";
//get to node and read inner text
XmlNode x = doc.SelectSingleNode(xpath_expr, nsmgr);
string retval = x.InnerText;
return str;
}
-------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<employees xmlns='http://www.xy.com'>
<employee>
<fname> x </fname>
<lname> y </name>
</employee>
</employees>
|
|
|
|
|
Don't you just need to change [lname='y'] to [@lname='y'] ?
|
|
|
|
|
No, I do not. Because lname is not an atribute. The code given with my previous message was correct and it is working. In short, if you have xml doc with namespace, define namespace in code and then specify namespace in the XPath expression.
|
|
|
|
|
Can any one help I reading it a XMLstring form a web service, it read in as a XmlElement.
The Xmlstring is a dataset, How can I get the XmlString in the XmlElement in to a dataset
|
|
|
|
|
DataSet.ReadXml(XmlElement.InnerText)
|
|
|
|
|
Use an System.Xml.XmlNodeReader to read the data into the set
Example:
XmlNodeReader reader = new XmlNodeReader(<xmlelementobject>);
DataSet ds = new DataSet();
ds.ReadXml(reader);
reader.Close();
This should work!
~Javier
"I don't suffer from insanity, I enjoy every minute of it." -- Unknown
|
|
|
|
|
hi all,
i want to convert a word doc to xml format. does anyone have
any advice or code snippets to help me get started.
TIA
CocciaStella
|
|
|
|
|
hi,
At first I did not understand what you had asked, but after a quick search I have come accross these two links. I hope they would be helpful for you.
http://www.msdn.microsoft.com/office/understanding/word/codesamples/default.aspx?pull=/library/en-us/dnword2k/html/odc_expwordtoxml.asp
http://www.msdn.microsoft.com/office/understanding/word/codesamples/default.aspx?pull=/library/en-us/odc_vsto2003_ta/html/wordobject.asp
By the way I saw a site which gives demo project but I cant remember now. It deserves to be examined. Search it. (If I could remember the name, I will let you know)
|
|
|
|
|
when i updat the dataset from he emulator even though i use the writeXml it still doesnt change the actual xml file on my hard disk......as in: it doesnt save the changes made while the emulator is running.
any ideas how it can be done?
|
|
|
|
|
I have recently started working with SAML as one of our suppliers uses this standard to manage security.
As far as I am aware (with my 2 days experience in this language) SAML follows the same structure standards as XML. So if a element has a value that contains a special entity (i.e. &, <, >, ', ") it should be encoded using XML standards, for example
<element>This & That</element>
should be :
<element>This &*amp; That</element>
(ingnore the * I put above, this was needed to prevent the browser rendering a &
Can anybody tell me if I am right or wrong on this one, I am more than happy to eat humble pie but I need to know one way or the other.
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
I am using SOAP 3 in Visual C++ 6 with the low-level calls.
I see that it defaults the Content-Type in the HTTP Header to 'application/dime'.
I am new to SOAP and I am wondering if you can change this value?
|
|
|
|
|
I am trying to transform an XML file using XSLT. in My XSLT file I have
omit-xml-declaration="yes"
This works execpt when I run it using a VbScript. When I load the xml file the Dom addes the declaration and it comes out the other side. How can I tell the DOm not to add it?
Thanks
|
|
|
|
|
Hi,
I've got an amazing problem... I've done a .Net solution for Pocket PC where I load an XML file, I put its content into a dataset.. normal stuff.. and then I want to write things into it : I naturally put :
FileStream fs = new FileStream(file,FileMode.OpenOrCreate); // filename
XmlTextWriter xtw = new XmlTextWriter(fs, Encoding.Unicode);
ds.WriteXml(xtw, XmlWriteMode.IgnoreSchema);
xtw.Close();
fs.Close();
(I want to use Unicode)
but when I want to read the XML file again I have an error : there's a chinese line at the end of the document!! so I copy the downloaded XML file from the pocket PC, and I see that the "encoding" has been changed to "utf-8"..
do you know how to fix this pb? thanx!
|
|
|
|
|
Dear CPians,
(I am using ASP not ASP.NET)
I use a Stored Procedure to get a recordset.
I convert this recordset into an XML Document using the XMLDOM object through a FUnction that I have made.
I the use an XSLT Ducment to generate HTML.
One of the fields in the recordset is an NTEXT field that contains HTML code. When I transform the XML with the XSL the HTML code of that gield is removed.
When I put the HMTL code within the XML Element into CDATA type and I view the page in the browser, I see the acuall HTML code.
Any ideas?
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Being able to see you xslt document would help, but at a guess I would say that you do not have a matching template for the html nodes, so they are not being copied into the output document.
|
|
|
|
|
Suppose I have login page with Email id and password.
In one page I want to put the email and password in the center of the page, and in another page I want to put the email and password in left side of the page.
Can I create this page in XML. This XML file I want to include into my HTML pages. In turn I want to use this page in ASP.NET
Padmavathi
|
|
|
|
|
Hi,
You could create a Web User Control in ASP.NET, then place the user control wherever on the screen you wish the "email/password" control to appear.
Hope this helps,
Andy
|
|
|
|
|
Hello,
Is it possible for ASP Classic to use SOAP to access a .NET web service directly?
I have an existing web application in ASP Classic and I am wanting to move to(or create the next version in) ASP.NET and Web Services, but I will need to also allow my existing application to access my new web services. Any suggestions or articles would be greatly appreciated.
|
|
|
|
|
Hi,
Check out Yuen Chiu So article "ASP.NET Web Service" [^].
NOTE: If you go down the Msxml2.XMLHTTP route you should use Msxml2.ServerXMLHTTP.4.0 as your client is a server process (IIS/ASP). Naturally you must have msxml4 install on the web server.
Here's some comments from Microsoft:
The ServerXMLHTTP object offers functionality similar to that of the XMLHTTP object. Unlike XMLHTTP , however, the ServerXMLHTTP object does not rely on the WinInet control for HTTP access to remote XML documents. ServerXMLHTTP uses a new HTTP client stack. Designed for server applications, this server-safe subset of WinInet offers the following advantages:
- Reliability — The HTTP client stack offers longer uptimes. WinInet features that are not critical for server applications, such as URL caching, auto-discovery of proxy servers, HTTP/1.1 chunking, offline support, and support for Gopher and FTP protocols are not included in the new HTTP subset.
- Security — The HTTP client stack does not allow a user-specific state to be shared with another user's session.
ServerXMLHTTP provides support for client certificates.
Note For more information about the limitations of the WinInet control, see >WinInet Limits Connections Per Server.
Hope this helps,
Andy
|
|
|
|
|
Thanks. This helped.
Do you know where I can find more info on security and how to prevent someone from running specific webservices from ASP Classic/SOAP? I know that ASP.NET and WebServices has security options, but I am not sure how to maybe apply this with ASP Classic.
Thanks
|
|
|
|
|
Hello,
I am having problems trying to parse an XMl file. The file is setup so that the header contains all the general information about the data and the second half of the xml document is made up of totally binary data which is the data that was received. Does anyone know how you can separate the two sections of XML and also, how can I create it so that I can access the information part to refer back to it when I need to decipher the data?? The other problem is that the data in the 2nd half is not in XML schema at all.
Any help would be much appreciated.
Thanks
Nick
|
|
|
|
|
Are you saying that you have one xml document that contains two nodes - one with header information and the second node with binary data - i'm assuming base64 encoded.
If so you should be able to load the document up into the parser ok, and access the two nodes through the dom to be able to get the information seperate.
If the information is being sent as one stream made up of an xml document, and followed by binary data, your going to have to do some preprocessing on the file yourself to split this into two input stream.
|
|
|
|
|
Hello friends
In jabber specifications, have the follow xml tag:
<stream:stream to="denmark" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
Sorry, but I don't understand the 2 xmlns attributes. I know what xmlns is the namespace. But I didn't know what can have 2 namespaces in same tag??? Please, someone can explain me? How I can read this?
Thanks and regards for all
|
|
|
|