Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 10th, 2007, 08:05 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default WordprocessingML 2 XML Translation

HI All,

I am generating a XML output using WORD 2003 XML based on styles
(i.e.) Using Saxon 8

Following is my XSLT

================================================== ==============
1st - Method
<xsl:output method="html" omit-xml-declaration="no"
indent="no" />

To generate a html file to get accented characters like &aacute; etc.. in the out put but it results UTF-8 (code - Unicode) [ón] etc..

also I tried using xsl character mapping.

2nd - Method
<xsl:import href="iso8879map.xsl"/>

But it generates the same output.

================================================== ==============

Any help would be appreciated

ROCXY









__________________
Thanks,
Rocxy.
 
Old July 10th, 2007, 08:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use encoding="us-ascii" in the xsl:output declaration.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 11th, 2007, 01:04 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Dear Kay,


Used XSLT:
---------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">
<xsl:import href="iso8879map.xsl"/>
 <xsl:output method="html" encoding="us-ascii" />
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Result:
-------
<para>Los lactantes y los ni#241;os peque#241;os

Query:
------
Required Output.

<para>Los lactantes y los ni&ntilde;os peque&ntilde;os

Any help would be appreciated

ROCXY

 
Old July 11th, 2007, 04:47 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The W3C specs don't give you this level of control over serialization. I'm not sure why you want it - the two forms are exactly equivalent. I thought that Saxon would use a named entity rather than a numeric entity here, but it seems not. If you really care, you can force use of a named entity in Saxon by

 <xsl:output method="html" encoding="UTF-8" saxon:character-representation="entity" xmlns:saxon="http://saxon.sf.net/"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Schema translation w/ included schemas elliottg XSLT 2 May 16th, 2008 04:14 PM
WordprocessingML 2 XML -Probelm-Design-Soultion ROCXY XSLT 1 July 11th, 2007 09:42 AM
XML to XML "Selective" translation : Need Help charleshua XSLT 4 November 12th, 2006 05:22 AM
i18n Translation jagadeesh BOOK: Expert One-on-One J2EE Design and Development 0 June 13th, 2006 08:18 AM
java to C# translation vinny4545 ASP.NET 1.0 and 1.1 Professional 0 July 2nd, 2004 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.