[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Generating HTML with DataChannel XJP

Subject: Generating HTML with DataChannel XJP
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Thu, 07 Oct 1999 12:15:30 +1300
xjp
I have some HTML 4.0 embedded within an XML document, and want to
use DataChannel's XJ package to reproduce it in the result of an
XSL transformation.

It is my understanding that the default rules should work to copy
parts of the tree without a specific template - when I specify the
default rules myself, the package crashes (specifically when the
text() template is added.) Of course DCXJP is aimed at the December
1998 XSL spec, so I'm stuck with outdated XSL. 

Has anyone run into / solved this problem? And no suggestions
about moving to another package please - I don't enjoy using this
package.

I enclose some sample files to demonstrate the problem

XML
===
<?xml version="1.0"?>

<!DOCTYPE documentation-html []>

<documentation-html>
  <p>Here's some HTML with some <em>emphasis</em>
  and a <a href=".">link</a>.</p>
</documentation-html>
===

XSL
===
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
  <body>
    <xsl:apply-templates />
  </body>
</xsl:template>

<xsl:template match="*">
  <xsl:copy>
    <xsl:apply-templates />
  </xsl:copy>
</xsl:template>

<xsl:template match="text()">
  <xsl:value-of select="." />
</xsl:template>

</xsl:stylesheet>
===

Java
====
import java.io.FileInputStream;

import com.datachannel.xml.om.Document;
import com.datachannel.xml.om.IXMLDOMNode;
import com.datachannel.xml.util.XMLOutputStream;
import com.datachannel.xtl.engine.XTLProcessor;


public class DCXJPTest
{
  public static void main(String argv[]) throws Exception
  {
    if ( (argv.length != 2) ||
      ((argv.length >= 1) && (argv[0].equals("-help"))) )
    {
      System.out.println("java DCXJPTest <dataFile> <styleFile>");
      System.exit(0);
    }

    FileInputStream xmlStream = new FileInputStream(argv[0]);
    Document dataDocument = new Document();
    dataDocument.loadFromInputStream(xmlStream);
    xmlStream.close();

    FileInputStream xslStream = new FileInputStream(argv[1]);
    Document styleDocument = new Document();
    styleDocument.loadFromInputStream(xslStream);
    xslStream.close();

    XMLOutputStream outputStream = new XMLOutputStream(System.out);

    ((IXMLDOMNode)dataDocument.getDocumentElement()).transformNode(
      ((IXMLDOMNode)styleDocument.getDocumentElement()), outputStream);

  } /* void main(String[]) */
} /* class DCXJPTest */
====


-- 
Warren Hedley
Department of Engineering Science
Auckland University
New Zealand


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.