|
-
XSLT conversion problem using VB.NET and character refrences
Hello out there,
we are doing XSLT conversions via VB6.
Now i attempted to write a small conversion program using VB.NET
and i attempted a problem with character refrences.
Maybe somebody out there can help me.
The problem:
In our XML documents we use charcter refrences like ß to encode any
characters which are not US Ascii.
I am doing the conversion from XML to HTML using System.Xml.Xsl.XslTransform()like
below.
(In VB6 this is working fine)
BUT in VB.NET all THESE character refrences are not displayed correctly
(NONSENSE characters instead)
IF i load the file in IE6.0 using the style sheet directly everything is
OK
Can anybody help me ?
Greetings
Michael
Dim xslt As New System.Xml.Xsl.XslTransform()
Dim out As System.IO.StreamWriter
'Dim writer As System.Xml.XmlTextWriter()
Try
out = File.CreateText(m_strActDir + "\out.htm")
xslt.Load("file://" + m_strActXSL)
Dim xpathdocument As New System.Xml.XPath.XPathDocument("file://"
+ m_strActXML)
Dim writer As New System.Xml.XmlTextWriter(out)
writer.Formatting = System.Xml.Formatting.Indented
xslt.Transform(xpathdocument, Nothing, writer)
writer.Close()
Style Sheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl utput method='html' omit-xml-declaration='yes'/>
<xsl:template match="/">
...
XML Dok. sample:
<?xml version='1.0'?> <!DOCTYPE topic SYSTEM 'MedaPS2.dtd'>
<?xml-stylesheet href="medaps_convert2HTML.xsl" type="text/xsl"?>
<topic>
<metalist>
<meta name="Generator" value="SCHEMA MarkupKit 2.0"/>
</metalist>
<mtable>
<table hsdl-percent="21.1 8.5 8.7 8.7 8.7 8.7 8.7 8.7 8.7 8.7" type="t_TDv">
<thead>
<tr>
<th><p>Schalten von Lasten<br/>Insta Schütze 5TT3 7</p></th>
<th></th>
<th><p>20 A</p></th>
<th><p>21 A</p></th>
<th><p>24 A</p></th>
<th><p>25 A</p></th>
<th><p>40 A<br/>Schließer</p></th>
<th><p>40 A<br/>Öffner</p></th>
...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks