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

Java namespace

Subject: Java namespace
From: xptm@xxxxxxx
Date: Thu, 1 Jul 2004 14:10:01 +0100
java namespace
First, let me tell i'm not a expertise in these areas, so bear with me...

When i declare a namespace pointing to a Java class, is that Java class treated
as a Static class? Or does the XSL processor somehow instatiates a object of
that class?

I'm asking this cause i have this situation:

<?xml version="1.0" encoding="ISO8859-1" ?>
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      	xmlns:gti = "SQLHelper" >

(...)
            <xsl:element name="ResultSet">
      		  <xsl:attribute name="sql"><xsl:value-of
select="gti:AcertaSqlReservado($sql)"/></xsl:attribute>
            </xsl:element>

This XSLT is called by a Java program

public class Tester{
  public static void main(String[] args) {
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(new
FileInputStream(xin+".xml")));
      PrintWriter out = new PrintWriter(new FileOutputStream(xout+".xml"));
      try {
        TransformerFactory xformFactory = TransformerFactory.newInstance();
        Source xsl = new StreamSource("Testes12.xsl");
        Transformer stylesheet = xformFactory.newTransformer(xsl);
        Source request = new StreamSource(br);
        Result response = new StreamResult(out);
        //stylesheet.setParameter("gui", "awt");
        stylesheet.transform(request, response);
      }
      catch (TransformerException e) {
        System.err.println(e);
      }
    }
    catch (FileNotFoundException e) {
      System.err.println(e);
    }
  }
  }

This works OK, but if i change the XSL to

<?xml version="1.0" encoding="ISO8859-1" ?>
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      	xmlns:gti = "Tester"   ---> the same Java class that call the XSLT

i got a TransformerException.

But i don't understand why.

Thanks all.






O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt

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.