logo       

Using Xalan with the Sun Labs Brazil Technology: msg#00438

Subject: Using Xalan with the Sun Labs Brazil Technology


I am trying to add support for XSL to the Brazil technology using Xalan. There was an exisiting example suggesting a use with Brazil, which works very well. I need the ability to pass the parsed document down the handler/template/filter chain and perform additional processing on the text or I might pre process before sending to Xalan to generate XML and or replace macros etc. I have created a tag called

  <applyxsl xsl=birds.xsl .....>

      <?xml version="1.0" encoding="UTF-8"?>

      <Class>

      <Order Name="TINAMIFORMES">

              <Family Name="TINAMIDAE">

                  <Species Scientific_Name="Tinamus major">  Great

      Tinamou.</Species>

                  <Species Scientific_Name="Nothocercus">Highland

      Tinamou.</Species>

                  <Species Scientific_Name="Crypturellus soui">Little

      Tinamou.</Species>

                   ..............

  </applyxsl>


When I read the xml file from a file using FileInptuStream everything works great when I provide the input using a String and StringReader I get the following exception. I am using the supplied birds.xsl example. Here is the code segment that fails....

          StringReader xmlStream = new StringReader(script);

          //FileInputStream xmlStream = new FileInputStream("doc/birds.xml");

          System.out.println( script );

          ByteArrayOutputStream output = new ByteArrayOutputStream();

          transformer.transform(new StreamSource(xmlStream), new 
StreamResult("x.out"));

The exception follows:

Thanks for your time.

Rinaldo

LOG: 5 8087-127.0.0.1-0: xsl.: javax.xml.transform.TransformerException: org.xml.sax.SAXParseE xception: The processing instruction target matching "[xX][mM][lL]" is not allowed. javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The processing instru
ction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:680) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1079) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1057) at ApplyXslServerTemplate.tag_applyxsl(ApplyXslServerTemplate.java:139)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:2
8)
      at java.lang.reflect.Method.invoke(Method.java:313)
at sunlabs.brazil.template.TemplateRunner.process(TemplateRunner.java:317) at sunlabs.brazil.template.TemplateRunner.process(TemplateRunner.java:262) at sunlabs.brazil.template.TemplateHandler.respond(TemplateHandler.java:185)
      at sunlabs.brazil.server.Connection.run(Connection.java:70)
      at java.lang.Thread.run(Thread.java:539)
Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM]
[lL]" is not allowed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1171) at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:348) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:624)
      ... 12 more
---------
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is no
t allowed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1171) at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:348) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:624) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1079) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1057) at ApplyXslServerTemplate.tag_applyxsl(ApplyXslServerTemplate.java:139)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:2
8)
      at java.lang.reflect.Method.invoke(Method.java:313)
at sunlabs.brazil.template.TemplateRunner.process(TemplateRunner.java:317) at sunlabs.brazil.template.TemplateRunner.process(TemplateRunner.java:262) at sunlabs.brazil.template.TemplateHandler.respond(TemplateHandler.java:185)
      at sunlabs.brazil.server.Connection.run(Connection.java:70)
      at java.lang.Thread.run(Thread.java:539)
LOG: 4 8087-127.0.0.1-0: request done
LOG: 3 8087-127.0.0.1-0: Error: 408 Request Time-out: Read timed out
LOG: 4 8087-127.0.0.1-0: socket close






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe