Results 1 to 9 of 9

Thread: XML Entities

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 1999
    Posts
    27

    Question XML Entities

    I have an XML document that references an external dtd. In the dtd I have a list of entities, for some foreign characters. One such entity is <!ENTITY aacute "&#.225;"> (the "." is intentionally put in there otherwise when I post, the á would appear rather than the code) - it works fine except I there is one problem.

    I also have an xsl stylesheet that I use to transform the xml document into an html document... the example code I might use to transform the document:

    Code:
    Dim xmlDoc As DOMDocument, xslDoc as DOMDocument
    
    xmlDoc.async=false
    xslDoc.async=false
    
    xmlDoc.load app.path & "\doc.xml"
    xslDoc.load app.path & "\doc.xsl"
    
    Text1.Text = xmlDoc.transformNode(xslDoc)
    Everything transforms properly, and then I display the output html document in the webbrowser. Everything displays correctly except the "á" which shows up as a little box - to make an already long story a bit shorter, the transformNode creates a META tag in the html document setting the charset=UTF-16. The letter "á" is not in that charset, but the transform node resolves the &#.225; entity to the "á" rather than just passing the &#.225; to the html document.

    I found that I could remedy the problem by parsing the file and removing the charset declaration, but I would rather transform the document putting &#.225; in the html document rather than the actual letter "á" so that the UTF-16 charset can remain in place.

    Any suggestions? Thanks in advance!
    Last edited by Cougar0119; Jun 6th, 2001 at 02:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width