469,578 Members | 1,263 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

xmlpath by xmldom

Hello,
How can I use xmlpath technogy by xmldom.
(or there is another technique, but not xmldom).

I need some code samples, please.

Thanks :)

Nov 11 '05 #1
8 3510
Mr. x wrote:
How can I use xmlpath technogy by xmldom.
(or there is another technique, but not xmldom).


It's quite big topic. You have to read about XPathNavigator to
understand how to work with XPath in .NET:
http://msdn.microsoft.com/library/en...tframework.asp

And particularly about using XPath with DOM:
http://msdn.microsoft.com/library/en...navigation.asp

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
I used the XMLDOM in javascript,
so I succeed in doing :
var myXML;
var x;
myXML = new ActiveXObject("Microsoft.XMLDOM");
....
myXML.loadXML(my_xml_text);

x = myXML.selectSingleNode("//*");

what should I do in order to get the "x" contents ?
In VB, there is no problem :
msgBox x.xml

, but it doesn't work on JavaScript.

Help, please.

Thanks :)

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
Mr. x wrote:
How can I use xmlpath technogy by xmldom.
(or there is another technique, but not xmldom).
It's quite big topic. You have to read about XPathNavigator to
understand how to work with XPath in .NET:

http://msdn.microsoft.com/library/en...tframework.asp
And particularly about using XPath with DOM:
http://msdn.microsoft.com/library/en...navigation.asp
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3
the my_xml_text is the contents of a table.
<table id = "aTable"
</table>

I get the my_xml_text by :
aTable.tBodies[0].innerHtml.

What I get is not well formed xml,
and the <table id = "aTable"> , i.e, is without the ",
I meant it is <table id = aTable>.

I know that XHTML is well formed XML,
so is it good thing I translate my HTML file to XHTML ?
Is there any function to translate HTML file to XHTML ?

Thanks :)

"Mr. x" <a@b.com> wrote in message
news:eN**************@tk2msftngp13.phx.gbl...
I used the XMLDOM in javascript,
so I succeed in doing :
var myXML;
var x;
myXML = new ActiveXObject("Microsoft.XMLDOM");
...
myXML.loadXML(my_xml_text);

x = myXML.selectSingleNode("//*");

what should I do in order to get the "x" contents ?
In VB, there is no problem :
msgBox x.xml

, but it doesn't work on JavaScript.

Help, please.

Thanks :)

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl...
Mr. x wrote:
How can I use xmlpath technogy by xmldom.
(or there is another technique, but not xmldom).


It's quite big topic. You have to read about XPathNavigator to
understand how to work with XPath in .NET:

http://msdn.microsoft.com/library/en...tframework.asp

And particularly about using XPath with DOM:

http://msdn.microsoft.com/library/en...navigation.asp

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel


Nov 11 '05 #4
Mr. x wrote:
I know that XHTML is well formed XML,
so is it good thing I translate my HTML file to XHTML ? Depends on. Must be some reason you want to translate it to XHTML, but
you didn't told us why.
Is there any function to translate HTML file to XHTML ?

Google for "HTML Tidy".
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #5
Hello,

I am trying to translate a table to an xml format and vice versa,
so I send it from client to server (or client to web-service), and vice
versa - that's all.
Maybe I don't get to the point, and there is a better solution for this then
using xml - please let me know.

Thanks :)

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
Mr. x wrote:
I know that XHTML is well formed XML,
so is it good thing I translate my HTML file to XHTML ?

Depends on. Must be some reason you want to translate it to XHTML, but
you didn't told us why.
Is there any function to translate HTML file to XHTML ?

Google for "HTML Tidy".
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #6
Mr. x wrote:
I am trying to translate a table to an xml format and vice versa,
so I send it from client to server (or client to web-service), and vice
versa - that's all.


So just send piece of HTML to server as string, on server-side convert it to
XML (in .NET you can use SgmlReader for that).
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #7
Mr. x wrote:
I used the XMLDOM in javascript,
so I succeed in doing :
var myXML;
var x;
myXML = new ActiveXObject("Microsoft.XMLDOM");
...
myXML.loadXML(my_xml_text);

x = myXML.selectSingleNode("//*");

what should I do in order to get the "x" contents ?
In VB, there is no problem :
msgBox x.xml


The same in javascript:

<html>
<head>
<title />
<script type="text/javascript">
var myXML;
var x;
myXML = new ActiveXObject("Microsoft.XMLDOM");
myXML.loadXML("<foo>bar</foo>");
x = myXML.selectSingleNode("//*");
alert(x.xml);
</script>
</head>
<body />
</html>
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #8
Thanks ...

Can you give me a code sample, please.

Thanks :)

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Mr. x wrote:
I am trying to translate a table to an xml format and vice versa,
so I send it from client to server (or client to web-service), and vice
versa - that's all.
So just send piece of HTML to server as string, on server-side convert it

to XML (in .NET you can use SgmlReader for that).
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mike Labman | last post: by
3 posts views Thread by reclusive monkey | last post: by
3 posts views Thread by Robert Zurer | last post: by
2 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.