I can't help you with the SourceForge registration problem, I'm afraid. It looks like something transient - they've just been making site changes again.
 
Saxon has a configuration option to indicate whether XML 1.1 characters/names are permitted in content: this can be set using -xmlversion:1.1 on the command line, or using configuration.setXMLVersion(Configuration.XML11) in the Java API. This will allow any Unicode codepoint other than 0 (zero) to appear in a string.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Karl Nolan [mailto:karlnolan@gmail.com]
Sent: 02 October 2009 09:38
To: Michael Kay
Subject: Re: Quick question about base64 decoding using saxon

Hi Michael,

Thanks for the reply, I did try to sign up but I'm getting the attached error on registration;

The issue I'm having is that the xml has Unicode values in the xml, hence why I converted it to base64. The data is html and I need the saxon parser to output this html, with/without these unicode values because the parser is failing when it encounters these unicode values.

Do you recommend anything else, i.e. running javascript, java to remove or do something with the Unicode,

Also, when you mentioned setting the flag to allow xml 1.1? is this just the header in the xml document i.e. xml version="1.1".

Many thanks again, I appreciate your help and support,

Karl Nolan

On Thu, Oct 1, 2009 at 11:24 PM, Michael Kay <mike@saxonica.com> wrote:
The method base64Binary-to-string() will only work if the input is indeed the representation of a valid XML string. It seems that in this input there is a representation of the Unicode character with codepoint 1, which is not a valid character in XML 1.0 (though it is valid in XML 1.1). You could probably get over the immediate problem by setting the Saxon Configuration flag that permits XML 1.1 characters; but you would still have problems if the data includes codepoint 0, which is not allowed in XML 1.1 either.
 
(Please note, I would be grateful if you could raise any future questions on the saxon-help mailing list or forum at SourceForge. It's much better for everyone, especially me, if the questions and answers are public and archived.)
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay


From: Karl Nolan [mailto:karlnolan@gmail.com]
Sent: 01 October 2009 12:30
To: mike@saxonica.com
Subject: Quick question about base64 decoding using saxon

 
Hi Mike, I have a little problem with xslt processing, that you probably can help me with. I have googled looking for an answer for hours.

I'm trying to decode an xml node (Data) that contains 64base encoding to normal readable text because its just xml.
 
I have this xml document that I'm processing to html via the saxon xml parsers.
 
<Data>PHA+VGVzd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RCByZWNvbWJpbmFu
dCBib3VnaHQgaW4gZnJvbSBBYm5vdmEuPC9wPg0K
</Data>
 
I'm trying to convert this to the underlining xml
 
<xsl:value-of select="saxon:base64Binary-to-string(xs:base64Binary(Data), 'UTF8')"/>       
 
or
 
<xsl:value-of select="saxon:base64Binary-to-string(xs:base64Binary(Data/text()), 'UTF8')"/>       
 
but I'm getting the following error with saxon 9.x
 
X:\>"java net.sf.saxon.Transform -s:42133.xml -xsl:publish.xsl -o:"42133.htm"
net.sf.saxon.trans.XPathException: The byte sequence contains a character not al
lowed by XML (hex 1)
        at net.sf.saxon.functions.Extensions.checkBytes(Extensions.java:842)
        at net.sf.saxon.functions.Extensions.base64BinaryToString(Extensions.jav
a:769)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFu
nctionCall.java:688)
        at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCa
ll.java:343)
        at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctio
nCall.java:224)
        at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
        at net.sf.saxon.instruct.SimpleContentConstructor.evaluateItem(SimpleCon
tentConstructor.java:261)
        at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:243)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreato
r.java:296)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreato
r.java:296)
        at net.sf.saxon.instruct.Template.expand(Template.java:220)
        at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
        at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.ja
va:281)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreato
r.java:296)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
        at net.sf.saxon.instruct.Template.expand(Template.java:220)
        at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeaving
Tail(CallTemplate.java:440)
        at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:259)
        at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.ja
va:281)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreato
r.java:296)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreato
r.java:296)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.ja
va:345)
        at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
        at net.sf.saxon.Controller.transform(Controller.java:1621)
        at net.sf.saxon.Transform.processFile(Transform.java:1112)
        at net.sf.saxon.Transform.doTransform(Transform.java:719)
        at net.sf.saxon.Transform.main(Transform.java:66)
Error on line 78 of enote.xsl:
  XTDE1180: Error in call to extension function {public static java.lang.String
  net.sf.saxon.functions.Extensions.base64BinaryToString(net.sf.saxon.expr.XPath
Context,net.sf.saxon.value.Base64BinaryValue,java.lang.String) throws java.lang.
Exception}: The byte sequence contains a character not allowed by XML (hex 1)
  at xsl:call-template name="displayeNote" (file:/C:/OPENTEXT/livelink4/support/
enovatorpublisher/enote.xsl#20)
  at xsl:call-template name="eNote" (file:/C:/OPENTEXT/livelink4/support/enovato
rpublisher/main.xsl#80)
  at xsl:call-template name="main" (file:/C:/OPENTEXT/livelink4/support/enovator
publisher/publish.xsl#42)
Transformation failed: Run-time errors were reported
 
 
Can you please point out what I'm doing wrong,
 
Many Thanks
Karl