Re: using character entities and JSF XML

2004-09-18 Thread Eric Suen
 I didn't know that XML required internal document types to declare the
 root element.

see bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=28207

seems tomcat guys like this stupid feature very much, even it is very easy
add an option to disable those kind validation in production env.  I think
the validation is necessary in developing, but in production env, for
performance, maybe we want to disable validation, I just dont understand
why jsp 2.0 force us to validation the xml file even it can not do it well.

Eric




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



question about jsp:element and jsp:attribute

2004-04-06 Thread Eric Suen
Hi

Is the following code correct?

jsp:element name=fo:table-column
  jsp:attribute name=column-width
jsp:expressionwidths[i]/jsp:expression
  /jsp:attribute
  jsp:scriptlet
if (bgColors[i] != null) {
  /jsp:scriptlet
  jsp:attribute name=background-color
jsp:expressionbgColors[i]/jsp:expression
  /jsp:attribute
  jsp:scriptlet
}
  /jsp:scriptlet
/jsp:element

tomcat can run, but the generated java code is not correct:
  out = _jspx_page_context.pushBody();
  out.print(widths[i]);
  String _jspx_temp0 = ((javax.servlet.jsp.tagext.BodyContent)out).getString();
  out = _jspx_page_context.popBody();
  out.write( + fo:table-column +  column-width=\ + _jspx_temp0 + \ + );

   if (bgColors[i] != null) {


   }

  out.write(/ + fo:table-column + );

the second jsp:attribute/ between jsp:scriptlet/ was lost.
can I dynamically generate attribute? and in JSP 5.14, jsp:element
only accept jsp:attribute  jsp:body as child element.

I use tomcat 5.0.19

Regards




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Question about tomcat 5.0.19 jsp XML syntax and Validation and output?

2004-03-18 Thread Eric Suen
Hi,

  I have a jspx file like this:

| ?xml version=1.0?
| fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
| xmlns:jsp=http://java.sun.com/JSP/Page;
| 
|   fo:blocklt;fo:inlinegt;/fo:block
|   fo:block![CDATA[fo:inline]]/fo:block
| /fo:root

and I try tomcat 5.0.19  resin 3.0.6, and the output is:

| ?xml version=1.0 encoding=UTF-8?
| fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;fo:block
| fo:inline/fo:blockfo:block
| ~~~
| fo:inline/fo:block/fo:root
| ~~~

The question is, why do this type docode? I know in XSLT will
escaping ,  to amp; lt; to ensures that the output is
well-formed XML, and has an attribute disable-output-escaping
to prevent this escaping, but I have no idea why the jsp processing
will docode lt; to  ! what's the advantage of this decode?
why make my valid xml file to invalid?

another question is about stupid JSP.6.2.4 JSP Document Validation
why a template engine want do the job xml validator should do?
this feature maybe useful in development time, so, is there any
way to prevent validate in product? even I want validate the xml,
I think I want validate the ouput xml, not the jsp itself? for jsp
processing, a well-formed XML file is not enough? how can I add some
Entity Declarations in my XML file?

Thanks




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Question about jspx and CDATA

2004-03-16 Thread Eric Suen
Hi,

I have a file like this:

| ?xml version=1.0?
| fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
| xmlns:jsp=http://java.sun.com/JSP/Page;
| 
| fo:blocklt;fo:inlinegt;/fo:block
| fo:block![CDATA[fo:inline]]/fo:block
| /fo:root

and the output is:

| ?xml version=1.0 encoding=UTF-8?
| fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;fo:block
| fo:inline/fo:blockfo:blockfo:inline/fo:block/fo:root
  ~~  ~~~
is this a bug? or how can I get ![CDATA[...]] as output?

My env is tomcat 5.0.19  jdk1.4.2

Regards

Eric




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



the problem of jsp:include / in XML view page(tomcat 5.0.19)

2004-03-11 Thread Eric Suen
I have two file hello.jspx  world.jspx like:

  hello.jspx:
  | ?xml version=1.0?
  | fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  | xmlns:jsp=http://java.sun.com/JSP/Page;
  | jsp:include page=world.jspx/
  | /fo:root

  world.jspx:
  | fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format;
  | Hello World
  | /fo:block

  and the result is:
  | ?xml version=1.0 encoding=UTF-8?
  | fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  | ?xml version=1.0 encoding=UTF-8?
  | ~~
  | fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format;
  | Hello World/fo:block/fo:root

and tomcat product too much XML decl, is this a bug?

Regards

Eric




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Question about Jasper Configuration - largefile options in tomcat 5

2004-03-09 Thread Eric Suen
Hi,

I just read http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html
and found something like this:

largefile - Should we store the static content of JSP pages in external
data files, to reduce the size of the generated servlets? true or false,
default false.

but that option is not work, and I search the source codes, can not found
that options, I use JSPX to product XML file, and some files are very big,
so, is this option support in tomcat 5?

Regards,

Eric




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Entity Declarations in JSP/XML

2004-03-08 Thread Eric Suen
If you really want add internal entity declarations in you jspx, maybe you
should enter a feature request at http://issues.apache.org/bugzilla/.

And you can change the org.apache.jasper.compiler.JspDocumentParser
source,
modify the startDTD(...) method to fit your need.

and if you don't want to change the Jasper source code, you can implements
SAXParserFactory, and set the javax.xml.parsers.SAXParserFactory
system property to your owner implemention, and in its newSAXParser()
method,
return your owner SAXParser, and in SAXParser.getXMLReader() method, return
your owner XMLReader and override the setErrorHandler(...) method catch the
JspDocumentParser.ENABLE_DTD_VALIDATION_EXCEPTION exception.

for more detail, I think you can see JspDocumentParser.getSAXParser(...)
method.

 Thanks for the info.

 Do you know though what would be the proper approach to deal with that
 problem. How can I make it so tha the JSP compiler is satisfied with the
 JSP and the jsp:root declaration and my additional entity declarations?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Entity Declarations in JSP/XML

2004-03-05 Thread Eric Suen
Hi,

Long time ago, I ask the same question, and got no answer.
and I found these in JavaServer Pages Specification 2.0:

 JSP.6.2.4 JSP Document Validation

   A JSP Document with a DOCTYPE declaration must be validated
 by the container in the translation phase. Validation errors
 must be handled the same way as any other translation phase
 errors, as described in Section JSP.1.4.1.

   JSP 2.0 requires only DTD validation for JSP Documents;
 containers should not perform validation based on other
 types of schemas, such as XML schema.

Maybe the validate should not make for internal DTD declarations,
and IMHO, that kind of  Specification is stupid, JSP should just be
template engine, not XML validator, if I want validate, I think I know
how to do it, for template engine, the XML file well-formed is enough.

Regards




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



some question about JSPX and the output format

2004-02-02 Thread Eric Suen
Hi,

I have a jspx like this:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE fo:root [
!ENTITY nbsp #160;
]
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:jsp=http://java.sun.com/JSP/Page;
 test name=test value=test/test
/fo:root

it can be parsed by xerces2.6, but when I run it, server throw exception
like this:
org.apache.jasper.JasperException: /blank.jspx(5,96) Element type fo:root
must be declared.
 at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:83)
 at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402
)
 at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126
)
 at
org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:23
4)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:224)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
 at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
52)
 at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
91)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

Another question is about output format, the source xml code is:
test name=name value=test/test
but the output changes to:
test value=test name=name/

I want use jspx as template engine, but the output format is not as
expected.
as I understand, jsp just for generating dynamic content, why it acted like
xml validator and xml formatter?

I use tomcat 5.0.18

Regards,

Eric




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]