473,480 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

<?standalone yes?>

*** post for FREE via your newsreader at post.newsfeed.com ***

I can figure out how to set the standalone attribute in the <? xml
version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?>

closest I have got to what I need is:
<?xml version="1.0" ?>
<?standalone yes?>
<xpg creator="crusher" version="1.0">
<etr>
<rebmun>

using minidom in this code(snippet):
xmldoc = Document()
pi = xmldoc.createProcessingInstruction("standalone","y es")
xmldoc.appendChild(pi)
xmlroot = xmldoc.createElement("xpg")
xmlroot.setAttribute("version","1.0")
xmlroot.setAttribute("creator","crusher")
xmldoc.appendChild(xmlroot)

thx
Lonnie Souder

-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

Jul 18 '05 #1
2 5402
Lonnie, SRC employee <lo*****@tgf.tc.faa.gov> wrote:
I can figure out how to set the standalone attribute in the <? xml
version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?>


To set this in DOM terms you would need to use the DOM Level 3 Core
property 'xmlStandalone' on the Document object, see:

http://www.w3.org/TR/DOM-Level-3-Cor...nt3-standalone

However, DOM3 is still in Working Draft (though hopefully not for
much longer), and it's not yet supported by minidom. If you don't mind
trying a different DOM implementation, this one supports it:

http://www.doxdesk.com/software/py/pxdom.html

--
Andrew Clover
mailto:an*@doxdesk.com
http://www.doxdesk.com/
Jul 18 '05 #2
"Lonnie, SRC employee" wrote:

*** post for FREE via your newsreader at post.newsfeed.com ***

I can figure out how to set the standalone attribute in the <? xml
version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?>


Simplest approach might be to manually munge the <?xml ?> tag
as you write the output to a file. You could do a simple re.sub()
or something like this, which we've used from time to time with no
ill effects to date (pseudo-code, not executable as-is):

xml = '<?xml version="1.0"?><doc><somestuff/></doc>'

xmlEnd = xml.find('?>') + 2

file.write('<?xml standalone="yes" version="1.0"?>' + xml[xmlEnd:])

In other words, find the end of the original <?xml?> tag, strip it,
substitute your own, continue on with life.

Simplest thing that could possibly work...

-Peter
Jul 18 '05 #3

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

Similar topics

9
2938
by: Francesco Moi | last post by:
Hello. I'm trying to build a RSS feed for my website. It starts: ----------------//--------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape...
4
7830
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
6
12136
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with...
34
10965
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
13650
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
7
2725
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
1
1302
by: seeCoolGuy | last post by:
I've been using Access to import some data straight into a sql server database by simply importing the xml file. However lately some of the newer xml files will contain vaild data such as ...
7
3592
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
4
11881
by: mark4asp | last post by:
I have an element, report which contains tags which have been transformed. E.g. <pis &lt;p&gt <myXml> <report>This text has html tags in it.&lt;p&gt which but <has been changed to &lt;&gt</report>...
1
5458
by: VaidehiPawar | last post by:
I am a beginner level in xml..my output page does not convert &gt &lt it shows something like this " &lt;b&gt;Location.&lt;/b&gt;&lt;br /&gt; &lt;UL&gt;&lt;LI&gt;Park Central New York " can anyone help? here is my code ...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.