Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > removing elements in namespace

Reply
Thread Tools

removing elements in namespace

 
 
Martin Honnen
Guest
Posts: n/a
 
      09-12-2004


Graham wrote:


> Has anyone done this before? Is there some simple step I might
> be missing? Given an element variable, could you give me a line
> or two of code just to display the namespace tag?


With IE 5 and later on Win elements have two properties
scopeName
giving the prefix and
tagUrn
giving the Namespace URN for example

<html lang="en"
xmlns:gods="http://example.com/2004/09/gods">
<head>
<title>scopeName and tagUrn</title>
<script type="text/javascript">
function testNamespaceProperties () {
var elements = document.body.all;
if (elements) {
var result = '';
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
result += 'tagName: ' + element.tagName + '; ';
result += 'scopeName: ' + element.scopeName + '; ';
result += 'tagUrn: ' + element.tagUrn;
result += '\r\n';
}
alert(result);
}
}

window.onload = function (evt) {
testNamespaceProperties();
};
</script>
</head>
<body>
<p id="p1">
This is a HTML paragraph.
</p>
<div>
<gods:GOD id="GOD">Kibo</gods:GOD>
</div>
</body>
</html>


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-12-2004


Martin Honnen wrote:

>
>
> Graham wrote:
>
>
>> Has anyone done this before? Is there some simple step I might
>> be missing? Given an element variable, could you give me a line
>> or two of code just to display the namespace tag?

>
>
> With IE 5 and later on Win elements have two properties
> scopeName
> giving the prefix and
> tagUrn
> giving the Namespace URN


Documentation is here
http://msdn.microsoft.com/library/de...ies/tagurn.asp
http://msdn.microsoft.com/library/de.../scopename.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Graham
Guest
Posts: n/a
 
      09-12-2004
Hi all,

I'm trying to clean up the output from Word that has been
pasted into a textarea. I'm purging much of the html (all
styles, attributes etc) and would also like to remove things
like vector graphics. To do this I want to simply drop all
elements (or their children) which are in any namespace other
than the default: all the microsoft-specific o, v:drawLine, etc
tags. But I can't persuade javascript to even see the namespaces!
I'm using IE5.5 (this needs to work on browsers that old, but no
older).

Has anyone done this before? Is there some simple step I might
be missing? Given an element variable, could you give me a line
or two of code just to display the namespace tag?

Thanks

Graham
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing GPO setting from XP machine after removing from Domain Piet Slaghekke Computer Support 4 01-02-2007 08:58 PM
removing a namespace prefix and removing all attributes not in that same prefix Chris Chiasson XML 6 11-14-2006 05:08 PM
removing elements invalidates only those iterators that had specifically pointed at the removed elements Alien C++ 6 09-21-2006 03:13 PM
Removing elements from a list that are elements in another list Adam Hartshorne C++ 2 01-27-2006 07:47 AM
Text removing using a macro in a namespace marco_segurini C++ 6 11-26-2004 11:11 PM



Advertisments