Page 1 of 1

unparsed text

Posted: Fri Aug 26, 2005 11:23 am
by srossouw
Im just trying to get the unparsed-text function to work with oxygen or anything for that matter but I just cant, can anyone help me please. I tried doing it this way:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="2.0">
<xsl:output method="html"/>

<xsl:template match="/">
<xsl:value-of select="fn:unparsed-text('TF20050819.TXT', 'UTF-8')"
disable-output-escaping="yes"/>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
and this way:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="html"/>

<xsl:template match="/">
<xsl:value-of select="unparsed-text('TF20050819.TXT', 'UTF-8')"
disable-output-escaping="yes"/>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
the first give this error:

Code: Select all


The URI http://www.w3.org/2005/02/xpath-functions does not identify an external Java class
and the second gives this error

Code: Select all


Error in expression unparsed-text('TF20050819.TXT', 'UTF-8'): Unknown system function: unparsed-text

Posted: Fri Aug 26, 2005 1:47 pm
by Radu
Hi,

The second version is the correct one but you need to do three more things:

When configuring the transformation scenario select in the combo Saxon8B as the desired XSLT processor.
Also please make sure that in the Preferences/XSLT Options page the Engine Used for XSLT 2.0 validation is Saxon8B and the "Allow calls on external functions" check is activated.



Regards, Radu.

thanks for replying

Posted: Mon Aug 29, 2005 11:31 am
by srossouw
Thanks, it worked nicely. Now I need to validate a element with xsd right after I created it in xslt. Is this possible?

Posted: Mon Aug 29, 2005 12:23 pm
by sorin_ristache
Hello,

Such a validation is not done automatically after applying XSLT stylesheets. Open the XSD in <oXygen/> and use the Validate action available on the toolbar.

Regards,
Sorin

Posted: Mon Aug 29, 2005 12:33 pm
by srossouw
I am writing a java proggy that does all the transforming separately (out of oxygen). So I was asked if I could validate at run-time(or transform-time).

Posted: Mon Aug 29, 2005 3:27 pm
by sorin_ristache
Hello,

You can validate at transform time using the Saxon 8 SA transformer.

Regards,
Sorin

Posted: Mon Aug 29, 2005 4:17 pm
by srossouw
Thanks, I read the saxon documention after I posted. Looks like I'll have to buy saxon sa.

Posted: Tue Aug 30, 2005 10:00 am
by srossouw
Hi there, I just downloaded the saxon8sa libraries and copied them into my plugins/oxygen/lib folder. And then I selected saxon8sa on all the drop downs I could get. Now what? I get a this error:

Code: Select all


com.saxonica.validate.SchemaAwareConfiguration.setMultiThreading(Z)V
[/code]

Posted: Tue Aug 30, 2005 11:04 am
by sorin_ristache
Hello,

Saxon SA 8.5 cannot be used in <oXygen/> 6.1 because Michael Kay changed the API. You have to wait until the 6.2 release in September. Use Saxon SA 8.4 in <oXygen/> 6.1. See

http://www.oxygenxml.com/forum/ftopic1222.html

Regards,
Sorin

Posted: Wed Aug 31, 2005 2:27 pm
by srossouw
Great, thank sorin, your a big help. Now that I copied that saxon8sa jars into the lib folder, im getting a wierd errror on the same scenario:

Code: Select all


net.sf.saxon.Configuration.getDocumentValidator(Lnet/sf/saxon/event/Receiver;Ljava/lang/String;
Lnet/sf/saxon/om/NamePool;ILnet/sf/saxon/type/SchemaType;)Lnet/sf/saxon/event/Receiver;
what is wrong?

Posted: Wed Aug 31, 2005 3:21 pm
by sorin_ristache
Hello,

You copied the Saxon 8.4 SA jars into the [oXygen-install-dir]/lib folder, restarted <oXygen/>, set Saxon SA in the transformation scenario, execute the scenario and get that error ?

Regards,
Sorin