Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Minidom output of XML escaped characters

Reply
Thread Tools

Minidom output of XML escaped characters

 
 
Derek Basch
Guest
Posts: n/a
 
      03-25-2005
Hello,

If I want minidom to output XHTML that includes normally XML escaped
characters how would I do it?

For instance if I use doc.createCDATASection() I get:

<![CDATA[<!--#include virtual="/top.html" -->]]>

and without the CDATASection:

&lt;!--#include virtual="/top.html" -->

when I really need:

<!--#include virtual="/top.html" -->

Any suggestions?

Thanks,
Derek Basch

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      03-25-2005
Derek Basch wrote:

> If I want minidom to output XHTML that includes normally XML escaped
> characters how would I do it?
>
> For instance if I use doc.createCDATASection() I get:
>
> <![CDATA[<!--#include virtual="/top.html" -->]]>
>
> and without the CDATASection:
>
> &lt;!--#include virtual="/top.html" -->
>
> when I really need:
>
> <!--#include virtual="/top.html" -->


that's an XML comment. if you want to insert a comment, insert a
comment:

elem.appendChild(
mydoc.createComment('#include virtual="/top.html"')
)

</F>



 
Reply With Quote
 
 
 
 
Derek Basch
Guest
Posts: n/a
 
      03-25-2005
Thanks effbot. I haven't had much use for XML comments so far and I
guess other people haven't either because it seems they are hardly ever
mentioned.

http://groups-beta.google.com/groups...=Search+Groups

 
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
Replacing _xmlplus.dom.minidom with xml.dom.minidom aine_canby@yahoo.com Python 3 08-03-2007 03:50 PM
.NET-ey way to convert XML-encoded/escaped entities into normal characters/HTML? ASP .Net 2 06-20-2007 05:32 PM
Minidom XML output - attributes in wrong order ? Peter Møllerud Python 2 09-09-2006 07:05 AM
Convert Raw Text Escaped Characters to Characters nicholas.wakefield@gmail.com Java 2 07-11-2005 09:17 PM
Translate escaped characters in a string Ben Finney Python 2 04-03-2004 07:46 AM



Advertisments