Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Creating a large ENTITY container??? [Thread Next] Re: Creating a large ENTITY container???To: NULL Date: 1/1/2006 9:07:00 PM adude28 wrote: > Here is what I have learned from this post. > > 1. When you have an <!ENTITY and you are going to use a CDATA section > then you must choose one type of quote mark internally and use the > other to enclose the CDATA section. Yes, this is mandated by the XML Spec. It's standard practice in most languages that allow both types of quote, I think. > 2. Inside your CDATA section you can not use "%" or "&" marks > otherwise things will bomb out. No, you can use % freely wherever you want EXCEPT in an ENTITY Declaration before the name of the entity, where it has a special meaning. The & is a markup character like < and can be used inside a CDATA Section -- but it will get converted to & when the content of the CDATA Section is processed. I'm not clear why you think % and & are disallowed in CDATA Sections. The text you gave as an example contained neither of these characters. Is there something about your text you aren't telling us? > I followed these two rules and things worked. Unfortunately, now I > realize that this approach will probably not work because I can forsee > times that I may need to use a "%" or "&" mark in my code. You can use both of them whenever you wish. The % will be left as it is. The & will be converted to & of course. Did you read the FAQ pages which explain alternative approaches? > I am thinking of using the following format for my <!ENTITY reference > > <!ENTITY MessageBodyContent SYSTEM > 'http://www.url.com/MessageBodyContent.xml'> > > that way I don't have to touch the content of my > MessageBodyContent.xml and I then I can still post just one file to my > processing page. Any < or & characters in the file will still be converted to < and & when processed unless you kludge it with disable-output-escaping. In any case, the "HTML" fragment you are encapsulating is not valid HTML or XHTML, so any subsequent processor may gag on it (except a browser). ///Peter | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
