[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Default Entity when compose xml file
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 <, >,& 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 (& > > < " ') > 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|