logo       

Re: Unable to round-trip tab character using XMLHttpRequest and XMLSerializ: msg#00006

Subject: Re: Unable to round-trip tab character using XMLHttpRequest and XMLSerializer
Boris Zbarsky wrote:
> Is there a testcase somewhere that shows your problem?  You should be 
> able to use XMLHttpRequest in a web page just as well as in an extension 
> to construct such a testcase...

I'll work on creating a simple test case and including it here. 
However, I'm pretty sure that this is a problem with the functionality 
of the XMLSerializer, not the XMLHttpRequest.

>> This should be expected, but the question remains: How can a character 
>> entity be written using XMLSerializer?
> 
> It can't.  The point of XMLSerializer is to expose a very simple easy to 
> use serialization model.  Trusted callers who need something more 
> complicated can use nsIDocumentEncoder with all its complexity directly 
> (though I'm not sure even that will let you entity-encode tabs, 
> necessarily).

I'm fine with "very simple" and "easy to use", but then it should work 
by default - even for the not-so-common but within-spec cases.  Without 
any options to set, it seems impossible to call it a configuration/usage 
issue.  The fact that it uses some character entities (e.g. "&") but 
not others seems to be a little bit of an issue.  (Are there any 
comments with how the Xalan-J implementation handles this?)

(While I'm looking for supporting a tab character, it seems that this 
could also affect a number of other non-"word" characters.  In this 
particular case, I'm trying to backup lines out of the hostperm.1 file, 
which is clearly specified to contain tab-separated fields.  Replacing 
with spaces on both the read/write ends seems to be a bad idea, in case 
a space would become valid within one of the fields.)

I'm open to using an alternate serialization method, as long as it is 
guaranteed to be available for use within a Firefox 2.x extension.  Per 
the note at http://developer.mozilla.org/en/docs/XMLSerializer, "it's 
not part of any standard and level of support in other browsers is unknown".

Unfortunately, your suggestion to use nsIDocumentEncoder seems much 
easier said than done.  Searching for "nsIDocumentEncoder" or even 
"DocumentEncoder" on the MDC Wiki currently yields 0 results.  A global 
Google search seems almost as disappointing.  A simple example of 
serializing a XML Document using it from within JavaScript would be most 
ideal.

The only other alternative I can think of at the moment is to place 
these types of values inside of CDATA elements rather than attributes, 
which will end up making my XML structure much longer and more complex.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe