Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Creating a large ENTITY container???

From: Peter Flynn <peter.nosp@-.--------.-->
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 &amp; 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 &amp; 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 &lt; and 
&amp; 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



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent