unparsed text

Here should go questions about transforming XML with XSLT and FOP.
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

unparsed text

Post 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
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Post 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.
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

thanks for replying

Post 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?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

Post 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).
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

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

Regards,
Sorin
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

Post by srossouw »

Thanks, I read the saxon documention after I posted. Looks like I'll have to buy saxon sa.
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

Post 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]
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
srossouw
Posts: 6
Joined: Fri Aug 26, 2005 11:14 am

Post 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?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Post Reply