xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: Problem: xalan dropping element names with transformations?
Date Sat, 07 Feb 2009 23:03:55 GMT

Tatu,

The bad namespace-awareness default is a gotcha that many users of JAXP
eventually hit. Always needs to be set to true explicitly. XSLT, XPath, XML
Schema, XInclude and many others require namespace support. Without it the
behaviour is often undefined. There are no guarantees on what you get when
it's missing.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Tatu Saloranta <cowtowncoder@yahoo.com> wrote on 02/06/2009 08:10:26 PM:

> Ok: I figured it out; it is in fact a problem with namespace-
> awareness settings. Default setting for SAX parsers constructed via
> JAXP SAXParserFactory is (I think) non-namespace-aware. If I
> explicitly set namespace-awareness on factory, things work ok.
> I don't know if there is a bug in some part of ns-awareness
> detection between Xalan and Xerces (or maybe a "feature"? :) ), but
> explicitly setting it avoids these problems.
>
> -+ Tatu +-
>
> ps. apologies if this is a FAQ entry; I tried searching FAQ but
> didn't see a mention
>
> --- On Fri, 2/6/09, Tatu Saloranta <cowtowncoder@yahoo.com> wrote:
>
> > From: Tatu Saloranta <cowtowncoder@yahoo.com>
> > Subject: Problem: xalan dropping element names with transformations?
> > To: xalan-j-users@xml.apache.org
> > Date: Friday, February 6, 2009, 6:05 PM
> > This sounds like something I am doing wrong, but I
> > couldn't quite figure it out. Basically, I am running
> > very simple test xsl transformations with Xalan & Xerces
> > (including what amounts to identity transformation, i.e.
> > just copies input nodes as is), but the output is missing
> > element names.
> > This seems to happen when explicity passing XMLReader
> > constructed from xerces via SAXParserFactory; but if I use
> > another SAX parser (non-xerces), result does contain
> > (prefixed) element names as expected.
> >
> > My first guess was that perhaps this had something to do
> > with versions of xercesImpl and serializer; but downgrading
> > (from Xerces 2.9.1 and matching serializer) didn't
> > resolve the problem.
> >
> > Or could it be some mixup between SAX parser settings; I
> > remember that whethere prefixed-names are reported depends
> > on some of settings.
> > Hmmh. Maybe I need to play with namespace-awareness
> > settings.
> >
> > -+ Tatu +-
Mime
View raw message