[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Default Entity when compose xml file

  • To: Martin Probst <martin@x...>, xml-dev@l...
  • Subject: Re: Default Entity when compose xml file
  • From: jj long <longjingjun@y...>
  • Date: Fri, 28 Oct 2005 03:08:27 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.cn; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1aFh+/32Uk+XkhEEMR+qRqoXmuwXPdCyPbu8qWEJ5/1pa4c+TtK824+uio4GoCbOte5zWIoJclbLVmn5Um8nBuWNBU2d+ZueBy0S9YXuK58jIyRYZuh5V4ktO+vYR07PX96P1Um3f5CXGvQ3v3SD7CKaqDX2UlgYLpm7vy2/fNk= ;
  • In-reply-to: <1130424259.8375.6.camel@l...>

xml default entities
Martin,

I followed your advice. It works well. :-)

It seems this is a general problem when compose xml
file. Is there any exist function  - for example like
encode - to do this in XML lib? I made this replace
function my own currently. 

Cheers,

Long

--- Martin Probst <martin@x...> wrote:

> Hi,
> 
> > One solution I am thinking about is:
> > Replace <,>,& and other characters that can not
> used
> > directly in xml data with &lt;, &gt;,&amp; and etc
> in
> > the data before I compose the xml file.
> > 
> > An other problem is risen here. Are these entities
> > been defined as default entity in the parser
> (Xerces)?
> > I.e.: can I do not define these entities in the
> xml
> > file?
> 
> The entities for the XML meta-characters (&amp; &gt;
> &lt; &quot; &apos;)
> are part of the XML standard itself and always
> available in XML
> documents/parsers. So no need to worry, you can just
> replace occurrences
> of the characters with the appropriate entity.
> 
> Make sure you replace the '&' character first, as
> you will run into ugly
> double escaping problems otherwise. You also only
> need to escape & and <
> in element content, the others are optional.
> 
> Martin
> 
> 
>
-----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at
> http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the
> subscription
> manager:
> <http://www.oasis-open.org/mlmanage/index.php>
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.