Caleb,

I forgot one thing -- the best way for you to modify this behavior might be
to tinker with XMLSupport/FormatterToHTML.cpp.  That's where you'll find
all of the entities defined that we use when serializing HTML.  The Java
processor now has a way to configure such entities, so it's reasonable to
think that the C++ version might also adopt something like that.

In fact, if someone wanted to do an implementation of configurable entities
for HTML serialization, we'ed be happy to consider accepting it into the
source base.

Much of this may be made unnecessary when XHTML is more ubiquitous, and
XSLT supports an xhtml output format.

Dave



                                                                                       
                       
                    David_N_Bertoni                                                    
                       
                    @lotus.com             To:     [EMAIL PROTECTED]            
                       
                                           cc:     (bcc: David N Bertoni/CAM/Lotus)    
                       
                    08/30/2001             Subject:     Re: entity refs in Xalan C++ 
1.2                      
                    10:44 AM                                                           
                       
                    Please respond                                                     
                       
                    to xalan-dev                                                       
                       
                                                                                       
                       
                                                                                       
                       




In general, we have to expand entity references, since the XPath data model
does not provide for the preservation of entity references, which is why
this code was removed.  It was non-standard and becoming more and more
difficult to support, especially as we move away from supporting the Xerces
DOM.

The easiest solution is to generate a doctype which contains definitions
for such entities.  You can also post-process the resulting XML to remove
entities.  On the other hand, it sounds like you're generating HTML, so
those entities are pre-defined and all compliant browsers should understand
them.  If your HTML parser doesn't, or you're using an XML parser, then
you'll definitely need to include a doctype that refers to an external
subset.  Why not just generate a doctype that references to the HTML 4.0
DTD?

For more information take a look at xsl:output and the doctype-public and
doctype-system attributes for generating references to an external DTD.

Of course, you could simply modify the sources and add back that call, but
then you're relying on non-standard behavior, which might change over time.

Dave




                    "Deupree, Caleb T.

                    (LNG)"                      To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
                    <caleb.deupree@lexis        cc:     (bcc: David N
Bertoni/CAM/Lotus)
                    nexis.com>                  Subject:     entity refs in
Xalan C++ 1.2

                    08/30/2001 08:57 AM

                    Please respond to

                    xalan-dev






Hi,

We're upgrading our application from Xalan C++ 1.1 to the new release, and
one of the API calls we used before was
XercesParserLiaison.SetShouldExpandEntityRefs(boolean).  We receive
documents that have entities like &nbsp; in the contents and '<!ENTITY nbsp
"&#160;">' in the inline DTD.  As a result of our transformations, these
characters are converted to UTF-8 characters in our output (according to
the
encoding attribute on xsl:output).  Without this API call, they are
converted back to entity references in the output document, which creates
parse errors for our client apps.

What are some appropriate remedies for this problem?

Thanks.

---
Caleb Deupree
[EMAIL PROTECTED]









Reply via email to