473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

xml inline html

I was wondering if it is possible to include a xml structure in your html
document.

For example given the below snippet the function "dothis()" will return 0
and "dothat()" will return 1.

If I can use xml in html I should be returning 1 for both functions.

Thanks,

Mike

<script>
function dothis()
{
var xxx = document.getElementById('xmlid');
alert(xxx.childNodes.length);
}
function dothat()
{
var xxx = document.getElementById('tblid');
alert(xxx.childNodes.length);
}
</script>

<xml id="xmlid">
<data>
<first>abc</first>
</data>
</xml>

<table id="tblid">
<tr>
<td>abc</td>
</tr>
</table>
Jul 20 '05 #1
1 1952
Michael Hill wrote:
I was wondering if it is possible to include a xml structure in your html
document.

For example given the below snippet the function "dothis()" will return 0
and "dothat()" will return 1.

If I can use xml in html I should be returning 1 for both functions.

Thanks,

Mike

<script>
function dothis()
{
var xxx = document.getElementById('xmlid');
alert(xxx.childNodes.length);
}
function dothat()
{
var xxx = document.getElementById('tblid');
alert(xxx.childNodes.length);
}
</script>

<xml id="xmlid">
<data>
<first>abc</first>
</data>
</xml>

<table id="tblid">
<tr>
<td>abc</td>
</tr>
</table>

I think it is possible in xhtml 1.0 strict, but you should define an namespace for the non-xhtml elements.
I do now know if document.getElementById is possible, i think the getElementById method in the DOM is html only.
You should check W3C DOM if getElementId is also defined for plain xml
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Desigan Chinniah | last post by:
I am presently trying to display a list of items INLINE using an image as a seperator..... and having difficulties.... See below for 3 seperate sets of html and css files. Each set does something...
23
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H...
10
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/dev/test.html I'd like to have the colored boxes appear on the same line as "Test" does. The div containing the colored boxes is defined as being inline, yet...
4
by: Tony Johansson | last post by:
Hello experts! I'm reading a book about C++ and there is something about inline that the book says that is unclear for me. The book says the following "Because inline functions are expanded at...
4
by: Nish | last post by:
Hi, I have a question regarding inline functions in C. If I declare a function as inline in the header file but do not define it there. Then I define that function in .c file, however neither...
2
by: Newbie \(C#,Asp.net\) | last post by:
Hi I have two simple questions that I make sure that I have underestood them 1) what is the main difference between inline coding and code behind besides that code behind is part of DLL and is...
0
by: srivalli chavali via DotNetMonster.com | last post by:
Hi. I have a PDF file and a MHT file. Following is the code I'm using to read the file and display it INLINE in the browser. PageData is a MemoryStream object that contains the file's actual...
12
by: Eric Lindsay | last post by:
I'm trying to learn how to read a DTD I wanted to use, http://www.w3.org/TR/html4/strict.dtd to ensure I was treating each element correctly in terms of being block, inline, or flow (either). ...
4
by: txican | last post by:
the HTML is: ---------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <title>foo</title>...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.