You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2007/10/31 13:58:46 UTC

Java XML : The Sum of all nightmares!!

Hello there! This is keeping me from sleeping at night :(
I'm using Xalan to perform some XSL Transformations. My project is
deployed inside JBoss 4.2 and I'm using JDK 5.0.

When the flow is run inside the container (for instance, we poll a
database, convert it into xml and then use a chain of transformers to
validate, enrich, transformate the whole message)

It works fine. But, when I run a test case from outside the container,
passing a xml that was created from a different document builder then
the one inside jboss (all transformers fail to transform) they simply
drop all tags from the xml.

I've already have a problem with validation and Xalan because of using
diferent document builders. I just can't understand why 2 xml files
that are identical are treated differently from the parser.

Please, is there a way of solving this?

Regards

Re: Java XML : The Sum of all nightmares!!

Posted by Vinicius Carvalho <ja...@gmail.com>.
Hello there folks. Thanks for the help. The problem was with enconding
:) Thanks for the support.

On 10/31/07, Henry Zongaro <zo...@ca.ibm.com> wrote:
>
> Hi, Vinicius.
>
> "Vinicius Carvalho" <ja...@gmail.com> wrote on 2007-10-31 08:58:46
> AM:
>  > It works fine. But, when I run a test case from outside the container,
>  > passing a xml that was created from a different document builder then
>  > the one inside jboss (all transformers fail to transform) they simply
>  > drop all tags from the xml.
>  >
>  > I've already have a problem with validation and Xalan because of using
>  > diferent document builders. I just can't understand why 2 xml files
>  > that are identical are treated differently from the parser.
>
> The scenarios you've described are pretty sketchy, so it's difficult to tell
> what might be going wrong.  When you mention document builders, are you
> speaking specifically about
> javax.xml.parsers.DocumentBuilder?  If so, do the documents
> involved have namespace declarations with elements in the document being in
> those namespaces?  If so, is it possible that in one scenario the
> DocumentBuilder was namespace-aware and in the other it was not?  If that's
> the case, you can create a namespace-aware DocumentBuilder by invoking the
> DocumentBuilderFactory.setNamespaceAware method with a true
> value as the argument.
>
>  Thanks,
>
>  Henry
> ------------------------------------------------------------------
>  Henry Zongaro      XSLT Processors Development
>  IBM SWS Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
>  mailto:zongaro@ca.ibm.com
>


-- 
JBoss Certified Advanced J2EE Developer
IBM Certified SOA Solution Designer
IBM Database Associate - DB2 UDB V8.1 Family
Sun Certified Enterprise Architect (Part I)

Re: Java XML : The Sum of all nightmares!!

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Vinicius.

"Vinicius Carvalho" <ja...@gmail.com> wrote on 2007-10-31 08:58:46 
AM:
> It works fine. But, when I run a test case from outside the container,
> passing a xml that was created from a different document builder then
> the one inside jboss (all transformers fail to transform) they simply
> drop all tags from the xml.
> 
> I've already have a problem with validation and Xalan because of using
> diferent document builders. I just can't understand why 2 xml files
> that are identical are treated differently from the parser.

The scenarios you've described are pretty sketchy, so it's difficult to 
tell what might be going wrong.  When you mention document builders, are 
you speaking specifically about javax.xml.parsers.DocumentBuilder?  If so, 
do the documents involved have namespace declarations with elements in the 
document being in those namespaces?  If so, is it possible that in one 
scenario the DocumentBuilder was namespace-aware and in the other it was 
not?  If that's the case, you can create a namespace-aware DocumentBuilder 
by invoking the DocumentBuilderFactory.setNamespaceAware method with a 
true value as the argument.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com