Page 1 of 1
saxon:character-representation="hex" doesn't work?
Posted: Thu Mar 10, 2011 10:37 pm
by sderrick
I'm using Saxon PE 9.3, the version that comes with Oxygen 12.1
I have this near the top of my stylesheet
<xsl:output method="xml"
encoding="us-ascii"
saxon:character-representation="hex"/>
every place where I have a unicode char defined using hex like so
<lb n="0"/><seg>®</seg>
it is transmorgrified into this after running the stylesheet
<lb n="0"/><seg>®</seg>
while yes, that is the same character, I use hex values in all my documents and want to keep them that way.
Is Saxon broke?
Scott
Re: saxon:character-representation="hex" doesn't work?
Posted: Thu Mar 10, 2011 11:04 pm
by george
I cannot reproduce this, probably you have a wrong namespace for the saxom prefix. Please try the following stylesheet:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="xd saxon"
version="2.0" xmlns:saxon="http://saxon.sf.net/">
<xsl:output method="xml"
encoding="us-ascii"
saxon:character-representation="hex"/>
<xsl:template match="/">
<x>
<lb n="0"/><seg>®</seg>
</x>
</xsl:template>
</xsl:stylesheet>
If this works also for you then check that the saxon prefix is bound to the same namespace as in the above sample, that is make sure you have xmlns:saxon="
http://saxon.sf.net/".
If you still have problems please post a sample similar with the above that we can use to reproduce the results you get.
Best Regards,
George
Re: saxon:character-representation="hex" doesn't work?
Posted: Fri Mar 11, 2011 1:01 am
by sderrick
George,
Excellent!
using xmlns:saxon="
http://saxon.sf.net/" for the saxon namespace fixed it!
I don't know where I got the address I was using but it was not correct.
thanks,
Scott
george wrote:I cannot reproduce this, probably you have a wrong namespace for the saxom prefix. Please try the following stylesheet:
If this works also for you then check that the saxon prefix is bound to the same namespace as in the above sample, that is make sure you have xmlns:saxon="
http://saxon.sf.net/".
Best Regards,
George